Skip to content
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

make lotus-miner net commands hit markets subsystem. #7042

Merged
merged 2 commits into from
Aug 12, 2021

Conversation

raulk
Copy link
Member

@raulk raulk commented Aug 12, 2021

The libp2p host on the miner is now only started where the markets subsystem runs. This PR makes lotus-miner net commands hit the node where the markets subsystem is running.

Honestly, Net no longer belongs in the Common commands, nor should the endpoint be resolved through GetCommonAPI/GetAPI, but there is some larger untangling to do to tidy this up, and it's associated with pre-existing tech debt.

Choosing not to do it now, as there are other decisions to make first with regards to providing the optimal UX experience for miners, now and as we introduce more miner services.


Testing: unfortunately we don't have a decent framework/suite for CLI testing. All itests hit the JSON-RPC API or the native API. So I can't add a test for this. Instead, I performed manual testing and all looks good.

@raulk raulk requested a review from a team as a code owner August 12, 2021 10:18
@raulk raulk changed the title make lotus-miner net commands hit markets subsystem. make lotus-miner net commands hit markets subsystem. Aug 12, 2021
@raulk
Copy link
Member Author

raulk commented Aug 12, 2021

Before

$ lotus-miner net peers
ERROR: method not supported

After

$ lotus-miner net peers
12D3KooW..., [/ip4/1.2.3.4/tcp/1]
12D3KooW..., [/ip4/2.3.4.5/tcp/2]
12D3KooW..., [/ip4/3.4.5.6/tcp/3]
12D3KooW..., [/ip4/4.5.6.7/tcp/4]

Note how I don't need to use --call-on-markets.

Copy link
Contributor

@dirkmc dirkmc left a comment

Choose a reason for hiding this comment

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

Nice 👍

Copy link
Contributor

@magik6k magik6k left a comment

Choose a reason for hiding this comment

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

We also need to add NetCmd to cmd/lotus, otherwise we'll lose net commands on the chain process

cli/cmd.go Outdated Show resolved Hide resolved
@raulk
Copy link
Member Author

raulk commented Aug 12, 2021

@magik6k cmd/lotus uses lcli.Commands, which already has lcli.NetCmd, that's why it's not a problem. The only thing using lcli.CommonCommands is actually cmd/lotus-miner. That's why I say that this part of the codebase needs a deeper refactor.

var Commands = []*cli.Command{

@jennijuju
Copy link
Member

Nice! thanks for this - would be really nice to get in v1.11.1.

@raulk raulk merged commit 3960f71 into master Aug 12, 2021
@raulk raulk deleted the fix/lotus-miner-net-markets branch August 12, 2021 15:46
@jennijuju jennijuju mentioned this pull request Aug 13, 2021
10 tasks
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.

5 participants