8000 refactor: add&use chaincmdrunner package by ilgooz · Pull Request #612 · ignite/cli · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
8000

refactor: add&use chaincmdrunner package #612

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jan 7, 2021
Merged

Conversation

ilgooz
Copy link
Member
@ilgooz ilgooz commented Jan 4, 2021

chaincmdrunner provides a high level API to execute commands of an SDK app through programaticall access.

  • refactor services/ to use this new pkg.

@ilgooz ilgooz force-pushed the feat/chaincmdrunner branch 3 times, most recently from 40fdbed to 755cc5a Compare January 5, 2021 11:57
@ilgooz ilgooz changed the title add chaincmdrunner package refactor: add&use chaincmdrunner pack 8000 age Jan 5, 2021
@ilgooz ilgooz force-pushed the feat/chaincmdrunner branch from 755cc5a to 05bc75d Compare January 6, 2021 15:04
@ilgooz ilgooz added this to the Refactoring milestone Jan 6, 2021
@ilgooz ilgooz force-pushed the feat/chaincmdrunner branch 6 times, most recently from 93f8b0b to 08dab30 Compare January 7, 2021 08:56
@ilgooz ilgooz force-pushed the feat/chaincmdrunner branch from 08dab30 to e7b3711 Compare January 7, 2021 09:44
@ilgooz ilgooz linked an issue Jan 7, 2021 that may be closed by this pull request
@ilgooz ilgooz marked this pull request as ready for review January 7, 2021 09:44
@ilgooz ilgooz requested review from fadeev and lumtis as code owners January 7, 2021 09:44
fadeev
fadeev previously approved these changes Jan 7, 2021
Copy link
Contributor
@fadeev fadeev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK 👍

Copy link
Contributor
@lumtis lumtis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good👍
Let me just try some tests before approving

Very great refactoring that improves the source code

chaincmd.WithChainID(id),
chaincmd.WithHome(c.Home()),
)
chaincmd.WithKeyringBackend(chaincmd.KeyringBackendTest),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doing this we assume that all chains will use the test keyring backend. Currently, this is not what we have we chain used through networkbuilder for example

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, I just checked the source code of networkbuilder, are you sure that we don't use test keyring backend there? Because it seems we don't specify this while adding accounts etc., and SDK chains by default uses the test backend.

PS, as a feature, I think we should let this to be configurable by the user for the network commands.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the os keyring backend is used by default.
This works on Gitpod so it's ok for me to let it, the value will become configurable in #615

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, yes, that's right. Only, the apps scaffold by Starport have it pointed to test. Regardless, we should be explicitly setting a value either as test or os to introduce a fixed behavior. @fadeev what're your thoughts on witch value we should set by default for starport network chains?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think starport network chains should use os keyring by default, because these commands are meant to run in "production" environments.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tracked by #617.

app App
cmd chaincmd.ChainCmd
app App
chain *Chain
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The plugin is already an attribute of the chain so I don't think it's a good pattern to have.
But it's ok to let it now. In #615, I do a refactoring and let chain providing the command instance when calling functions from the plugin

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is a circular dependency right there. 😈

I was planning to get rid of it and in-fact improve the overall plugin architecture within #608. Let's coordinate on this to not get overlapped with each other's code. ⌨️ 💻

lumtis
lumtis previously approved these changes Jan 7, 2021
@ilgooz ilgooz dismissed stale reviews from lumtis and fadeev via 7584034 January 7, 2021 12:58
@ilgooz ilgooz requested review from lumtis and fadeev January 7, 2021 12:58
@ilgooz ilgooz merged commit c80e560 into develop Jan 7, 2021
@ilgooz ilgooz deleted the feat/chaincmdrunner branch January 7, 2021 13:17
faddat added a commit that referenced this pull request Jan 8, 2021
… develop

* 'develop' of https://github.com/tendermint/starport:
  refactor: add&use chaincmdrunner package (#612)
Jchicode pushed a commit to Jchicode/cli that referenced this pull request Aug 9, 2023
`chaincmdrunner` provides a high level API to execute commands of an SDK app through programmatic access.

* refactor `services/` to use this new pkg.

* init cmdchainrunner pkg

* start using chaincmdrunner in chain and networkbuilder services

* cleanup

* fix linter

* cosmetics
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: create chaincmdrunner pkg
3 participants
0