Documentation ¶
Overview ¶
Package pkg comments for pkg block service 块相关数据封装
Index ¶
- func CheckCode(email, code string) bool
- func CheckEnv() error
- func CheckSession(token string) (*models.Account, error)
- func CreateNode(name, baseURL, nodeType, nodeVersion, secretKey string) error
- func DeleteNodeByName(name string) error
- func Doctor() error
- func Login(mail, password string) (*session, error)
- func Logout(uid int64) error
- func QueryAccount(node *Node, addr string) (json.RawMessage, error)
- func SendCode(mailSmtpServer, mailUser, mailPassword, email string) error
- type Env
- type Genesis
- type NetworkSpider
- type Node
- func (n Node) AppState(cdc *amino.Codec) (*qbasetypes.GenesisState, error)
- func (n Node) Bech32PrefixConsPub() string
- func (n Node) BlockTimeAvg(blockNum int) (time.Duration, error)
- func (n Node) BlockValidatorByAddress(address string, minHeight, maxHeight int64) ([]*types.BlockValidator, error)
- func (n Node) BlockValidatorsByHeight(height int64) ([]*types.BlockValidator, error)
- func (n Node) Blocks(minHeight, maxHeight, offset, limit int64) ([]*types.ResultBlockBase, error)
- func (n Node) ChainStatus(cached bool) (*types.ResultStatus, error)
- func (n Node) ConsensusState() (*types.ResultConsensusState, error)
- func (n Node) CreateBlock(b *types.Block) error
- func (n Node) CreateEvidence(b *types.Block) error
- func (n Node) CreatePeers(peers []tmtypes.Peer) error
- func (n Node) CreateValidator(vl types.Validator) error
- func (n Node) Evidences(validator string) ([]*types.ResultEvidence, error)
- func (n Node) Fee(tx string) (*types.ResultFee, error)
- func (n Node) HasTxBlocks(minHeight, maxHeight int64) ([]*types.ResultBlockBase, error)
- func (n Node) InactiveValidator(address string, status int, inactiveHeight int64, inactiveTime time.Time) error
- func (n Node) LatestBlock() (*types.ResultBlockBase, error)
- func (n Node) Missings(validator string) ([]*types.ResultMissing, error)
- func (n Node) NetworkSpider(ctx context.Context)
- func (n Node) Peers() (*types.ResultPeers, error)
- func (n Node) RetrieveBlock(height int64) (*types.ResultBlockBase, error)
- func (n Node) RetrieveBlockValidator(height int64, validatorAddress string) (*types.BlockValidator, error)
- func (n Node) RetrieveGenesis(chainID string) (*Genesis, error)
- func (n Node) RetrieveValidator(address string) (*types.Validator, error)
- func (n Node) SaveBlockValidator(vars []*types.BlockValidator) error
- func (n Node) Tx(height, index int64) (*types.ResultTx, error)
- func (n Node) TxByHash(hash string) (*types.ResultTx, error)
- func (n Node) TxSend(remote string, txData []byte) (*types.TxSendResult, error)
- func (n Node) Txs(minHeight, maxHeight, offset, limit int64) ([]*types.ResultTx, error)
- func (n Node) TxsByAddress(address string, tx string, minHeight, maxHeight int64, offset, limit int) ([]*types.ResultTx, error)
- func (n Node) UpdateConsensusState(cs *tmctypes.ResultConsensusState) error
- func (n Node) UpdateValidatorBlock(address string, height int64, t time.Time) error
- func (n Node) ValidNodes() ([]*types.ChainNode, error)
- func (n Node) Validators() (types.Validators, error)
- type Route
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateNode ¶
func DeleteNodeByName ¶
func QueryAccount ¶ added in v0.0.4
func QueryAccount(node *Node, addr string) (json.RawMessage, error)
Types ¶
type NetworkSpider ¶ added in v0.0.4
type NetworkSpider struct {
// contains filtered or unexported fields
}
func NewNetworkSpider ¶ added in v0.0.4
func NewNetworkSpider(chainID string, remote string) *NetworkSpider
func (*NetworkSpider) Check ¶ added in v0.0.4
func (ns *NetworkSpider) Check()
func (*NetworkSpider) Run ¶ added in v0.0.4
func (ns *NetworkSpider) Run()
func (*NetworkSpider) Save ¶ added in v0.0.4
func (ns *NetworkSpider) Save()
type Node ¶
type Node struct { Name string `json:"name"` // name BaseURL string `json:"baseUrl"` // base_url SecretKey string `json:"-"` // secret_key ChanID string `json:"chanId"` NodeType string `json:"nodeType"` NodeVersion version.Version `json:"nodeVersion"` Routers []Route `json:"routers"` }
func GetNodeByName ¶
func (Node) AppState ¶
func (n Node) AppState(cdc *amino.Codec) (*qbasetypes.GenesisState, error)
func (Node) Bech32PrefixConsPub ¶ added in v0.0.4
func (Node) BlockTimeAvg ¶ added in v0.0.4
Search 最近N块平均打快时间
func (Node) BlockValidatorByAddress ¶ added in v0.0.4
func (n Node) BlockValidatorByAddress(address string, minHeight, maxHeight int64) ([]*types.BlockValidator, error)
ListBlockValidatorByAddress 查询
func (Node) BlockValidatorsByHeight ¶ added in v0.0.4
func (n Node) BlockValidatorsByHeight(height int64) ([]*types.BlockValidator, error)
ListBlockValidatorByHeight 查询
func (Node) Blocks ¶ added in v0.0.4
func (n Node) Blocks(minHeight, maxHeight, offset, limit int64) ([]*types.ResultBlockBase, error)
Search 块查询
func (Node) ChainStatus ¶ added in v0.0.4
func (n Node) ChainStatus(cached bool) (*types.ResultStatus, error)
func (Node) ConsensusState ¶ added in v0.0.4
func (n Node) ConsensusState() (*types.ResultConsensusState, error)
func (Node) CreateValidator ¶ added in v0.0.4
func (Node) Evidences ¶ added in v0.0.4
func (n Node) Evidences(validator string) ([]*types.ResultEvidence, error)
Evidence evidence查询
func (Node) HasTxBlocks ¶ added in v0.0.4
func (n Node) HasTxBlocks(minHeight, maxHeight int64) ([]*types.ResultBlockBase, error)
HasTx 有交易的块
func (Node) InactiveValidator ¶ added in v0.0.4
func (Node) LatestBlock ¶ added in v0.0.4
func (n Node) LatestBlock() (*types.ResultBlockBase, error)
Latest最新的块
func (Node) Missings ¶ added in v0.0.4
func (n Node) Missings(validator string) ([]*types.ResultMissing, error)
Missing missing查询
func (Node) NetworkSpider ¶ added in v0.0.4
func (Node) Peers ¶ added in v0.0.4
func (n Node) Peers() (*types.ResultPeers, error)
Peers 查询所有peer
func (Node) RetrieveBlock ¶ added in v0.0.4
func (n Node) RetrieveBlock(height int64) (*types.ResultBlockBase, error)
Retrieve 块查询
func (Node) RetrieveBlockValidator ¶ added in v0.0.4
func (n Node) RetrieveBlockValidator(height int64, validatorAddress string) (*types.BlockValidator, error)
Search 单个查询
func (Node) RetrieveGenesis ¶ added in v0.0.4
func (Node) RetrieveValidator ¶ added in v0.0.4
RetrieveValidator 单个查询
func (Node) SaveBlockValidator ¶ added in v0.0.4
func (n Node) SaveBlockValidator(vars []*types.BlockValidator) error
func (Node) TxsByAddress ¶ added in v0.0.4
func (n Node) TxsByAddress(address string, tx string, minHeight, maxHeight int64, offset, limit int) ([]*types.ResultTx, error)
TxsByAddress 交易查询
func (Node) UpdateConsensusState ¶ added in v0.0.4
func (n Node) UpdateConsensusState(cs *tmctypes.ResultConsensusState) error
UpdateConsensusState 更新共识状态
func (Node) UpdateValidatorBlock ¶ added in v0.0.4
func (Node) Validators ¶ added in v0.0.4
func (n Node) Validators() (types.Validators, error)
Validators 查询链所有的validator
Source Files ¶
Click to show internal directories.
Click to hide internal directories.