Documentation ¶
Index ¶
- Constants
- func CreateVerifier(config *Config) tmlite.Verifier
- func DiscoverRPCEndpoints(ctx *Context, gqlEndpoint string) ([]string, error)
- func ErrVerifyCommit(height int64) error
- func Init(ctx *Context, height int64)
- func Start(ctx *Context)
- func Verify(ctx *Context, height int64) (tmtypes.SignedHeader, error)
- func VerifyProof(ctx *Context, queryPath string, resp abci.ResponseQuery) error
- type AppState
- type Config
- type Context
- type GenesisState
- type Keeper
- func (k Keeper) GetAuction(id auction.ID) *auction.Auction
- func (k Keeper) GetBids(id auction.ID) []*auction.Bid
- func (k Keeper) GetChainID() string
- func (k Keeper) GetNameAuthority(name string) *ns.NameAuthority
- func (k Keeper) GetNameRecord(name string) *ns.NameRecord
- func (k Keeper) GetRecord(id ns.ID) ns.Record
- func (k Keeper) GetStatusRecord() Status
- func (k Keeper) HasRecord(id ns.ID) bool
- func (k Keeper) HasStatusRecord() bool
- func (k Keeper) MatchRecords(matchFn func(*ns.Record) bool) []*ns.Record
- func (k Keeper) PutRecord(record ns.RecordObj)
- func (k Keeper) ResolveWRN(wrn string) *ns.Record
- func (k Keeper) SaveAuction(auctionObj auction.Auction)
- func (k Keeper) SaveBid(bid auction.Bid)
- func (k Keeper) SaveStatus(status Status)
- func (k Keeper) SetNameAuthorityRecord(name string, nameAuthority ns.NameAuthority)
- func (k Keeper) SetNameRecord(wrn string, nameRecord ns.NameRecord)
- func (k Keeper) SetNameRecordRaw(wrn string, nameRecord ns.NameRecord)
- type RPCNodeHandler
- type Response
- type Status
Constants ¶
const ( NameStorePath = "/store/nameservice/key" AuctionStorePath = "/store/auction/key" )
const AggressiveSyncIntervalInMillis = 250
AggressiveSyncIntervalInMillis is the interval for aggressive sync, to catch up quickly to the current height.
const DefaultLightNodeHome = "$HOME/.wire/dxnsd-lite"
DefaultLightNodeHome is the root directory for the dxnsd-lite node.
const DiscoverRPCNodesFrequencyMillis = 60 * 1000
DiscoverRPCNodesFrequencyMillis controls frequency to discover new RPC endpoints.
const DumpRPCNodeStatsFrequencyMillis = 60 * 1000
DumpRPCNodeStatsFrequencyMillis controls frequency to dump RPC node stats.
const ErrorWaitDurationMillis = 1 * 1000
ErrorWaitDurationMillis is the wait duration in case of errors.
const SyncIntervalInMillis = 5 * 1000
SyncIntervalInMillis is the interval for initiating incremental sync, when already caught up to current height.
const SyncLaggingMinHeightDiff = 5
SyncLaggingMinHeightDiff is the min. difference in height to consider a lite node as lagging the full node.
Variables ¶
This section is empty.
Functions ¶
func CreateVerifier ¶
CreateVerifier creates a light client verifier.
func DiscoverRPCEndpoints ¶
DiscoverRPCEndpoints queries for WNS RPC endpoints.
func ErrVerifyCommit ¶
ErrVerifyCommit returns a common error reflecting that the blockchain commit at a given height can't be verified. The reason is that the base checkpoint of the certifier is newer than the given height
func Verify ¶
func Verify(ctx *Context, height int64) (tmtypes.SignedHeader, error)
Verify verifies the consensus proof at given height.
func VerifyProof ¶
func VerifyProof(ctx *Context, queryPath string, resp abci.ResponseQuery) error
VerifyProof verifies the ABCI response.
Types ¶
type AppState ¶
type AppState struct {
Nameservice nameservice.GenesisState `json:"nameservice" yaml:"nameservice"`
}
AppState is used to import initial app state (records, names) into the db.
type Config ¶
type Config struct { LogLevel string NodeAddress string ChainID string Home string InitFromNode bool InitFromGenesisFile bool Endpoint string SyncTimeoutMins int }
Config represents config for sync functionality.
type Context ¶
type Context struct { // Primary RPC PrimaryNode, used for verification. PrimaryNode *RPCNodeHandler // contains filtered or unexported fields }
Context contains sync context info.
type GenesisState ¶
type GenesisState struct { ChainID string `json:"chain_id" yaml:"chain_id"` AppState AppState `json:"app_state" yaml:"app_state"` }
GenesisState is used to import initial state into the db.
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
Keeper is an impl. of an interface similar to the nameservice Keeper.
func (Keeper) GetAuction ¶
GetAuction get the auction record.
func (Keeper) GetNameAuthority ¶
func (k Keeper) GetNameAuthority(name string) *ns.NameAuthority
GetNameAuthority get the name authority record for an authority name.
func (Keeper) GetNameRecord ¶
func (k Keeper) GetNameRecord(name string) *ns.NameRecord
GetNameRecord get the name record for a name/WRN.
func (Keeper) GetStatusRecord ¶
GetStatusRecord gets the sync status record.
func (Keeper) HasStatusRecord ¶
HasStatusRecord checks if the store has a status record.
func (Keeper) MatchRecords ¶
MatchRecords - get all matching records.
func (Keeper) ResolveWRN ¶
ResolveWRN resolves a WRN to a record.
func (Keeper) SaveAuction ¶
SaveAuction - saves an auction record.
func (Keeper) SaveStatus ¶
SaveStatus saves the sync status record.
func (Keeper) SetNameAuthorityRecord ¶
func (k Keeper) SetNameAuthorityRecord(name string, nameAuthority ns.NameAuthority)
SetNameAuthorityRecord - sets a name authority record.
func (Keeper) SetNameRecord ¶
func (k Keeper) SetNameRecord(wrn string, nameRecord ns.NameRecord)
SetNameRecord - sets a name record.
func (Keeper) SetNameRecordRaw ¶
func (k Keeper) SetNameRecordRaw(wrn string, nameRecord ns.NameRecord)
SetNameRecordRaw - sets a name record (used during intial sync).
type RPCNodeHandler ¶
type RPCNodeHandler struct { Address string `json:"address"` Client *rpcclient.HTTP `json:"-"` Calls int64 `json:"calls"` Errors int64 `json:"errors"` LastCalledAt time.Time `json:"lastCalledAt"` }
RPCNodeHandler is used to call an RPC endpoint and maintains basic stats.
func NewRPCNodeHandler ¶
func NewRPCNodeHandler(nodeAddress string) *RPCNodeHandler
NewRPCNodeHandler instantiates a new RPC node handler.