2024-02-15 07:08:32 +00:00
|
|
|
package module
|
|
|
|
|
|
|
|
import (
|
|
|
|
autocliv1 "cosmossdk.io/api/cosmos/autocli/v1"
|
|
|
|
"cosmossdk.io/client/v2/autocli"
|
2024-02-16 06:40:42 +00:00
|
|
|
|
2024-04-01 09:57:26 +00:00
|
|
|
registryv1 "git.vdb.to/cerc-io/laconicd/api/cerc/registry/v1"
|
2024-02-15 07:08:32 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
var _ autocli.HasAutoCLIConfig = AppModule{}
|
|
|
|
|
|
|
|
// AutoCLIOptions implements the autocli.HasAutoCLIConfig interface.
|
|
|
|
func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
|
|
|
|
return &autocliv1.ModuleOptions{
|
2024-02-16 06:40:42 +00:00
|
|
|
Query: &autocliv1.ServiceCommandDescriptor{
|
|
|
|
Service: registryv1.Query_ServiceDesc.ServiceName,
|
|
|
|
RpcCommandOptions: []*autocliv1.RpcCommandOptions{
|
|
|
|
{
|
|
|
|
RpcMethod: "Params",
|
|
|
|
Use: "params",
|
|
|
|
Short: "Get the current registry parameters",
|
|
|
|
PositionalArgs: []*autocliv1.PositionalArgDescriptor{},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
RpcMethod: "Records",
|
|
|
|
Use: "list",
|
|
|
|
Short: "List records",
|
|
|
|
PositionalArgs: []*autocliv1.PositionalArgDescriptor{},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
RpcMethod: "GetRecord",
|
|
|
|
Use: "get [record-id]",
|
|
|
|
Short: "Get record info by record id",
|
|
|
|
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
|
|
|
|
{ProtoField: "id"},
|
|
|
|
},
|
|
|
|
},
|
2024-02-26 05:42:36 +00:00
|
|
|
{
|
|
|
|
RpcMethod: "GetRecordsByBondId",
|
|
|
|
Use: "get-records-by-bond-id [bond-id]",
|
|
|
|
Short: "Get records by bond id",
|
|
|
|
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
|
|
|
|
{ProtoField: "id"},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
RpcMethod: "Whois",
|
|
|
|
Use: "whois [name]",
|
|
|
|
Short: "Get name authority info",
|
|
|
|
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
|
|
|
|
{ProtoField: "name"},
|
|
|
|
},
|
|
|
|
},
|
2024-07-24 09:14:39 +00:00
|
|
|
{
|
|
|
|
RpcMethod: "Authorities",
|
|
|
|
Use: "list-authorities",
|
|
|
|
Short: "List authorities (optionally by owner)",
|
|
|
|
FlagOptions: map[string]*autocliv1.FlagOptions{
|
|
|
|
"owner": {
|
|
|
|
Name: "owner",
|
|
|
|
Usage: "Owner to get the authorities for",
|
|
|
|
DefaultValue: "",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2024-02-26 05:42:36 +00:00
|
|
|
{
|
|
|
|
RpcMethod: "NameRecords",
|
|
|
|
Use: "names",
|
|
|
|
Short: "List name records",
|
|
|
|
PositionalArgs: []*autocliv1.PositionalArgDescriptor{},
|
|
|
|
},
|
|
|
|
{
|
2024-02-28 04:53:23 +00:00
|
|
|
RpcMethod: "LookupLrn",
|
|
|
|
Use: "lookup [lrn]",
|
|
|
|
Short: "Get naming info for LRN",
|
2024-02-26 05:42:36 +00:00
|
|
|
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
|
2024-02-28 04:53:23 +00:00
|
|
|
{ProtoField: "lrn"},
|
2024-02-26 05:42:36 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2024-02-28 04:53:23 +00:00
|
|
|
RpcMethod: "ResolveLrn",
|
|
|
|
Use: "resolve [lrn]",
|
|
|
|
Short: "Resolve LRN to record",
|
2024-02-26 05:42:36 +00:00
|
|
|
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
|
2024-02-28 04:53:23 +00:00
|
|
|
{ProtoField: "lrn"},
|
2024-02-26 05:42:36 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
RpcMethod: "GetRegistryModuleBalance",
|
|
|
|
Use: "balance",
|
|
|
|
Short: "Get registry module account balances",
|
|
|
|
PositionalArgs: []*autocliv1.PositionalArgDescriptor{},
|
|
|
|
},
|
2024-02-16 06:40:42 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
Tx: &autocliv1.ServiceCommandDescriptor{
|
2024-02-26 05:42:36 +00:00
|
|
|
Service: registryv1.Msg_ServiceDesc.ServiceName,
|
|
|
|
RpcCommandOptions: []*autocliv1.RpcCommandOptions{
|
2024-02-26 06:16:09 +00:00
|
|
|
{
|
|
|
|
RpcMethod: "RenewRecord",
|
|
|
|
Use: "renew-record [record-id]",
|
|
|
|
Short: "Renew (expired) record",
|
|
|
|
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
|
|
|
|
{ProtoField: "record_id"},
|
|
|
|
},
|
|
|
|
},
|
2024-02-26 05:42:36 +00:00
|
|
|
{
|
2024-03-07 11:25:15 +00:00
|
|
|
RpcMethod: "ReserveAuthority",
|
|
|
|
Use: "reserve-authority [name] [owner]",
|
|
|
|
Short: "Reserve authority name",
|
2024-02-26 05:42:36 +00:00
|
|
|
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
|
|
|
|
{ProtoField: "name"},
|
|
|
|
{ProtoField: "owner"},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
RpcMethod: "SetAuthorityBond",
|
|
|
|
Use: "authority-bond [name] [bond-id]",
|
|
|
|
Short: "Associate authority with bond",
|
|
|
|
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
|
|
|
|
{ProtoField: "name"},
|
|
|
|
{ProtoField: "bond_id"},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
RpcMethod: "SetName",
|
2024-02-28 04:53:23 +00:00
|
|
|
Use: "set-name [lrn] [cid]",
|
|
|
|
Short: "Set LRN to CID mapping",
|
2024-02-26 05:42:36 +00:00
|
|
|
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
|
2024-02-28 04:53:23 +00:00
|
|
|
{ProtoField: "lrn"},
|
2024-02-26 05:42:36 +00:00
|
|
|
{ProtoField: "cid"},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
RpcMethod: "DeleteName",
|
2024-02-28 04:53:23 +00:00
|
|
|
Use: "delete-name [lrn]",
|
|
|
|
Short: "Delete LRN",
|
2024-02-26 05:42:36 +00:00
|
|
|
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
|
2024-02-28 04:53:23 +00:00
|
|
|
{ProtoField: "lrn"},
|
2024-02-26 05:42:36 +00:00
|
|
|
},
|
|
|
|
},
|
2024-02-26 12:56:11 +00:00
|
|
|
{
|
|
|
|
RpcMethod: "AssociateBond",
|
|
|
|
Use: "associate-bond [record-id] [bond-id]",
|
|
|
|
Short: "Associate record with a bond",
|
|
|
|
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
|
|
|
|
{ProtoField: "record_id"},
|
|
|
|
{ProtoField: "bond_id"},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
RpcMethod: "DissociateBond",
|
|
|
|
Use: "dissociate-bond [record-id]",
|
|
|
|
Short: "Dissociate record from (existing) bond",
|
|
|
|
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
|
|
|
|
{ProtoField: "record_id"},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
RpcMethod: "DissociateRecords",
|
|
|
|
Use: "dissociate-records [bond-id]",
|
|
|
|
Short: "Dissociate all records from a bond",
|
|
|
|
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
|
|
|
|
{ProtoField: "bond_id"},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
RpcMethod: "ReassociateRecords",
|
|
|
|
Use: "reassociate-records [old-bond-id] [new-bond-id]",
|
|
|
|
Short: "Re-associate all records from an old to a new bond",
|
|
|
|
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
|
|
|
|
{ProtoField: "old_bond_id"},
|
|
|
|
{ProtoField: "new_bond_id"},
|
|
|
|
},
|
|
|
|
},
|
2024-09-02 04:13:08 +00:00
|
|
|
{
|
|
|
|
RpcMethod: "UpdateParams",
|
|
|
|
Skip: true, // skipped because authority gated
|
|
|
|
},
|
2024-02-26 05:42:36 +00:00
|
|
|
},
|
2024-02-16 06:40:42 +00:00
|
|
|
EnhanceCustomCommand: true, // Allow additional manual commands
|
|
|
|
},
|
2024-02-15 07:08:32 +00:00
|
|
|
}
|
|
|
|
}
|