/
autocli.go
104 lines (101 loc) · 4.87 KB
/
autocli.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
package application
import (
autocliv1 "cosmossdk.io/api/cosmos/autocli/v1"
modulev1 "github.com/pokt-network/poktroll/api/poktroll/application"
)
// AutoCLIOptions implements the autocli.HasAutoCLIConfig interface.
func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
return &autocliv1.ModuleOptions{
Query: &autocliv1.ServiceCommandDescriptor{
Service: modulev1.Query_ServiceDesc.ServiceName,
RpcCommandOptions: []*autocliv1.RpcCommandOptions{
// {
// RpcMethod: "Params",
// Use: "params",
// Short: "Shows the parameters of the module",
// Long: `Shows all the parameters related to the application module.
//
// Example:
// $ poktrolld q application params --node $(POCKET_NODE) --home $(POKTROLLD_HOME)`,
// },
// {
// RpcMethod: "AllApplications",
// Use: "list-application",
// Short: "List all application",
// Long: `List all the applications that staked in the network.
//
// Example:
// $ poktrolld q application list-application --node $(POCKET_NODE) --home $(POKTROLLD_HOME)`,
// },
// {
// RpcMethod: "Application",
// Use: "show-application [address]",
// Short: "Shows a application",
// Long: `Finds a staked application given its address.
//
// Example:
// $ poktrolld q application show-application $(APP_ADDRESS) --node $(POCKET_NODE) --home $(POKTROLLD_HOME)`,
// PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "address"}},
// },
// this line is used by ignite scaffolding # autocli/query
},
},
Tx: &autocliv1.ServiceCommandDescriptor{
Service: modulev1.Msg_ServiceDesc.ServiceName,
EnhanceCustomCommand: true, // only required if you want to use the custom command
RpcCommandOptions: []*autocliv1.RpcCommandOptions{
// {
// RpcMethod: "UpdateParams",
// Skip: true, // skipped because authority gated
// },
// {
// RpcMethod: "StakeApplication",
// Use: "stake-application [stake] [services]",
// Short: "Send a stake-application tx",
// Long: `Stake an application using a config file. This is a broadcast operation that will stake
// the tokens and serviceIds and associate them with the application specified by the 'from' address.
//
// Example:
// $ poktrolld tx application stake-application --config app_stake_config.yaml --keyring-backend test --from $(APP) --node $(POCKET_NODE) --home $(POKTROLLD_HOME)`,
// PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "stake"}, {ProtoField: "services"}},
// },
// {
// RpcMethod: "UnstakeApplication",
// Use: "unstake-application",
// Short: "Send a unstake-application tx",
// Long: `Unstake an application. This is a broadcast operation that will unstake
// the application specified by the 'from' address.
//
// Example:
// $ poktrolld tx application unstake-application --keyring-backend test --from $(APP) --node $(POCKET_NODE) --home $(POKTROLLD_HOME)`,
// PositionalArgs: []*autocliv1.PositionalArgDescriptor{},
// },
// {
// RpcMethod: "DelegateToGateway",
// Use: "delegate-to-gateway [gateway-address]",
// Short: "Send a delegate-to-gateway tx",
// Long: `Delegate an application to the gateway with the provided address. This is a broadcast operation
// that delegates authority to the gateway specified to sign relays requests for the application, allowing the gateway
// act on the behalf of the application during a session.
//
// Example:
// $ poktrolld tx application delegate-to-gateway $(GATEWAY_ADDR) --keyring-backend test --from $(APP) --node $(POCKET_NODE) --home $(POKTROLLD_HOME)`,
// PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "gateway_address"}},
// },
// {
// RpcMethod: "UndelegateFromGateway",
// Use: "undelegate-from-gateway [gateway-address]",
// Short: "Send a undelegate-from-gateway tx",
// Long: `Undelegate an application from the gateway with the provided address. This is a broadcast operation
// that removes the authority from the gateway specified to sign relays requests for the application, disallowing the gateway
// act on the behalf of the application during a session.
//
// Example:
// $ poktrolld tx application undelegate-from-gateway $(GATEWAY_ADDR) --keyring-backend test --from $(APP) --node $(POCKET_NODE) --home $(POKTROLLD_HOME)`,
// PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "gateway_address"}},
// },
// this line is used by ignite scaffolding # autocli/tx
},
},
}
}