registry

package
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 18, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

README

Registry

Abstract

Registry module provides the following feature:

  • Register domains
  • Update name records

Stores

proto/mycel/registry

domain.proto
enum DnsRecordType {
  A = 0;
  AAAA = 1;
  CNAME = 2;
  NS = 3;
  MX = 4;
  PTR = 5;
  SOA = 6;
  SRV = 7;
  TXT = 8;
}

enum DnsRecordFormat {
  IPV4 = 0;
  IPV6 = 1;
  FQDN = 2;
}

enum WalletRecordType {
  ETHEREUM_MAINNET = 0;
  ETHEREUM_GOERLI = 1;
  POLYGON_MAINNET = 2;
  POLYGON_MUMBAI = 3;
  GNOSIS_MAINNET = 4;
  GNOSIS_CHIADO = 5;
}

enum WalletAddressFormat {
  ETHEREUM = 0;
}

message DnsRecord {
  DnsRecordType DnsRecordType = 1;
  DnsRecordFormat DnsRecordFormat = 2;
  string value = 3;
}

message WalletRecord {
  WalletRecordType WalletRecordType = 1;
  WalletAddressFormat WalletAddressFormat = 2;
  string value = 3;
}

message Domain {
  string name = 1; 
  string parent = 2; 
  string owner = 3; 
  int64 expirationDate = 4; 
  map<string, DnsRecord> DnsRecords = 5;
  map<string, WalletRecord> WalletRecords = 6;
  map<string, string> Metadata = 7;
}

Events

Registry module emits the following events:

RegisterDomain

Event Type: register-domain
Attributes:

  • name: Domain name
  • parent: Domain parent
  • registration-period-in-year: Registration period in year
  • expiration-date: Expiration date in Unix time
  • domain-level: Domain level
UpdateWalletRecord

Event Type: update-wallet-record
Attributes:

  • name: Domain name
  • parent: Domain parent
  • wallet-record-type: Wallet record type
  • value: Wallet address
UpdateDNSRecord

Event Type: update-dns-record
Attributes:

  • name: Domain name
  • parent: Domain parent
  • dns-record-type: Wallet record type
  • value: Wallet address

Transactions

register-domain

Register domain to mycel

myceld tx registry register-domain [name] [parent] [registration-period-in-year]
update-wallet-record

Update wallet address record

myceld tx registry update-wallet-record [name] [parent] [wallet-record-type] [value]
update-dns-record

Update DNS record

myceld tx registry update-dns-record [name] [parent] [dns-record-type] [value]

Queries

list-domain

List all domain

myceld q regisry list-domain

An example output:

domain:
- DNSRecords: {}
  expirationDate: "0"
  metadata: {}
  name: cel
  owner: ""
  parent: ""
  walletRecords: {}
- DNSRecords: {}
  expirationDate: "1711123442987026000"
  metadata: {}
  name: foo
  owner: cosmos1tk8gg20pcdp9alnnn6a84tdycf7pa2rjg8kwmc
  parent: cel
  walletRecords: {}
pagination:
  next_key: null
  total: "0"
show-domain

Query domain records by domain

myceld q regisry show-domain [name] [parent]

example:
Query foo.cel

myceld q registry show-domain foo cel

Output:

domain:
  DNSRecords: {}
  expirationDate: "1711123442987026000"
  metadata: {}
  name: foo
  owner: cosmos1tk8gg20pcdp9alnnn6a84tdycf7pa2rjg8kwmc
  parent: cel
  walletRecords:
    ETHEREUM_MAINNET:
      WalletAddressFormat: ETHEREUM
      value: 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266
      walletRecordType: ETHEREUM_MAINNET
list-domain-ownership

List all domain ownership

myceld q registry list-domain-ownership
show-domain-ownership

Query domain ownership by owner

myceld q registry show-domain-ownership [owner]    
domain-registration-fee

Query domain registration fee

myceld q registry domain-registration-fee [name] [parent]

Response:

fee:
  amount: string
is-registrable-domain

Query a domain is registrable

myceld q registry is-registrable-domain [name] [parent] 

Response:

errorMessage: string
isRegstrable: bool

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExportGenesis

func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState

ExportGenesis returns the module's exported genesis

func InitGenesis

func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState)

InitGenesis initializes the module's state from a provided genesis state.

Types

type AppModule

type AppModule struct {
	AppModuleBasic
	// contains filtered or unexported fields
}

AppModule implements the AppModule interface that defines the inter-dependent methods that modules need to implement

func NewAppModule

func NewAppModule(
	cdc codec.Codec,
	keeper keeper.Keeper,
	accountKeeper types.AccountKeeper,
	bankKeeper types.BankKeeper,
) AppModule

func (AppModule) BeginBlock

func (am AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock)

BeginBlock contains the logic that is automatically triggered at the beginning of each block

func (AppModule) ConsensusVersion

func (AppModule) ConsensusVersion() uint64

ConsensusVersion is a sequence number for state-breaking change of the module. It should be incremented on each consensus-breaking change introduced by the module. To avoid wrong/empty versions, the initial version should be set to 1

func (AppModule) EndBlock

EndBlock contains the logic that is automatically triggered at the end of each block

func (AppModule) ExportGenesis

func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.RawMessage

ExportGenesis returns the module's exported genesis state as raw JSON bytes.

func (AppModule) GenerateGenesisState

func (AppModule) GenerateGenesisState(simState *module.SimulationState)

GenerateGenesisState creates a randomized GenState of the module

func (AppModule) InitGenesis

func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, gs json.RawMessage) []abci.ValidatorUpdate

InitGenesis performs the module's genesis initialization. It returns no validator updates.

func (AppModule) ProposalMsgs added in v0.1.2

func (AppModule) ProposalMsgs(simState module.SimulationState) []simtypes.WeightedProposalMsg

ProposalMsgs doesn't return any content functions for governance proposals

func (AppModule) RegisterInvariants

func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry)

RegisterInvariants registers the invariants of the module. If an invariant deviates from its predicted value, the InvariantRegistry triggers appropriate logic (most often the chain will be halted)

func (AppModule) RegisterServices

func (am AppModule) RegisterServices(cfg module.Configurator)

RegisterServices registers a gRPC query service to respond to the module-specific gRPC queries

func (AppModule) RegisterStoreDecoder

func (am AppModule) RegisterStoreDecoder(_ sdk.StoreDecoderRegistry)

RegisterStoreDecoder registers a decoder

func (AppModule) WeightedOperations

func (am AppModule) WeightedOperations(simState module.SimulationState) []simtypes.WeightedOperation

WeightedOperations returns the all the gov module operations with their respective weights.

type AppModuleBasic

type AppModuleBasic struct {
	// contains filtered or unexported fields
}

AppModuleBasic implements the AppModuleBasic interface that defines the independent methods a Cosmos SDK module needs to implement.

func NewAppModuleBasic

func NewAppModuleBasic(cdc codec.BinaryCodec) AppModuleBasic

func (AppModuleBasic) DefaultGenesis

func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage

DefaultGenesis returns a default GenesisState for the module, marshalled to json.RawMessage. The default GenesisState need to be defined by the module developer and is primarily used for testing

func (AppModuleBasic) GetQueryCmd

func (AppModuleBasic) GetQueryCmd() *cobra.Command

GetQueryCmd returns the root query command for the module. The subcommands of this root command are used by end-users to generate new queries to the subset of the state defined by the module

func (AppModuleBasic) GetTxCmd

func (a AppModuleBasic) GetTxCmd() *cobra.Command

GetTxCmd returns the root Tx command for the module. The subcommands of this root command are used by end-users to generate new transactions containing messages defined in the module

func (AppModuleBasic) Name

func (AppModuleBasic) Name() string

Name returns the name of the module as a string

func (AppModuleBasic) RegisterGRPCGatewayRoutes

func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux)

RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the module

func (AppModuleBasic) RegisterInterfaces

func (a AppModuleBasic) RegisterInterfaces(reg cdctypes.InterfaceRegistry)

RegisterInterfaces registers a module's interface types and their concrete implementations as proto.Message

func (AppModuleBasic) RegisterLegacyAminoCodec

func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino)

RegisterLegacyAminoCodec registers the amino codec for the module, which is used to marshal and unmarshal structs to/from []byte in order to persist them in the module's KVStore

func (AppModuleBasic) ValidateGenesis

func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config client.TxEncodingConfig, bz json.RawMessage) error

ValidateGenesis used to validate the GenesisState, given in its json.RawMessage form

Directories

Path Synopsis
client
cli
Package types is a reverse proxy.
Package types is a reverse proxy.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL