-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(client): add auto cli for node service (#21074)
- Loading branch information
1 parent
adf5d1b
commit 1cb2336
Showing
5 changed files
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package node | ||
|
||
import ( | ||
autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" | ||
nodev1beta1 "cosmossdk.io/api/cosmos/base/node/v1beta1" | ||
) | ||
|
||
var ServiceAutoCLIDescriptor = &autocliv1.ServiceCommandDescriptor{ | ||
Service: nodev1beta1.Service_ServiceDesc.ServiceName, | ||
RpcCommandOptions: []*autocliv1.RpcCommandOptions{ | ||
{ | ||
RpcMethod: "Config", | ||
Use: "config", | ||
Short: "Query the current node config", | ||
}, | ||
{ | ||
RpcMethod: "Status", | ||
Use: "status", | ||
Short: "Query the current node status", | ||
}, | ||
}, | ||
} | ||
|
||
// NewNodeCommands is a fake `appmodule.Module` to be considered as a module | ||
// and be added in AutoCLI. | ||
func NewNodeCommands() *nodeModule { | ||
return &nodeModule{} | ||
} | ||
|
||
type nodeModule struct{} | ||
|
||
func (m nodeModule) IsOnePerModuleType() {} | ||
func (m nodeModule) IsAppModule() {} | ||
|
||
func (m nodeModule) Name() string { | ||
return "node" | ||
} | ||
|
||
func (m nodeModule) AutoCLIOptions() *autocliv1.ModuleOptions { | ||
return &autocliv1.ModuleOptions{ | ||
Query: ServiceAutoCLIDescriptor, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters