8000 feat(cmd/network): implement `client create` cmd by Pantani · Pull Request #2401 · ignite/cli · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat(cmd/network): implement client create cmd #2401

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 27 commits into from
May 10, 2022
Merged

Conversation

Pantani
Copy link
Collaborator
@Pantani Pantani commented Apr 22, 2022

part of #2289

Description

  • Create a node package to fetch the info from the launching chain;
  • Create a method to fetch the StakingParams from the launching chain;
  • Create a method to fetch the ConsensusState from the launching chain;
  • Create a method to fetch the ValidatorSet from the launching chain;
  • Create a method to send the MsgCreateClient to the network;

How to test

  • Launch the SPN and the chain. Publish a chain and run the command below:
ignite n --local client create 1 tcp://localhost:26659 --from alice

@Pantani Pantani requested review from fadeev and ilgooz as code owners April 22, 2022 02:36
@Pantani Pantani self-assigned this Apr 22, 2022
@Pantani Pantani changed the title Feat/network connect feat(network): Create network connect command to send MsgCreateClient to the network Apr 22, 2022
@Pantani Pantani changed the title feat(network): Create network connect command to send MsgCreateClient to the network feat(network): create network connect command to send MsgCreateClient to the network Apr 22, 2022
@Pantani Pantani requested a review from ivanovpetr April 22, 2022 12:30
@lumtis
Copy link
Contributor
lumtis commented Apr 22, 2022

I tested with https://github.com/lubtd/orbit, it works great!

ignite n --local connect 1 tcp://localhost:26659 --from alice
𝓲 Client created: 07-tendermint-0

I can use Hermes to connect the chains and relay monitoring afterward

Do we plan to extend this command to perform the connection?
I think having a command with the current state of this one can be useful to create a client without performing the connection if a user uses their own solution for the relayer

@Pantani
Copy link
Collaborator Author
Pantani commented Apr 22, 2022

I tested with https://github.com/lubtd/orbit, it works great!

ignite n --local connect 1 tcp://localhost:26659 --from alice
𝓲 Client created: 07-tendermint-0

I can use Hermes to connect the chains and relay monitoring afterward

Do we plan to extend this command to perform the connection? I think having a command with the current state of this one can be useful to create a client without performing the connection if a user uses their own solution for the relayer

I Agree. I think we can keep this command and create another one to perform the connect. What do you consider changing this command's name to create-client? And we can make the connect command for the relayer. If the user passes the --create-client tcp://localhost:26659, the connect command will generate the client before the connection.

I will work in the relayer now in another PR

@Pantani Pantani changed the title feat(network): create network connect command to send MsgCreateClient to the network feat(network): create network client create command to send MsgCreateClient to the network Apr 24, 2022
@ilgooz ilgooz added this to the T1 milestone Apr 25, 2022
@ilgooz ilgooz changed the title feat(network): create network client create command to send MsgCreateClient to the network feat(network): imlement client create cmd Apr 25, 2022
@ilgooz ilgooz changed the title feat(network): imlement client create cmd feat(network): implement client create cmd Apr 25, 2022
@ilgooz ilgooz changed the title feat(network): implement client create cmd feat(cmd/network): implement client create cmd Apr 25, 2022
}
return &Node{
cosmos: c,
stakingQuery: stakingtypes.NewQueryClient(c.Context()),
Copy link
Member

Choose a reason for hiding this comment

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

This query client needs to be configurable from outside through Options, like we do in network.New. for easy testing

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's the same logic used for the network. And also, the mocks for the StakingQuery are already there. It's already prepared for the unit test. We only need to find a way to mock the Node structure with mockery package.

@Pantani Pantani requested a review from ilgooz May 3, 2022 16:30
@Pantani Pantani requested a review from jeronimoalbi as a code owner May 5, 2022 14:37
Copy link
Member
@ilgooz ilgooz left a comment

Choose a reason for hiding this comment

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

I tried with single node (coordinator as the validator) and I get the following error, can you please help me to understand what would be the problem or if this is a bug?

ilker>ignite-hq/cli $ ignite n chain publish https://github.com/ilgooz/mars
✔ Source code fetched
✔ Blockchain set up
✔ Chain's binary built
✔ Blockchain initialized
✔ Genesis initialized
✔ Network published 
⋆ Launch ID: 8 
⋆ Campaign ID: 9 
? The chain has already been initialized under: /Users/ilker/spn/8. Would you like to overwrite the home directory? [y/N] y█
✔ Source code fetched
✔ Blockchain set up
✔ Blockchain initialized
✔ Genesis initialized
? Staking amount 95000000stake
? Commission rate 0.10
? Commission max rate 0.20
? Commission max change rate 0.01
⋆ Gentx generated: /Users/ilker/spn/8/config/gentx/gentx.json
ilker>ignite-hq/cli $ ignite n chain join 8 --amount 96000000stake
? Peer's address 176.238.80.73:26656
✔ Source code fetched
✔ Blockchain set up
✔ Account added to the network by the coordinator!
✔ Validator added to the network by the coordinator!
ilker>ignite-hq/cli $ ignite n chain launch 8                     
✔ Chain 8 will be launched on Fri May  6 15:58:48 +03 2022
ilker>ignite-hq/cli $ ignite n chain prepare 8
✔ Source code fetched
✔ Blockchain set up
✔ Genesis initialized
✔ Genesis built
✔ Chain is prepared for launch

You can start your node by running the following command:
	/Users/ilker/Documents/source/go/bin/marsd start --home /Users/ilker/spn/8
ilker>ignite-hq/cli $ marsd start --home /Users/ilker/spn/8 
3:59PM INF starting ABCI with Tendermint
3:59PM INF Starting multiAppConn service impl=multiAppConn module=proxy
3:59PM INF Starting localClient service connection=query impl=localClient module=abci-client
...
ilker>ignite-hq/cli $ ignite n client create 8 http://localhost:26657
rpc error: code = InvalidArgument desc = failed to execute message; message index: 0: validator set can't be verified validator consensus pub key not found: 1AF9274F725CF263EF32EC2455668C5DC39915E3: validator not found: invalid validator set: invalid request

@Pantani Pantani force-pushed the feat/network-connect branch from 6e5f99d to c3ec51b Compare May 9, 2022 20:12
@Pantani Pantani requested a review from ilgooz May 10, 2022 03:33
@ilgooz ilgooz merged commit ba62f88 into develop May 10, 2022
@ilgooz ilgooz deleted the feat/network-connect branch May 10, 2022 20:44
Jchicode pushed a commit to Jchicode/cli that referenced this pull request Aug 9, 2023
* add network connect command

* add keyring flags and fix the pubkey encode

* migrate ibc method to cosmoclient

* move the command to `network client create`

* apply comments suggestions from the PR and code quality

* remove unused mocks

* add cliui to network conenct command

* fix pk encoding

* converting to pk to proto

* update mock and new node method name to `NewNodeClient`

* fix pub key into the gentx parser

* fix unit tests for ParseGentx test method

* simplify code logic

* fix unit tests

* Apply suggestions from code review

* refactor

Co-authored-by: İlker G. Öztürk <ilkergoktugozturk@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0