Documentation ¶
Index ¶
- Constants
- Variables
- func ParamKeyTable() subspace.KeyTable
- func RegisterCodec(cdc *codec.Codec)
- type AutorityStatus
- type BlockChangeset
- type ID
- type MsgAssociateBond
- type MsgDeleteName
- type MsgDissociateBond
- type MsgDissociateRecords
- type MsgReassociateRecords
- type MsgRenewRecord
- type MsgReserveAuthority
- type MsgSetAuthorityBond
- type MsgSetName
- type MsgSetRecord
- type NameAuthority
- type NameRecord
- type NameRecordEntry
- type Params
- type Payload
- type PayloadObj
- type Record
- func (r *Record) CanonicalJSON() []byte
- func (r Record) GetBondID() string
- func (r *Record) GetCID() (ID, error)
- func (r Record) GetCreateTime() string
- func (r Record) GetExpiryTime() string
- func (r Record) GetOwners() []*string
- func (r *Record) GetSignBytes() ([]byte, []byte)
- func (r *Record) HasExpired(ctx sdk.Context) bool
- func (r *Record) ToNameRecordEntry() NameRecordEntry
- func (r *Record) ToRecordObj() RecordObj
- type RecordObj
- type Signature
Constants ¶
const ( // ModuleName is the name of the module ModuleName = "nameservice" // RecordRentModuleAccountName is the name of the module account that keeps track of record rents paid. RecordRentModuleAccountName = "record_rent" // AuthorityRentModuleAccountName is the name of the module account that keeps track of authority rents paid. AuthorityRentModuleAccountName = "authority_rent" // StoreKey to be used when creating the KVStore StoreKey = ModuleName )
const ( // DefaultRecordRent is the default record rent for 1 time period (see expiry time). DefaultRecordRent string = "1000000uwire" // DefaultRecordExpiryTime is the default record expiry time (1 year). DefaultRecordExpiryTime time.Duration = time.Hour * 24 * 365 DefaultAuthorityRent string = "10000000uwire" DefaultAuthorityExpiryTime time.Duration = time.Hour * 24 * 365 DefaultAuthorityGracePeriod time.Duration = time.Hour * 24 * 2 DefaultAuthorityAuctionEnabled = false DefaultCommitsDuration time.Duration = time.Hour * 24 DefaultRevealsDuration time.Duration = time.Hour * 24 DefaultCommitFee string = "1000000uwire" DefaultRevealFee string = "1000000uwire" DefaultMinimumBid string = "5000000uwire" )
Default parameter values.
const (
DefaultParamspace = ModuleName
)
Default parameter namespace.
const RouterKey = ModuleName // this was defined in your key.go file
RouterKey is the module name router key
Variables ¶
var ( KeyRecordRent = []byte("RecordRent") KeyRecordRentDuration = []byte("RecordRentDuration") KeyAuthorityRent = []byte("AuthorityRent") KeyAuthorityRentDuration = []byte("AuthorityRentDuration") KeyAuthorityGracePeriod = []byte("AuthorityGracePeriod") KeyAuthorityAuctionEnabled = []byte("AuthorityAuctionEnabled") KeyCommitsDuration = []byte("AuthorityAuctionCommitsDuration") KeyRevealsDuration = []byte("AuthorityAuctionRevealsDuration") KeyCommitFee = []byte("AuthorityAuctionCommitFee") KeyRevealFee = []byte("AuthorityAuctionRevealFee") KeyMinimumBid = []byte("AuthorityAuctionMinimumBid") )
Keys for parameter access
var (
ErrInvalid = sdkerrors.Register(ModuleName, 1, "custom error message")
)
var ModuleCdc = codec.New()
ModuleCdc is the codec for the module
Functions ¶
func ParamKeyTable ¶
ParamKeyTable - ParamTable for nameservice module.
func RegisterCodec ¶
RegisterCodec registers concrete types on the Amino codec
Types ¶
type AutorityStatus ¶
type AutorityStatus string
const ( AuthorityActive AutorityStatus = "active" AuthorityExpired AutorityStatus = "expired" AuthorityUnderAuction AutorityStatus = "auction" )
type BlockChangeset ¶
type BlockChangeset struct { Height int64 `json:"height"` Records []ID `json:"records"` Auctions []auction.ID `json:"auctions"` AuctionBids []auction.AuctionBidInfo `json:"auctionBids"` NameAuthorities []string `json:"authorities"` Names []string `json:"names"` }
BlockChangeset is a changeset corresponding to a block.
type MsgAssociateBond ¶
type MsgAssociateBond struct { ID ID `json:"id"` BondID bond.ID `json:"bondId"` Signer sdk.AccAddress `json:"signer"` }
MsgAssociateBond defines a associate bond message.
func NewMsgAssociateBond ¶
func NewMsgAssociateBond(id string, bondID string, signer sdk.AccAddress) MsgAssociateBond
NewMsgAssociateBond is the constructor function for MsgAssociateBond.
func (MsgAssociateBond) GetSignBytes ¶
func (msg MsgAssociateBond) GetSignBytes() []byte
GetSignBytes Implements Msg.
func (MsgAssociateBond) GetSigners ¶
func (msg MsgAssociateBond) GetSigners() []sdk.AccAddress
GetSigners Implements Msg.
func (MsgAssociateBond) ValidateBasic ¶
func (msg MsgAssociateBond) ValidateBasic() error
ValidateBasic Implements Msg.
type MsgDeleteName ¶
type MsgDeleteName struct { WRN string `json:"wrn"` Signer sdk.AccAddress `json:"signer"` }
MsgDeleteName defines a DeleteName message.
func NewMsgDeleteName ¶
func NewMsgDeleteName(wrn string, signer sdk.AccAddress) MsgDeleteName
NewMsgDeleteName is the constructor function for MsgDeleteName.
func (MsgDeleteName) GetSignBytes ¶
func (msg MsgDeleteName) GetSignBytes() []byte
GetSignBytes Implements Msg.
func (MsgDeleteName) GetSigners ¶
func (msg MsgDeleteName) GetSigners() []sdk.AccAddress
GetSigners Implements Msg.
func (MsgDeleteName) ValidateBasic ¶
func (msg MsgDeleteName) ValidateBasic() error
ValidateBasic Implements Msg.
type MsgDissociateBond ¶
type MsgDissociateBond struct { ID ID `json:"id"` Signer sdk.AccAddress `json:"signer"` }
MsgDissociateBond defines a dissociate bond message.
func NewMsgDissociateBond ¶
func NewMsgDissociateBond(id string, signer sdk.AccAddress) MsgDissociateBond
NewMsgDissociateBond is the constructor function for MsgDissociateBond.
func (MsgDissociateBond) GetSignBytes ¶
func (msg MsgDissociateBond) GetSignBytes() []byte
GetSignBytes Implements Msg.
func (MsgDissociateBond) GetSigners ¶
func (msg MsgDissociateBond) GetSigners() []sdk.AccAddress
GetSigners Implements Msg.
func (MsgDissociateBond) ValidateBasic ¶
func (msg MsgDissociateBond) ValidateBasic() error
ValidateBasic Implements Msg.
type MsgDissociateRecords ¶
type MsgDissociateRecords struct { BondID bond.ID `json:"bondId"` Signer sdk.AccAddress `json:"signer"` }
MsgDissociateRecords defines a dissociate all records from bond message.
func NewMsgDissociateRecords ¶
func NewMsgDissociateRecords(bondID string, signer sdk.AccAddress) MsgDissociateRecords
NewMsgDissociateRecords is the constructor function for MsgDissociateRecords.
func (MsgDissociateRecords) GetSignBytes ¶
func (msg MsgDissociateRecords) GetSignBytes() []byte
GetSignBytes Implements Msg.
func (MsgDissociateRecords) GetSigners ¶
func (msg MsgDissociateRecords) GetSigners() []sdk.AccAddress
GetSigners Implements Msg.
func (MsgDissociateRecords) Route ¶
func (msg MsgDissociateRecords) Route() string
Route Implements Msg.
func (MsgDissociateRecords) Type ¶
func (msg MsgDissociateRecords) Type() string
Type Implements Msg.
func (MsgDissociateRecords) ValidateBasic ¶
func (msg MsgDissociateRecords) ValidateBasic() error
ValidateBasic Implements Msg.
type MsgReassociateRecords ¶
type MsgReassociateRecords struct { OldBondID bond.ID `json:"oldBondId"` NewBondID bond.ID `json:"newBondId"` Signer sdk.AccAddress `json:"signer"` }
MsgReassociateRecords defines a reassociate records message.
func NewMsgReassociateRecords ¶
func NewMsgReassociateRecords(oldBondID string, newBondID string, signer sdk.AccAddress) MsgReassociateRecords
NewMsgReassociateRecords is the constructor function for MsgReassociateRecords.
func (MsgReassociateRecords) GetSignBytes ¶
func (msg MsgReassociateRecords) GetSignBytes() []byte
GetSignBytes Implements Msg.
func (MsgReassociateRecords) GetSigners ¶
func (msg MsgReassociateRecords) GetSigners() []sdk.AccAddress
GetSigners Implements Msg.
func (MsgReassociateRecords) Route ¶
func (msg MsgReassociateRecords) Route() string
Route Implements Msg.
func (MsgReassociateRecords) Type ¶
func (msg MsgReassociateRecords) Type() string
Type Implements Msg.
func (MsgReassociateRecords) ValidateBasic ¶
func (msg MsgReassociateRecords) ValidateBasic() error
ValidateBasic Implements Msg.
type MsgRenewRecord ¶
type MsgRenewRecord struct { ID ID `json:"id"` Signer sdk.AccAddress `json:"signer"` }
MsgRenewRecord defines a renew record message.
func NewMsgRenewRecord ¶
func NewMsgRenewRecord(id string, signer sdk.AccAddress) MsgRenewRecord
NewMsgRenewRecord is the constructor function for MsgRenewRecord.
func (MsgRenewRecord) GetSignBytes ¶
func (msg MsgRenewRecord) GetSignBytes() []byte
GetSignBytes Implements Msg.
func (MsgRenewRecord) GetSigners ¶
func (msg MsgRenewRecord) GetSigners() []sdk.AccAddress
GetSigners Implements Msg.
func (MsgRenewRecord) ValidateBasic ¶
func (msg MsgRenewRecord) ValidateBasic() error
ValidateBasic Implements Msg.
type MsgReserveAuthority ¶
type MsgReserveAuthority struct { Name string `json:"name"` Signer sdk.AccAddress `json:"signer"` // Owner (instead of Signer) is only used when creating a sub-authority. Owner sdk.AccAddress `json:"owner"` }
MsgReserveAuthority defines a ReserveName message.
func NewMsgReserveAuthority ¶
func NewMsgReserveAuthority(name string, signer sdk.AccAddress, owner sdk.AccAddress) MsgReserveAuthority
NewMsgReserveAuthority is the constructor function for MsgReserveAuthority.
func (MsgReserveAuthority) GetSignBytes ¶
func (msg MsgReserveAuthority) GetSignBytes() []byte
GetSignBytes Implements Msg.
func (MsgReserveAuthority) GetSigners ¶
func (msg MsgReserveAuthority) GetSigners() []sdk.AccAddress
GetSigners Implements Msg.
func (MsgReserveAuthority) Route ¶
func (msg MsgReserveAuthority) Route() string
Route Implements Msg.
func (MsgReserveAuthority) ValidateBasic ¶
func (msg MsgReserveAuthority) ValidateBasic() error
ValidateBasic Implements Msg.
type MsgSetAuthorityBond ¶
type MsgSetAuthorityBond struct { Name string `json:"name"` BondID bond.ID `json:"bondId"` Signer sdk.AccAddress `json:"signer"` }
MsgSetAuthorityBond defines a message to set/update the bond for an authority.
func NewMsgSetAuthorityBond ¶
func NewMsgSetAuthorityBond(name string, bondID string, signer sdk.AccAddress) MsgSetAuthorityBond
NewMsgSetAuthorityBond is the constructor function for MsgSetAuthorityBond.
func (MsgSetAuthorityBond) GetSignBytes ¶
func (msg MsgSetAuthorityBond) GetSignBytes() []byte
GetSignBytes Implements Msg.
func (MsgSetAuthorityBond) GetSigners ¶
func (msg MsgSetAuthorityBond) GetSigners() []sdk.AccAddress
GetSigners Implements Msg.
func (MsgSetAuthorityBond) Route ¶
func (msg MsgSetAuthorityBond) Route() string
Route Implements Msg.
func (MsgSetAuthorityBond) ValidateBasic ¶
func (msg MsgSetAuthorityBond) ValidateBasic() error
ValidateBasic Implements Msg.
type MsgSetName ¶
type MsgSetName struct { WRN string `json:"wrn"` ID ID `json:"id"` Signer sdk.AccAddress `json:"signer"` }
MsgSetName defines a SetName message.
func NewMsgSetName ¶
func NewMsgSetName(wrn string, id string, signer sdk.AccAddress) MsgSetName
NewMsgSetName is the constructor function for MsgSetName.
func (MsgSetName) GetSignBytes ¶
func (msg MsgSetName) GetSignBytes() []byte
GetSignBytes Implements Msg.
func (MsgSetName) GetSigners ¶
func (msg MsgSetName) GetSigners() []sdk.AccAddress
GetSigners Implements Msg.
func (MsgSetName) ValidateBasic ¶
func (msg MsgSetName) ValidateBasic() error
ValidateBasic Implements Msg.
type MsgSetRecord ¶
type MsgSetRecord struct { Payload PayloadObj `json:"payload"` BondID bond.ID `json:"bondId"` Signer sdk.AccAddress `json:"signer"` }
MsgSetRecord defines a SetResource message.
func NewMsgSetRecord ¶
func NewMsgSetRecord(payload PayloadObj, bondID string, signer sdk.AccAddress) MsgSetRecord
NewMsgSetRecord is the constructor function for MsgSetRecord.
func (MsgSetRecord) GetSignBytes ¶
func (msg MsgSetRecord) GetSignBytes() []byte
GetSignBytes Implements Msg.
func (MsgSetRecord) GetSigners ¶
func (msg MsgSetRecord) GetSigners() []sdk.AccAddress
GetSigners Implements Msg.
func (MsgSetRecord) ValidateBasic ¶
func (msg MsgSetRecord) ValidateBasic() error
ValidateBasic Implements Msg.
type NameAuthority ¶
type NameAuthority struct { // Owner public key. OwnerPublicKey string `json:"ownerPublicKey"` // Owner address. OwnerAddress string `json:"ownerAddress"` // Block height at which name/authority was created. Height int64 `json:"height"` Status AutorityStatus `json:"status"` AuctionID auction.ID `json:"auctionID"` BondID bond.ID `json:"bondID"` ExpiryTime time.Time `json:"expiryTime,omitempty"` }
NameAuthority records the name/authority ownership info.
func (NameAuthority) GetBondID ¶
func (authority NameAuthority) GetBondID() string
func (NameAuthority) GetExpiryTime ¶
func (authority NameAuthority) GetExpiryTime() string
type NameRecord ¶
type NameRecord struct { NameRecordEntry `json:"latest"` // TODO(ashwin): Move to external indexer when available. History []NameRecordEntry `json:"history"` }
NameRecord stores name mapping info for a WRN.
type NameRecordEntry ¶
type NameRecordEntry struct { // Record ID. ID ID `json:"id"` // Block height at which name record was created. Height int64 `json:"height"` }
NameRecordEntry is a naming record entry for a WRN.
type Params ¶
type Params struct { RecordRent string `json:"record_rent" yaml:"record_rent"` RecordRentDuration time.Duration `json:"record_rent_duration" yaml:"record_rent_duration"` AuthorityRent string `json:"authority_rent" yaml:"authority_rent"` AuthorityRentDuration time.Duration `json:"authority_rent_duration" yaml:"authority_rent_duration"` AuthorityGracePeriod time.Duration `json:"authority_grace_period" yaml:"authority_grace_period"` // Are name auctions enabled? AuthorityAuctionEnabled bool `json:"authority_auction_enabled" yaml:"authority_auction_enabled"` CommitsDuration time.Duration `json:"authority_auction_commits_duration" yaml:"authority_auction_commits_duration"` RevealsDuration time.Duration `json:"authority_auction_reveals_duration" yaml:"authority_auction_reveals_duration"` CommitFee string `json:"authority_auction_commit_fee" yaml:"authority_auction_commit_fee"` RevealFee string `json:"authority_auction_reveal_fee" yaml:"authority_auction_reveal_fee"` MinimumBid string `json:"authority_auction_minimum_bid" yaml:"authority_auction_minimum_bid"` }
Params defines the high level settings for the nameservice module.
func NewParams ¶
func NewParams(recordRent string, recordRentDuration time.Duration, authorityRent string, authorityRentDuration time.Duration, authorityGracePeriod time.Duration, authorityAuctionEnabled bool, commitsDuration time.Duration, revealsDuration time.Duration, commitFee string, revealFee string, minimumBid string) Params
NewParams creates a new Params instance
func (*Params) ParamSetPairs ¶
func (p *Params) ParamSetPairs() subspace.ParamSetPairs
ParamSetPairs - implements params.ParamSet
type Payload ¶
type Payload struct { Record map[string]interface{} `json:"record"` Signatures []Signature `json:"signatures"` }
Payload represents a signed record payload that can be serialized from/to YAML.
func (*Payload) ToPayloadObj ¶
func (payload *Payload) ToPayloadObj() PayloadObj
ToPayloadObj converts Payload to PayloadObj object. Why? Because go-amino can't handle maps: https://github.com/tendermint/go-amino/issues/4.
type PayloadObj ¶
type PayloadObj struct { Record RecordObj `json:"record"` Signatures []Signature `json:"signatures"` }
PayloadObj represents a signed record payload.
func (PayloadObj) ToPayload ¶
func (payloadObj PayloadObj) ToPayload() Payload
ToPayload converts Payload to PayloadObj object. Why? Because go-amino can't handle maps: https://github.com/tendermint/go-amino/issues/4.
type Record ¶
type Record struct { ID ID `json:"id,omitempty"` Names []string `json:"names,omitempty"` BondID bond.ID `json:"bondId,omitempty"` CreateTime time.Time `json:"createTime,omitempty"` ExpiryTime time.Time `json:"expiryTime,omitempty"` Deleted bool `json:"deleted,omitempty"` Owners []string `json:"owners,omitempty"` Attributes map[string]interface{} `json:"attributes,omitempty"` }
Record represents a WNS record.
func (*Record) CanonicalJSON ¶
CanonicalJSON returns the canonical JSON respresentation of the record.
func (Record) GetCreateTime ¶
GetCreateTime returns the create time of the Record.
func (Record) GetExpiryTime ¶
GetExpiryTime returns the expiry time of the Record.
func (*Record) GetSignBytes ¶
GetSignBytes generates a record hash to be signed.
func (*Record) HasExpired ¶
HasExpired returns true if the record has expired.
func (*Record) ToNameRecordEntry ¶
func (r *Record) ToNameRecordEntry() NameRecordEntry
ToNameRecordEntry gets a naming record entry for the record.
func (*Record) ToRecordObj ¶
ToRecordObj converts Record to RecordObj. Why? Because go-amino can't handle maps: https://github.com/tendermint/go-amino/issues/4.
type RecordObj ¶
type RecordObj struct { ID ID `json:"id,omitempty"` BondID bond.ID `json:"bondId,omitempty"` CreateTime time.Time `json:"createTime,omitempty"` ExpiryTime time.Time `json:"expiryTime,omitempty"` Deleted bool `json:"deleted,omitempty"` Owners []string `json:"owners,omitempty"` Attributes []byte `json:"attributes,omitempty"` }
RecordObj represents a WNS record.
func (*RecordObj) ToRecord ¶
ToRecord converts RecordObj to Record. Why? Because go-amino can't handle maps: https://github.com/tendermint/go-amino/issues/4.