Documentation ¶
Index ¶
- Constants
- Variables
- func CreatePovSubscription(ctx context.Context, ...) (*rpc.Subscription, error)
- func FillHeader(header *PovApiHeader)
- type APIAccount
- type APIAccountBalance
- type APIAccountsBalance
- type APIBalance
- type APIBlock
- type APIPending
- type APIPendingInfo
- type APIRepresentative
- type APISendBlockPara
- type APITokenMeta
- type APIUncheckBlock
- type AccountApi
- func (a *AccountApi) Create(seedStr string, i *uint32) (map[string]string, error)
- func (a *AccountApi) ForPublicKey(pubStr string) (types.Address, error)
- func (a *AccountApi) NewAccounts(count *uint32) ([]*Accounts, error)
- func (a *AccountApi) NewSeed() (string, error)
- func (a *AccountApi) PublicKey(addr types.Address) string
- func (a *AccountApi) Validate(addr string) bool
- type Accounts
- type AdminUpdateParam
- type AdminUser
- type ApiTokenInfo
- type BlackHoleAPI
- func (b *BlackHoleAPI) GetDestroyInfoDetail(addr *types.Address) ([]*cabi.DestroyInfo, error)
- func (b *BlackHoleAPI) GetRewardsBlock(send *types.Hash) (*types.StateBlock, error)
- func (b *BlackHoleAPI) GetSendBlock(param *cabi.DestroyParam) (*types.StateBlock, error)
- func (b *BlackHoleAPI) GetTotalDestroyInfo(addr *types.Address) (types.Balance, error)
- type BlockSubscriber
- type BlockSubscription
- func (r *BlockSubscription) AddChan(subID string, addr types.Address, batch bool, ch chan struct{})
- func (r *BlockSubscription) FetchAddrBlock(subID string) *types.StateBlock
- func (r *BlockSubscription) FetchBlocks(subID string) []*types.StateBlock
- func (r *BlockSubscription) RemoveChan(subID string)
- type CacheStat
- type ChainApi
- type ConfigApi
- func (c *ConfigApi) Commit(token string, mark string) (bool, error)
- func (c *ConfigApi) CurrentConfig(token string) (*config.Config, error)
- func (c *ConfigApi) Difference(token string, mark string) (string, error)
- func (c *ConfigApi) Save(token string, mark string) (bool, error)
- func (c *ConfigApi) Update(params []string, token string, mark string) (*config.Config, error)
- type ContractApi
- func (c *ContractApi) ContractAddressList() []types.Address
- func (c *ContractApi) GenerateRewardBlock(para *ContractRewardBlockPara) (*types.StateBlock, error)
- func (c *ContractApi) GenerateSendBlock(para *ContractSendBlockPara) (*types.StateBlock, error)
- func (c *ContractApi) GetAbiByContractAddress(address types.Address) (string, error)
- func (c *ContractApi) PackChainContractData(contractAddress types.Address, methodName string, params []string) ([]byte, error)
- func (c *ContractApi) PackContractData(abiStr string, methodName string, params []string) ([]byte, error)
- type ContractPrivacyParam
- type ContractRewardBlockPara
- type ContractSendBlockPara
- type DebugApi
- func (l *DebugApi) AccountPending(address types.Address, hash types.Hash) (*APIPendingInfo, error)
- func (l *DebugApi) Action(at storage.ActionType, t int) (string, error)
- func (l *DebugApi) BadgerTableSize(keyPrefixs []storage.KeyPrefix) (int64, error)
- func (l *DebugApi) BlockCacheCount() (map[string]uint64, error)
- func (l *DebugApi) BlockCaches() ([]types.Hash, error)
- func (l *DebugApi) BlockLink(hash types.Hash) (map[string]types.Hash, error)
- func (l *DebugApi) BlockLinks(hash types.Hash) (map[string][]types.Hash, error)
- func (l *DebugApi) BlocksCountByType(typ string) (map[string]int64, error)
- func (l *DebugApi) ContractCount() (map[string]int64, error)
- func (l *DebugApi) DebugConsensus() error
- func (l *DebugApi) FeedConsensus() error
- func (l *DebugApi) GetCache() error
- func (l *DebugApi) GetCacheStat() []*CacheStat
- func (l *DebugApi) GetCacheStatus() map[string]string
- func (l *DebugApi) GetConsInfo() (map[string]interface{}, error)
- func (l *DebugApi) GetConsPerf() (map[string]interface{}, error)
- func (l *DebugApi) GetOnlineInfo() (map[uint64]*dpos.RepOnlinePeriod, error)
- func (l *DebugApi) GetPovInfo() (map[string]interface{}, error)
- func (l *DebugApi) GetPrivacyInfo() (map[string]interface{}, error)
- func (l *DebugApi) GetSyncBlockNum() (map[string]uint64, error)
- func (l *DebugApi) GetUCache() error
- func (l *DebugApi) GetUCacheStat() []*CacheStat
- func (l *DebugApi) GetUCacheStatus() map[string]string
- func (l *DebugApi) NewBlock(ctx context.Context) (*rpc.Subscription, error)
- func (l *DebugApi) NodeStatus() (*NodeStatus, error)
- func (l *DebugApi) PendingsAmount() (map[types.Address]map[string]types.Balance, error)
- func (l *DebugApi) PendingsCount() (int, error)
- func (l *DebugApi) Representative(address types.Address) (*APIRepresentative, error)
- func (l *DebugApi) SetConsPerf(op int) (map[string]interface{}, error)
- func (l *DebugApi) UncheckAnalysis() ([]*UncheckInfo, error)
- func (l *DebugApi) UncheckBlock(hash types.Hash) ([]*UncheckInfo, error)
- func (l *DebugApi) UncheckBlocks() ([]*APIUncheckBlock, error)
- func (l *DebugApi) UncheckBlocksCount() (map[string]int, error)
- func (l *DebugApi) UncheckBlocksCountStore() (map[string]uint64, error)
- type KYCAdminUpdateParam
- type KYCAdminUser
- type KYCApi
- func (p *KYCApi) GetAdmin() (*KYCAdminUser, error)
- func (p *KYCApi) GetAdminHandoverBlock(param *KYCAdminUpdateParam) (*types.StateBlock, error)
- func (p *KYCApi) GetOperator(count int, offset int) ([]*KYCOperatorInfo, error)
- func (p *KYCApi) GetOperatorCount() int
- func (p *KYCApi) GetStatus(count int, offset int) ([]*KYCStatusInfo, error)
- func (p *KYCApi) GetStatusByChainAddress(ca types.Address) (*KYCStatusInfo, error)
- func (p *KYCApi) GetStatusByTradeAddress(ta string) (*KYCStatusInfo, error)
- func (p *KYCApi) GetStatusCount() int
- func (p *KYCApi) GetTradeAddress(address types.Address) (*KYCTradeAddressPack, error)
- func (p *KYCApi) GetUpdateOperatorBlock(param *KYCUpdateOperatorParam) (*types.StateBlock, error)
- func (p *KYCApi) GetUpdateStatusBlock(param *KYCUpdateStatusParam) (*types.StateBlock, error)
- func (p *KYCApi) GetUpdateTradeAddressBlock(param *KYCUpdateTradeAddressParam) (*types.StateBlock, error)
- type KYCOperatorInfo
- type KYCStatusInfo
- type KYCTradeAddress
- type KYCTradeAddressPack
- type KYCUpdateOperatorParam
- type KYCUpdateStatusParam
- type KYCUpdateTradeAddressParam
- type LedgerAPI
- func (l *LedgerAPI) AccountBlocksCount(addr types.Address) (int64, error)
- func (l *LedgerAPI) AccountHistoryTopn(address types.Address, count int, offset *int) ([]*APIBlock, error)
- func (l *LedgerAPI) AccountInfo(address types.Address) (*APIAccount, error)
- func (l *LedgerAPI) AccountRepresentative(addr types.Address) (types.Address, error)
- func (l *LedgerAPI) AccountVotingWeight(addr types.Address) (types.Balance, error)
- func (l *LedgerAPI) Accounts(count int, offset *int) ([]types.Address, error)
- func (l *LedgerAPI) AccountsBalance(addresses []types.Address) (map[types.Address]map[string]*APIAccountsBalance, error)
- func (l *LedgerAPI) AccountsCount() (uint64, error)
- func (l *LedgerAPI) AccountsFrontiers(addresses []types.Address) (map[types.Address]map[string]types.Hash, error)
- func (l *LedgerAPI) AccountsPending(addresses []types.Address, n int) (map[types.Address][]*APIPending, error)
- func (l *LedgerAPI) AllGenesisBlocks() []types.StateBlock
- func (l *LedgerAPI) BalanceChange(ctx context.Context, address types.Address) (*rpc.Subscription, error)
- func (l *LedgerAPI) BlockAccount(hash types.Hash) (types.Address, error)
- func (l *LedgerAPI) BlockConfirmedStatus(hash types.Hash) (bool, error)
- func (l *LedgerAPI) BlockHash(block types.StateBlock) types.Hash
- func (l *LedgerAPI) Blocks(count int, offset *int) ([]*APIBlock, error)
- func (l *LedgerAPI) BlocksCount() (map[string]uint64, error)
- func (l *LedgerAPI) BlocksCount2() (map[string]uint64, error)
- func (l *LedgerAPI) BlocksCountByType() (map[string]uint64, error)
- func (l *LedgerAPI) BlocksInfo(hash []types.Hash) ([]*APIBlock, error)
- func (l *LedgerAPI) Chain(hash types.Hash, n int) ([]types.Hash, error)
- func (l *LedgerAPI) ChainToken() types.Hash
- func (l *LedgerAPI) ConfirmedAccountInfo(address types.Address) (*APIAccount, error)
- func (l *LedgerAPI) ConfirmedBlocksInfo(hash []types.Hash) ([]*APIBlock, error)
- func (l *LedgerAPI) Delegators(hash types.Address) ([]*APIAccountBalance, error)
- func (l *LedgerAPI) DelegatorsCount(hash types.Address) (int64, error)
- func (l *LedgerAPI) GasAddress() types.Address
- func (l *LedgerAPI) GasBlock() types.StateBlock
- func (l *LedgerAPI) GasBlockHash() types.Hash
- func (l *LedgerAPI) GasMintageBlock() types.StateBlock
- func (l *LedgerAPI) GasToken() types.Hash
- func (l *LedgerAPI) GenerateChangeBlock(account types.Address, representative types.Address, prkStr *string) (*types.StateBlock, error)
- func (l *LedgerAPI) GenerateReceiveBlock(sendBlock *types.StateBlock, prkStr *string) (*types.StateBlock, error)
- func (l *LedgerAPI) GenerateReceiveBlockByHash(sendHash types.Hash, prkStr *string) (*types.StateBlock, error)
- func (l *LedgerAPI) GenerateSendBlock(para *APISendBlockPara, prkStr *string) (*types.StateBlock, error)
- func (l *LedgerAPI) GenesisAddress() types.Address
- func (l *LedgerAPI) GenesisBlock() types.StateBlock
- func (l *LedgerAPI) GenesisBlockHash() types.Hash
- func (l *LedgerAPI) GenesisMintageBlock() types.StateBlock
- func (l *LedgerAPI) GenesisMintageHash() types.Hash
- func (l *LedgerAPI) GetAccountOnlineBlock(account types.Address) ([]*types.StateBlock, error)
- func (l *LedgerAPI) IsGenesisBlock(block *types.StateBlock) bool
- func (l *LedgerAPI) IsGenesisToken(hash types.Hash) bool
- func (l *LedgerAPI) NewAccountBlock(ctx context.Context, address types.Address) (*rpc.Subscription, error)
- func (l *LedgerAPI) NewBlock(ctx context.Context) (*rpc.Subscription, error)
- func (l *LedgerAPI) NewPending(ctx context.Context, address types.Address) (*rpc.Subscription, error)
- func (l *LedgerAPI) Pendings() ([]*APIPending, error)
- func (l *LedgerAPI) Process(block *types.StateBlock) (types.Hash, error)
- func (l *LedgerAPI) Representatives(sorting *bool) ([]*APIRepresentative, error)
- func (l *LedgerAPI) TokenInfoById(tokenId types.Hash) (*ApiTokenInfo, error)
- func (l *LedgerAPI) TokenInfoByName(tokenName string) (*ApiTokenInfo, error)
- func (l *LedgerAPI) Tokens() ([]*types.TokenInfo, error)
- func (l *LedgerAPI) TransactionsCount() (map[string]uint64, error)
- type LedgerStatus
- type MetricsApi
- func (m *MetricsApi) DiskInfo() (*disk.UsageStat, error)
- func (m *MetricsApi) GetAllCPUTimeStats() ([]cpu.TimesStat, error)
- func (m *MetricsApi) GetCPUInfo() ([]cpu.InfoStat, error)
- func (m *MetricsApi) GetCPUTimeStats() ([]cpu.TimesStat, error)
- func (m *MetricsApi) GetNetworkInterfaces() ([]net.IOCountersStat, error)
- type MinerApi
- func (m *MinerApi) GetAvailRewardInfo(coinbase types.Address) (*MinerAvailRewardInfo, error)
- func (m *MinerApi) GetRewardData(param *RewardParam) ([]byte, error)
- func (m *MinerApi) GetRewardHistory(coinbase types.Address) (*MinerHistoryRewardInfo, error)
- func (m *MinerApi) GetRewardRecvBlock(input *types.StateBlock) (*types.StateBlock, error)
- func (m *MinerApi) GetRewardRecvBlockBySendHash(sendHash types.Hash) (*types.StateBlock, error)
- func (m *MinerApi) GetRewardSendBlock(param *RewardParam) (*types.StateBlock, error)
- func (m *MinerApi) UnpackRewardData(data []byte) (*RewardParam, error)
- type MinerAvailRewardInfo
- type MinerHistoryRewardInfo
- type MintageAPI
- func (m *MintageAPI) GetMintageBlock(param *MintageParams) (*types.StateBlock, error)
- func (m *MintageAPI) GetMintageData(param *MintageParams) ([]byte, error)
- func (m *MintageAPI) GetRewardBlock(input *types.StateBlock) (*types.StateBlock, error)
- func (m *MintageAPI) GetWithdrawMintageBlock(param *WithdrawParams) (*types.StateBlock, error)
- func (m *MintageAPI) GetWithdrawMintageData(tokenId types.Hash) ([]byte, error)
- func (m *MintageAPI) GetWithdrawRewardBlock(input *types.StateBlock) (*types.StateBlock, error)
- func (p *MintageAPI) ParseTokenInfo(data []byte) (*types.TokenInfo, error)
- type MintageParams
- type NEP5PledgeAPI
- func (p *NEP5PledgeAPI) GetAllPledgeInfo() ([]*NEP5PledgeInfo, error)
- func (p *NEP5PledgeAPI) GetBeneficialPledgeInfos(beneficial types.Address, pType string) (*PledgeInfos, error)
- func (p *NEP5PledgeAPI) GetBeneficialPledgeInfosByAddress(beneficial types.Address) *PledgeInfos
- func (p *NEP5PledgeAPI) GetPledgeBeneficialAmount(beneficial types.Address, pType string) (*big.Int, error)
- func (p *NEP5PledgeAPI) GetPledgeBeneficialTotalAmount(addr types.Address) (*big.Int, error)
- func (p *NEP5PledgeAPI) GetPledgeBlock(param *PledgeParam) (*types.StateBlock, error)
- func (p *NEP5PledgeAPI) GetPledgeData(param *PledgeParam) ([]byte, error)
- func (p *NEP5PledgeAPI) GetPledgeInfo(param *WithdrawPledgeParam) ([]*NEP5PledgeInfo, error)
- func (p *NEP5PledgeAPI) GetPledgeInfoWithNEP5TxId(param *WithdrawPledgeParam) (*NEP5PledgeInfo, error)
- func (p *NEP5PledgeAPI) GetPledgeInfoWithTimeExpired(param *WithdrawPledgeParam) ([]*NEP5PledgeInfo, error)
- func (p *NEP5PledgeAPI) GetPledgeInfosByPledgeAddress(addr types.Address) *PledgeInfos
- func (p *NEP5PledgeAPI) GetPledgeRewardBlock(input *types.StateBlock) (*types.StateBlock, error)
- func (p *NEP5PledgeAPI) GetPledgeRewardBlockBySendHash(sendHash types.Hash) (*types.StateBlock, error)
- func (p *NEP5PledgeAPI) GetTotalPledgeAmount() (*big.Int, error)
- func (p *NEP5PledgeAPI) GetWithdrawPledgeBlock(param *WithdrawPledgeParam) (*types.StateBlock, error)
- func (p *NEP5PledgeAPI) GetWithdrawPledgeData(param *WithdrawPledgeParam) ([]byte, error)
- func (p *NEP5PledgeAPI) GetWithdrawRewardBlock(input *types.StateBlock) (*types.StateBlock, error)
- func (p *NEP5PledgeAPI) GetWithdrawRewardBlockBySendHash(sendHash types.Hash) (*types.StateBlock, error)
- func (p *NEP5PledgeAPI) ParsePledgeInfo(data []byte) (*cabi.NEP5PledgeInfo, error)
- type NEP5PledgeInfo
- type NetApi
- func (q *NetApi) ConnectPeersInfo(count int, offset *int) ([]*types.PeerInfo, error)
- func (q *NetApi) GetAllPeersInfo(count int, offset *int) ([]*types.PeerInfo, error)
- func (q *NetApi) GetBandwidthStats() *topic.EventBandwidthStats
- func (q *NetApi) GetOnlinePeersInfo(count int, offset *int) ([]*types.PeerInfo, error)
- func (q *NetApi) GetPeerId() string
- func (q *NetApi) OnlineRepresentatives() []types.Address
- func (q *NetApi) OnlineRepsInfo() *OnlineRepTotal
- func (q *NetApi) PeersCount() (map[string]uint64, error)
- func (q *NetApi) Syncing() bool
- type NetStatus
- type NodeInfo
- type NodeParam
- type NodeStatus
- type OnlineRepInfo
- type OnlineRepTotal
- type OracleParam
- type PKDAvailRewardInfo
- type PKDHistoryRewardInfo
- type PKDRewardParam
- type PKDVerifierStateList
- type POVStatus
- type PermissionApi
- func (p *PermissionApi) GetAdmin() (*AdminUser, error)
- func (p *PermissionApi) GetAdminHandoverBlock(param *AdminUpdateParam) (*types.StateBlock, error)
- func (p *PermissionApi) GetNode(id string) (*NodeInfo, error)
- func (p *PermissionApi) GetNodeUpdateBlock(param *NodeParam) (*types.StateBlock, error)
- func (p *PermissionApi) GetNodes(count int, offset int) ([]*NodeInfo, error)
- func (p *PermissionApi) GetNodesCount() int
- type PledgeInfos
- type PledgeParam
- type PovApi
- func (api *PovApi) BatchGetHeadersByHeight(height uint64, count uint64, asc bool) (*PovApiBatchHeader, error)
- func (api *PovApi) CheckAllAccountStates() (*PovApiCheckStateRsp, error)
- func (api *PovApi) DumpBlockState(blockHash types.Hash) (*PovApiDumpState, error)
- func (api *PovApi) DumpContractState(stateHash types.Hash, address types.Address) (*PovApiContractState, error)
- func (api *PovApi) GetAccountState(address types.Address, stateHash types.Hash) (*PovApiState, error)
- func (api *PovApi) GetAccountStateByBlockHash(address types.Address, blockHash types.Hash) (*PovApiState, error)
- func (api *PovApi) GetAccountStateByBlockHeight(address types.Address, height uint64) (*PovApiState, error)
- func (api *PovApi) GetAllOnlineRepStates(header *types.PovHeader) []*types.PovRepState
- func (api *PovApi) GetAllRepStatesByBlockHash(blockHash types.Hash) (*PovApiRepState, error)
- func (api *PovApi) GetAllRepStatesByBlockHeight(blockHeight uint64) (*PovApiRepState, error)
- func (api *PovApi) GetAllRepStatesByStateHash(stateHash types.Hash) (*PovApiRepState, error)
- func (api *PovApi) GetBlockByHash(blockHash types.Hash, txOffset uint32, txLimit uint32) (*PovApiBlock, error)
- func (api *PovApi) GetBlockByHeight(height uint64, txOffset uint32, txLimit uint32) (*PovApiBlock, error)
- func (api *PovApi) GetBlockTDByHash(blockHash types.Hash) (*PovApiTD, error)
- func (api *PovApi) GetBlockTDByHeight(height uint64) (*PovApiTD, error)
- func (api *PovApi) GetDiffDayStat(dayIndex uint32) (*types.PovDiffDayStat, error)
- func (api *PovApi) GetDiffDayStatByHeight(height uint64) (*types.PovDiffDayStat, error)
- func (api *PovApi) GetFittestHeader(gap uint64) (*PovApiHeader, error)
- func (api *PovApi) GetHashInfo(height uint64, lookup uint64) (*PovApiHashInfo, error)
- func (api *PovApi) GetHeaderByHash(blockHash types.Hash) (*PovApiHeader, error)
- func (api *PovApi) GetHeaderByHeight(height uint64) (*PovApiHeader, error)
- func (api *PovApi) GetLastNHourInfo(endHeight uint64, timeSpan uint32) (*PovApiGetLastNHourInfo, error)
- func (api *PovApi) GetLatestAccountState(address types.Address) (*PovApiState, error)
- func (api *PovApi) GetLatestBlock(txOffset uint32, txLimit uint32) (*PovApiBlock, error)
- func (api *PovApi) GetLatestHeader() (*PovApiHeader, error)
- func (api *PovApi) GetLedgerStats() (*PovLedgerStats, error)
- func (api *PovApi) GetMinerDayStat(dayIndex uint32) (*types.PovMinerDayStat, error)
- func (api *PovApi) GetMinerDayStatByHeight(height uint64) (*types.PovMinerDayStat, error)
- func (api *PovApi) GetMinerStats(addrs []types.Address) (*PovMinerStats, error)
- func (api *PovApi) GetMiningInfo() (*PovApiGetMiningInfo, error)
- func (api *PovApi) GetPovStatus() (*PovStatus, error)
- func (api *PovApi) GetRepStatesByHeightAndAccount(header *types.PovHeader, acc types.Address) *types.PovRepState
- func (api *PovApi) GetRepStats(addrs []types.Address) (*PovRepStats, error)
- func (api *PovApi) GetTransaction(txHash types.Hash) (*PovApiTxLookup, error)
- func (api *PovApi) GetTransactionByBlockHashAndIndex(blockHash types.Hash, index uint32) (*PovApiTxLookup, error)
- func (api *PovApi) GetTransactionByBlockHeightAndIndex(height uint64, index uint32) (*PovApiTxLookup, error)
- func (api *PovApi) GetWork(minerAddr types.Address, algoName string) (*PovApiGetWork, error)
- func (api *PovApi) NewBlock(ctx context.Context) (*rpc.Subscription, error)
- func (api *PovApi) StartMining(minerAddr types.Address, algoName string) error
- func (api *PovApi) StopMining() error
- func (api *PovApi) SubmitWork(work *PovApiSubmitWork) error
- type PovApiBatchHeader
- type PovApiBlock
- type PovApiCheckStateRsp
- type PovApiContractState
- type PovApiDumpState
- type PovApiGetLastNHourInfo
- type PovApiGetLastNHourItem
- type PovApiGetMiningInfo
- type PovApiGetWork
- type PovApiHashInfo
- type PovApiHeader
- type PovApiKeyValPair
- type PovApiRepState
- type PovApiState
- type PovApiSubmitWork
- type PovApiTD
- type PovApiTxLookup
- type PovLedgerStats
- type PovMinerStatItem
- type PovMinerStats
- type PovRepStatItem
- type PovRepStats
- type PovStatus
- type PovSubscriber
- type PovSubscription
- type PrivacyApi
- func (api *PrivacyApi) DistributeRawPayload(param *PrivacyDistributeParam) ([]byte, error)
- func (api *PrivacyApi) GetBlockPrivatePayload(blockHash types.Hash) ([]byte, error)
- func (api *PrivacyApi) GetDemoKV(key []byte) ([]byte, error)
- func (api *PrivacyApi) GetRawPayload(enclaveKey []byte) ([]byte, error)
- type PrivacyDistributeParam
- type PtmKeyApi
- func (p *PtmKeyApi) GetPtmKeyByAccount(account types.Address) ([]*PtmKeyUpdateParam, error)
- func (p *PtmKeyApi) GetPtmKeyByAccountAndBtype(account types.Address, Btype string) ([]*PtmKeyUpdateParam, error)
- func (p *PtmKeyApi) GetPtmKeyDeleteBlock(param *PtmKeyDeleteParam) (*types.StateBlock, error)
- func (p *PtmKeyApi) GetPtmKeyUpdateBlock(param *PtmKeyUpdateParam) (*types.StateBlock, error)
- type PtmKeyDeleteParam
- type PtmKeyUpdateParam
- type PublicKeyDistributionApi
- func (p *PublicKeyDistributionApi) GetActiveVerifiers(vType string) ([]*VerifierRegParam, error)
- func (p *PublicKeyDistributionApi) GetAllVerifierStatesByBlockHeight(height uint64) (*PKDVerifierStateList, error)
- func (p *PublicKeyDistributionApi) GetAllVerifiers() ([]*VerifierRegParam, error)
- func (p *PublicKeyDistributionApi) GetAvailRewardInfo(account types.Address) (*PKDAvailRewardInfo, error)
- func (p *PublicKeyDistributionApi) GetOracleBlock(param *OracleParam) (*types.StateBlock, error)
- func (p *PublicKeyDistributionApi) GetOracleInfosByAccountAndType(account types.Address, oType string) ([]*OracleParam, error)
- func (p *PublicKeyDistributionApi) GetOracleInfosByHash(hash string) ([]*OracleParam, error)
- func (p *PublicKeyDistributionApi) GetOracleInfosByType(oType string) ([]*OracleParam, error)
- func (p *PublicKeyDistributionApi) GetOracleInfosByTypeAndID(oType string, id string) ([]*OracleParam, error)
- func (p *PublicKeyDistributionApi) GetPubKeyByTypeAndID(pType string, pID string) ([]*PublishInfoState, error)
- func (p *PublicKeyDistributionApi) GetPublishBlock(param *PublishParam) (*PublishRet, error)
- func (p *PublicKeyDistributionApi) GetPublishInfosByAccountAndType(account types.Address, pType string) ([]*PublishInfoState, error)
- func (p *PublicKeyDistributionApi) GetPublishInfosByType(pType string) ([]*PublishInfoState, error)
- func (p *PublicKeyDistributionApi) GetRecommendPubKey(pType string, pID string) (*PublishInfoState, error)
- func (p *PublicKeyDistributionApi) GetRewardHistory(account types.Address) (*PKDHistoryRewardInfo, error)
- func (p *PublicKeyDistributionApi) GetRewardRecvBlock(input *types.StateBlock) (*types.StateBlock, error)
- func (p *PublicKeyDistributionApi) GetRewardRecvBlockBySendHash(sendHash types.Hash) (*types.StateBlock, error)
- func (p *PublicKeyDistributionApi) GetRewardSendBlock(param *PKDRewardParam) (*types.StateBlock, error)
- func (p *PublicKeyDistributionApi) GetUnPublishBlock(param *UnPublishParam) (*types.StateBlock, error)
- func (p *PublicKeyDistributionApi) GetVerifierHeartBlock(account types.Address, vTypes []string) (*types.StateBlock, error)
- func (p *PublicKeyDistributionApi) GetVerifierRegisterBlock(param *VerifierRegParam) (*types.StateBlock, error)
- func (p *PublicKeyDistributionApi) GetVerifierStateByBlockHeight(height uint64, address types.Address) (*types.PovVerifierState, error)
- func (p *PublicKeyDistributionApi) GetVerifierUnregisterBlock(param *VerifierUnRegParam) (*types.StateBlock, error)
- func (p *PublicKeyDistributionApi) GetVerifiersByAccount(account types.Address) ([]*VerifierRegParam, error)
- func (p *PublicKeyDistributionApi) GetVerifiersByType(vType string) ([]*VerifierRegParam, error)
- func (p *PublicKeyDistributionApi) PackRewardData(param *PKDRewardParam) ([]byte, error)
- func (p *PublicKeyDistributionApi) UnpackRewardData(data []byte) (*PKDRewardParam, error)
- type PublishInfoState
- type PublishParam
- type PublishRet
- type RepApi
- func (r *RepApi) GetAvailRewardInfo(account types.Address) (*RepAvailRewardInfo, error)
- func (r *RepApi) GetRepStateWithHeight(params *RepStateParams) (*types.PovRepState, error)
- func (r *RepApi) GetRewardData(param *RepRewardParam) ([]byte, error)
- func (r *RepApi) GetRewardHistory(account types.Address) (*RepHistoryRewardInfo, error)
- func (r *RepApi) GetRewardRecvBlock(input *types.StateBlock) (*types.StateBlock, error)
- func (r *RepApi) GetRewardRecvBlockBySendHash(sendHash types.Hash) (*types.StateBlock, error)
- func (r *RepApi) GetRewardSendBlock(param *RepRewardParam) (*types.StateBlock, error)
- func (r *RepApi) UnpackRewardData(data []byte) (*RepRewardParam, error)
- type RepAvailRewardInfo
- type RepHistoryRewardInfo
- type RepRewardParam
- type RepStateParams
- type RewardParam
- type RewardsAPI
- func (r *RewardsAPI) GetConfidantRewards(confidant types.Address) (map[string]*big.Int, error)
- func (r *RewardsAPI) GetConfidantRewordsDetail(confidant types.Address) (map[string][]*cabi.RewardsInfo, error)
- func (r *RewardsAPI) GetReceiveRewardBlock(send *types.Hash) (*types.StateBlock, error)
- func (r *RewardsAPI) GetRewardsDetail(txId string) ([]*cabi.RewardsInfo, error)
- func (r *RewardsAPI) GetSendConfidantBlock(param *RewardsParam, sign *types.Signature) (*types.StateBlock, error)
- func (r *RewardsAPI) GetSendRewardBlock(param *RewardsParam, sign *types.Signature) (*types.StateBlock, error)
- func (r *RewardsAPI) GetTotalRewards(txId string) (*big.Int, error)
- func (r *RewardsAPI) GetUnsignedConfidantData(param *RewardsParam) (types.Hash, error)
- func (r *RewardsAPI) GetUnsignedRewardData(param *RewardsParam) (types.Hash, error)
- func (r *RewardsAPI) IsAirdropRewards(data []byte) bool
- type RewardsParam
- type UnPublishParam
- type UncheckInfo
- type UtilAPI
- func (u *UtilAPI) BalanceToRaw(balance types.Balance, unit string, tokenName *string) (types.Balance, error)
- func (u *UtilAPI) Decrypt(cryptograph string, passphrase string) (string, error)
- func (u *UtilAPI) Encrypt(raw string, passphrase string) (string, error)
- func (u *UtilAPI) RawToBalance(balance types.Balance, unit string, tokenName *string) (*APIBalance, error)
- type VerifierContent
- type VerifierRegParam
- type VerifierUnRegParam
- type WithdrawParams
- type WithdrawPledgeParam
Constants ¶
const (
MaxNotifyBlocks = 100
)
const (
MaxNotifyPovBlocks = 100
)
Variables ¶
Functions ¶
func CreatePovSubscription ¶ added in v1.3.0
func CreatePovSubscription(ctx context.Context, fn func(notifier *rpc.Notifier, subscription *rpc.Subscription)) (*rpc.Subscription, error)
func FillHeader ¶ added in v1.4.0
func FillHeader(header *PovApiHeader)
Types ¶
type APIAccount ¶ added in v0.0.5
type APIAccount struct { Address types.Address `json:"account"` CoinBalance *types.Balance `json:"coinBalance,omitempty"` CoinVote *types.Balance `json:"vote,omitempty"` CoinNetwork *types.Balance `json:"network,omitempty"` CoinStorage *types.Balance `json:"storage,omitempty"` CoinOracle *types.Balance `json:"oracle,omitempty"` Representative *types.Address `json:"representative,omitempty"` Tokens []*APITokenMeta `json:"tokens"` }
func GenerateAPIAccountMeta ¶ added in v1.4.0
func GenerateAPIAccountMeta(store ledger.Store, am *types.AccountMeta) (*APIAccount, error)
type APIAccountBalance ¶ added in v0.0.9
type APIAccountsBalance ¶ added in v1.2.3
type APIAccountsBalance struct { Balance types.Balance `json:"balance"` Vote *types.Balance `json:"vote,omitempty"` Network *types.Balance `json:"network,omitempty"` Storage *types.Balance `json:"storage,omitempty"` Oracle *types.Balance `json:"oracle,omitempty"` Pending types.Balance `json:"pending"` }
type APIBalance ¶ added in v1.2.3
func (*APIBalance) MarshalText ¶ added in v1.2.3
func (b *APIBalance) MarshalText() ([]byte, error)
func (*APIBalance) String ¶ added in v1.2.3
func (b *APIBalance) String() string
type APIBlock ¶
type APIBlock struct { *types.StateBlock TokenName string `json:"tokenName"` Amount types.Balance `json:"amount"` Hash types.Hash `json:"hash"` PovConfirmHeight uint64 `json:"povConfirmHeight"` PovConfirmCount uint64 `json:"povConfirmCount"` }
func GenerateAPIBlock ¶ added in v1.4.0
type APIPending ¶ added in v0.0.5
type APIPending struct { *types.PendingKey *types.PendingInfo TokenName string `json:"tokenName"` Timestamp int64 `json:"timestamp"` BlockType types.BlockType `json:"blockType"` }
type APIPendingInfo ¶ added in v1.3.0
type APIPendingInfo struct { *types.PendingKey *types.PendingInfo TokenName string `json:"tokenName"` Timestamp int64 `json:"timestamp"` Used bool `json:"used"` }
type APIRepresentative ¶ added in v0.0.5
type APISendBlockPara ¶ added in v0.0.5
type APITokenMeta ¶ added in v0.0.5
type APIUncheckBlock ¶ added in v1.2.3
type APIUncheckBlock struct { Block *types.StateBlock `json:"block"` Hash types.Hash `json:"hash"` Link types.Hash `json:"link"` UnCheckType string `json:"uncheckType"` SyncType types.SynchronizedKind `json:"syncType"` Height uint64 `json:"povHeight"` }
type AccountApi ¶ added in v0.0.5
type AccountApi struct {
// contains filtered or unexported fields
}
func NewAccountApi ¶ added in v0.0.5
func NewAccountApi() *AccountApi
func (*AccountApi) ForPublicKey ¶ added in v0.0.5
func (a *AccountApi) ForPublicKey(pubStr string) (types.Address, error)
func (*AccountApi) NewAccounts ¶ added in v1.2.2
func (a *AccountApi) NewAccounts(count *uint32) ([]*Accounts, error)
func (*AccountApi) NewSeed ¶ added in v1.1.0
func (a *AccountApi) NewSeed() (string, error)
func (*AccountApi) PublicKey ¶ added in v0.0.5
func (a *AccountApi) PublicKey(addr types.Address) string
func (*AccountApi) Validate ¶ added in v0.0.5
func (a *AccountApi) Validate(addr string) bool
type AdminUpdateParam ¶ added in v1.4.0
type ApiTokenInfo ¶ added in v0.0.9
type BlackHoleAPI ¶ added in v1.4.0
type BlackHoleAPI struct {
// contains filtered or unexported fields
}
func NewBlackHoleApi ¶ added in v1.3.0
func NewBlackHoleApi(l ledger.Store, cc *context.ChainContext) *BlackHoleAPI
func (*BlackHoleAPI) GetDestroyInfoDetail ¶ added in v1.4.0
func (b *BlackHoleAPI) GetDestroyInfoDetail(addr *types.Address) ([]*cabi.DestroyInfo, error)
func (*BlackHoleAPI) GetRewardsBlock ¶ added in v1.4.0
func (b *BlackHoleAPI) GetRewardsBlock(send *types.Hash) (*types.StateBlock, error)
func (*BlackHoleAPI) GetSendBlock ¶ added in v1.4.0
func (b *BlackHoleAPI) GetSendBlock(param *cabi.DestroyParam) (*types.StateBlock, error)
func (*BlackHoleAPI) GetTotalDestroyInfo ¶ added in v1.4.0
type BlockSubscriber ¶ added in v1.3.0
type BlockSubscriber struct {
// contains filtered or unexported fields
}
type BlockSubscription ¶ added in v1.3.0
type BlockSubscription struct {
// contains filtered or unexported fields
}
BlockSubscription subscript event from chain, and deliver to every connected websocket
func NewBlockSubscription ¶ added in v1.3.0
func NewBlockSubscription(ctx context.Context, eb event.EventBus) *BlockSubscription
func (*BlockSubscription) AddChan ¶ added in v1.4.0
func (r *BlockSubscription) AddChan(subID string, addr types.Address, batch bool, ch chan struct{})
func (*BlockSubscription) FetchAddrBlock ¶ added in v1.4.0
func (r *BlockSubscription) FetchAddrBlock(subID string) *types.StateBlock
func (*BlockSubscription) FetchBlocks ¶ added in v1.4.0
func (r *BlockSubscription) FetchBlocks(subID string) []*types.StateBlock
func (*BlockSubscription) RemoveChan ¶ added in v1.4.0
func (r *BlockSubscription) RemoveChan(subID string)
type ChainApi ¶ added in v1.3.0
type ChainApi struct {
// contains filtered or unexported fields
}
func NewChainApi ¶ added in v1.3.0
func (*ChainApi) LedgerSize ¶ added in v1.3.0
type ConfigApi ¶ added in v1.3.0
type ConfigApi struct {
// contains filtered or unexported fields
}
func NewConfigApi ¶ added in v1.3.0
func (*ConfigApi) CurrentConfig ¶ added in v1.3.0
func (*ConfigApi) Difference ¶ added in v1.3.0
type ContractApi ¶ added in v0.0.9
type ContractApi struct {
// contains filtered or unexported fields
}
func NewContractApi ¶ added in v0.0.9
func NewContractApi(cc *chainctx.ChainContext, l ledger.Store) *ContractApi
func (*ContractApi) ContractAddressList ¶ added in v1.2.0
func (c *ContractApi) ContractAddressList() []types.Address
func (*ContractApi) GenerateRewardBlock ¶ added in v1.4.0
func (c *ContractApi) GenerateRewardBlock(para *ContractRewardBlockPara) (*types.StateBlock, error)
func (*ContractApi) GenerateSendBlock ¶ added in v1.4.0
func (c *ContractApi) GenerateSendBlock(para *ContractSendBlockPara) (*types.StateBlock, error)
func (*ContractApi) GetAbiByContractAddress ¶ added in v1.3.0
func (c *ContractApi) GetAbiByContractAddress(address types.Address) (string, error)
func (*ContractApi) PackChainContractData ¶ added in v1.4.0
func (*ContractApi) PackContractData ¶ added in v0.0.9
type ContractPrivacyParam ¶ added in v1.4.0
type ContractRewardBlockPara ¶ added in v1.4.0
type ContractSendBlockPara ¶ added in v1.4.0
type ContractSendBlockPara struct { Address types.Address `json:"address"` TokenName string `json:"tokenName"` To types.Address `json:"to"` Amount types.Balance `json:"amount"` Data []byte `json:"data"` PrivateFrom string `json:"privateFrom,omitempty"` PrivateFor []string `json:"privateFor,omitempty"` PrivateGroupID string `json:"privateGroupID,omitempty"` EnclaveKey []byte `json:"enclaveKey,omitempty"` }
type DebugApi ¶ added in v1.2.3
type DebugApi struct {
// contains filtered or unexported fields
}
func (*DebugApi) AccountPending ¶ added in v1.3.0
func (*DebugApi) BadgerTableSize ¶ added in v1.4.2
func (*DebugApi) BlockCacheCount ¶ added in v1.2.3
func (*DebugApi) BlockCaches ¶ added in v1.3.0
func (*DebugApi) BlockLinks ¶ added in v1.4.0
func (*DebugApi) BlocksCountByType ¶ added in v1.3.0
func (*DebugApi) ContractCount ¶ added in v1.3.0
func (*DebugApi) DebugConsensus ¶ added in v1.4.0
func (*DebugApi) FeedConsensus ¶ added in v1.4.0
func (*DebugApi) GetCacheStat ¶ added in v1.4.0
func (*DebugApi) GetCacheStatus ¶ added in v1.4.0
func (*DebugApi) GetConsInfo ¶ added in v1.3.0
func (*DebugApi) GetConsPerf ¶ added in v1.4.0
func (*DebugApi) GetOnlineInfo ¶ added in v1.3.0
func (l *DebugApi) GetOnlineInfo() (map[uint64]*dpos.RepOnlinePeriod, error)
func (*DebugApi) GetPovInfo ¶ added in v1.3.0
func (*DebugApi) GetPrivacyInfo ¶ added in v1.4.0
func (*DebugApi) GetSyncBlockNum ¶ added in v1.3.0
func (*DebugApi) GetUCacheStat ¶ added in v1.4.2
func (*DebugApi) GetUCacheStatus ¶ added in v1.4.2
func (*DebugApi) NodeStatus ¶ added in v1.4.2
func (l *DebugApi) NodeStatus() (*NodeStatus, error)
func (*DebugApi) PendingsAmount ¶ added in v1.3.0
func (*DebugApi) PendingsCount ¶ added in v1.3.0
func (*DebugApi) Representative ¶ added in v1.3.0
func (l *DebugApi) Representative(address types.Address) (*APIRepresentative, error)
func (*DebugApi) SetConsPerf ¶ added in v1.4.0
func (*DebugApi) UncheckAnalysis ¶ added in v1.4.0
func (l *DebugApi) UncheckAnalysis() ([]*UncheckInfo, error)
func (*DebugApi) UncheckBlock ¶ added in v1.4.0
func (l *DebugApi) UncheckBlock(hash types.Hash) ([]*UncheckInfo, error)
func (*DebugApi) UncheckBlocks ¶ added in v1.2.3
func (l *DebugApi) UncheckBlocks() ([]*APIUncheckBlock, error)
func (*DebugApi) UncheckBlocksCount ¶ added in v1.4.0
type KYCAdminUpdateParam ¶ added in v1.4.1
type KYCAdminUser ¶ added in v1.4.1
type KYCApi ¶ added in v1.4.1
type KYCApi struct {
// contains filtered or unexported fields
}
func (*KYCApi) GetAdmin ¶ added in v1.4.1
func (p *KYCApi) GetAdmin() (*KYCAdminUser, error)
func (*KYCApi) GetAdminHandoverBlock ¶ added in v1.4.1
func (p *KYCApi) GetAdminHandoverBlock(param *KYCAdminUpdateParam) (*types.StateBlock, error)
func (*KYCApi) GetOperator ¶ added in v1.4.1
func (p *KYCApi) GetOperator(count int, offset int) ([]*KYCOperatorInfo, error)
func (*KYCApi) GetOperatorCount ¶ added in v1.4.1
func (*KYCApi) GetStatus ¶ added in v1.4.1
func (p *KYCApi) GetStatus(count int, offset int) ([]*KYCStatusInfo, error)
func (*KYCApi) GetStatusByChainAddress ¶ added in v1.4.1
func (p *KYCApi) GetStatusByChainAddress(ca types.Address) (*KYCStatusInfo, error)
func (*KYCApi) GetStatusByTradeAddress ¶ added in v1.4.1
func (p *KYCApi) GetStatusByTradeAddress(ta string) (*KYCStatusInfo, error)
func (*KYCApi) GetStatusCount ¶ added in v1.4.1
func (*KYCApi) GetTradeAddress ¶ added in v1.4.1
func (p *KYCApi) GetTradeAddress(address types.Address) (*KYCTradeAddressPack, error)
func (*KYCApi) GetUpdateOperatorBlock ¶ added in v1.4.1
func (p *KYCApi) GetUpdateOperatorBlock(param *KYCUpdateOperatorParam) (*types.StateBlock, error)
func (*KYCApi) GetUpdateStatusBlock ¶ added in v1.4.1
func (p *KYCApi) GetUpdateStatusBlock(param *KYCUpdateStatusParam) (*types.StateBlock, error)
func (*KYCApi) GetUpdateTradeAddressBlock ¶ added in v1.4.1
func (p *KYCApi) GetUpdateTradeAddressBlock(param *KYCUpdateTradeAddressParam) (*types.StateBlock, error)
type KYCOperatorInfo ¶ added in v1.4.1
type KYCStatusInfo ¶ added in v1.4.1
type KYCTradeAddress ¶ added in v1.4.1
type KYCTradeAddressPack ¶ added in v1.4.1
type KYCTradeAddressPack struct { ChainAddress types.Address `json:"chainAddress"` TradeAddress []*KYCTradeAddress `json:"tradeAddress"` }
type KYCUpdateOperatorParam ¶ added in v1.4.1
type KYCUpdateStatusParam ¶ added in v1.4.1
type KYCUpdateTradeAddressParam ¶ added in v1.4.1
type LedgerAPI ¶ added in v1.4.0
type LedgerAPI struct {
// contains filtered or unexported fields
}
func NewLedgerApi ¶ added in v0.0.5
func (*LedgerAPI) AccountBlocksCount ¶ added in v1.4.0
func (*LedgerAPI) AccountHistoryTopn ¶ added in v1.4.0
func (l *LedgerAPI) AccountHistoryTopn(address types.Address, count int, offset *int) ([]*APIBlock, error)
AccountHistoryTopn returns blocks of the account, blocks count of each token in the account up to n
func (*LedgerAPI) AccountInfo ¶ added in v1.4.0
func (l *LedgerAPI) AccountInfo(address types.Address) (*APIAccount, error)
func (*LedgerAPI) AccountRepresentative ¶ added in v1.4.0
func (*LedgerAPI) AccountVotingWeight ¶ added in v1.4.0
func (*LedgerAPI) AccountsBalance ¶ added in v1.4.0
func (*LedgerAPI) AccountsCount ¶ added in v1.4.0
func (*LedgerAPI) AccountsFrontiers ¶ added in v1.4.0
func (*LedgerAPI) AccountsPending ¶ added in v1.4.0
func (*LedgerAPI) AllGenesisBlocks ¶ added in v1.4.0
func (l *LedgerAPI) AllGenesisBlocks() []types.StateBlock
func (*LedgerAPI) BalanceChange ¶ added in v1.4.0
func (*LedgerAPI) BlockAccount ¶ added in v1.4.0
func (*LedgerAPI) BlockConfirmedStatus ¶ added in v1.4.0
func (*LedgerAPI) BlockHash ¶ added in v1.4.0
func (l *LedgerAPI) BlockHash(block types.StateBlock) types.Hash
func (*LedgerAPI) BlocksCount ¶ added in v1.4.0
BlocksCount returns the number of blocks (include smartcontrant block) in the ctx and unchecked synchronizing blocks
func (*LedgerAPI) BlocksCount2 ¶ added in v1.4.0
func (*LedgerAPI) BlocksCountByType ¶ added in v1.4.0
BlocksCountByType reports the number of blocks in the ctx by type (send, receive, open, change)
func (*LedgerAPI) BlocksInfo ¶ added in v1.4.0
func (*LedgerAPI) Chain ¶ added in v1.4.0
Chain returns a consecutive list of block hashes in the account chain starting at block up to count
func (*LedgerAPI) ChainToken ¶ added in v1.4.0
func (*LedgerAPI) ConfirmedAccountInfo ¶ added in v1.4.0
func (l *LedgerAPI) ConfirmedAccountInfo(address types.Address) (*APIAccount, error)
func (*LedgerAPI) ConfirmedBlocksInfo ¶ added in v1.4.0
func (*LedgerAPI) Delegators ¶ added in v1.4.0
func (l *LedgerAPI) Delegators(hash types.Address) ([]*APIAccountBalance, error)
Delegators returns a list of pairs of delegator names given account a representative and its balance
func (*LedgerAPI) DelegatorsCount ¶ added in v1.4.0
DelegatorsCount gets number of delegators for a specific representative account
func (*LedgerAPI) GasAddress ¶ added in v1.4.0
func (*LedgerAPI) GasBlock ¶ added in v1.4.0
func (l *LedgerAPI) GasBlock() types.StateBlock
func (*LedgerAPI) GasBlockHash ¶ added in v1.4.0
func (*LedgerAPI) GasMintageBlock ¶ added in v1.4.0
func (l *LedgerAPI) GasMintageBlock() types.StateBlock
func (*LedgerAPI) GenerateChangeBlock ¶ added in v1.4.0
func (*LedgerAPI) GenerateReceiveBlock ¶ added in v1.4.0
func (l *LedgerAPI) GenerateReceiveBlock(sendBlock *types.StateBlock, prkStr *string) (*types.StateBlock, error)
func (*LedgerAPI) GenerateReceiveBlockByHash ¶ added in v1.4.0
func (*LedgerAPI) GenerateSendBlock ¶ added in v1.4.0
func (l *LedgerAPI) GenerateSendBlock(para *APISendBlockPara, prkStr *string) (*types.StateBlock, error)
func (*LedgerAPI) GenesisAddress ¶ added in v1.4.0
func (*LedgerAPI) GenesisBlock ¶ added in v1.4.0
func (l *LedgerAPI) GenesisBlock() types.StateBlock
func (*LedgerAPI) GenesisBlockHash ¶ added in v1.4.0
func (*LedgerAPI) GenesisMintageBlock ¶ added in v1.4.0
func (l *LedgerAPI) GenesisMintageBlock() types.StateBlock
func (*LedgerAPI) GenesisMintageHash ¶ added in v1.4.0
func (*LedgerAPI) GetAccountOnlineBlock ¶ added in v1.4.0
func (*LedgerAPI) IsGenesisBlock ¶ added in v1.4.0
func (l *LedgerAPI) IsGenesisBlock(block *types.StateBlock) bool
IsGenesis check block is chain token genesis
func (*LedgerAPI) IsGenesisToken ¶ added in v1.4.0
IsGenesis check token is chain token genesis
func (*LedgerAPI) NewAccountBlock ¶ added in v1.4.0
func (*LedgerAPI) NewPending ¶ added in v1.4.0
func (*LedgerAPI) Pendings ¶ added in v1.4.0
func (l *LedgerAPI) Pendings() ([]*APIPending, error)
func (*LedgerAPI) Representatives ¶ added in v1.4.0
func (l *LedgerAPI) Representatives(sorting *bool) ([]*APIRepresentative, error)
Representatives returns a list of pairs of representative and its voting weight
func (*LedgerAPI) TokenInfoById ¶ added in v1.4.0
func (l *LedgerAPI) TokenInfoById(tokenId types.Hash) (*ApiTokenInfo, error)
func (*LedgerAPI) TokenInfoByName ¶ added in v1.4.0
func (l *LedgerAPI) TokenInfoByName(tokenName string) (*ApiTokenInfo, error)
type LedgerStatus ¶ added in v1.4.2
type MetricsApi ¶ added in v1.3.0
type MetricsApi struct {
// contains filtered or unexported fields
}
func NewMetricsApi ¶ added in v1.3.0
func NewMetricsApi() *MetricsApi
func (*MetricsApi) DiskInfo ¶ added in v1.3.0
func (m *MetricsApi) DiskInfo() (*disk.UsageStat, error)
DiskInfo get disk info
func (*MetricsApi) GetAllCPUTimeStats ¶ added in v1.3.0
func (m *MetricsApi) GetAllCPUTimeStats() ([]cpu.TimesStat, error)
GetAllCPUTimeStats get total CPU time status
func (*MetricsApi) GetCPUInfo ¶ added in v1.3.0
func (m *MetricsApi) GetCPUInfo() ([]cpu.InfoStat, error)
GetCPUInfo get cpu info by core
func (*MetricsApi) GetCPUTimeStats ¶ added in v1.3.0
func (m *MetricsApi) GetCPUTimeStats() ([]cpu.TimesStat, error)
GetCPUTimeStats get CPU time status per core
func (*MetricsApi) GetNetworkInterfaces ¶ added in v1.3.0
func (m *MetricsApi) GetNetworkInterfaces() ([]net.IOCountersStat, error)
GetNetworkInterfaces get network interface info
type MinerApi ¶ added in v1.2.3
type MinerApi struct {
// contains filtered or unexported fields
}
func NewMinerApi ¶ added in v1.2.3
func (*MinerApi) GetAvailRewardInfo ¶ added in v1.2.3
func (m *MinerApi) GetAvailRewardInfo(coinbase types.Address) (*MinerAvailRewardInfo, error)
func (*MinerApi) GetRewardData ¶ added in v1.2.3
func (m *MinerApi) GetRewardData(param *RewardParam) ([]byte, error)
func (*MinerApi) GetRewardHistory ¶ added in v1.3.0
func (m *MinerApi) GetRewardHistory(coinbase types.Address) (*MinerHistoryRewardInfo, error)
func (*MinerApi) GetRewardRecvBlock ¶ added in v1.2.3
func (m *MinerApi) GetRewardRecvBlock(input *types.StateBlock) (*types.StateBlock, error)
func (*MinerApi) GetRewardRecvBlockBySendHash ¶ added in v1.2.3
func (*MinerApi) GetRewardSendBlock ¶ added in v1.2.3
func (m *MinerApi) GetRewardSendBlock(param *RewardParam) (*types.StateBlock, error)
func (*MinerApi) UnpackRewardData ¶ added in v1.3.0
func (m *MinerApi) UnpackRewardData(data []byte) (*RewardParam, error)
type MinerAvailRewardInfo ¶ added in v1.2.3
type MinerAvailRewardInfo struct { LastEndHeight uint64 `json:"lastEndHeight"` LatestBlockHeight uint64 `json:"latestBlockHeight"` NodeRewardHeight uint64 `json:"nodeRewardHeight"` AvailStartHeight uint64 `json:"availStartHeight"` AvailEndHeight uint64 `json:"availEndHeight"` AvailRewardBlocks uint64 `json:"availRewardBlocks"` AvailRewardAmount types.Balance `json:"availRewardAmount"` NeedCallReward bool `json:"needCallReward"` }
type MinerHistoryRewardInfo ¶ added in v1.2.3
type MintageAPI ¶ added in v1.4.0
type MintageAPI struct {
// contains filtered or unexported fields
}
func NewMintageApi ¶ added in v0.0.9
func NewMintageApi(cfgFile string, l ledger.Store) *MintageAPI
func (*MintageAPI) GetMintageBlock ¶ added in v1.4.0
func (m *MintageAPI) GetMintageBlock(param *MintageParams) (*types.StateBlock, error)
func (*MintageAPI) GetMintageData ¶ added in v1.4.0
func (m *MintageAPI) GetMintageData(param *MintageParams) ([]byte, error)
func (*MintageAPI) GetRewardBlock ¶ added in v1.4.0
func (m *MintageAPI) GetRewardBlock(input *types.StateBlock) (*types.StateBlock, error)
func (*MintageAPI) GetWithdrawMintageBlock ¶ added in v1.4.0
func (m *MintageAPI) GetWithdrawMintageBlock(param *WithdrawParams) (*types.StateBlock, error)
func (*MintageAPI) GetWithdrawMintageData ¶ added in v1.4.0
func (m *MintageAPI) GetWithdrawMintageData(tokenId types.Hash) ([]byte, error)
func (*MintageAPI) GetWithdrawRewardBlock ¶ added in v1.4.0
func (m *MintageAPI) GetWithdrawRewardBlock(input *types.StateBlock) (*types.StateBlock, error)
func (*MintageAPI) ParseTokenInfo ¶ added in v1.4.0
func (p *MintageAPI) ParseTokenInfo(data []byte) (*types.TokenInfo, error)
type MintageParams ¶ added in v0.0.9
type MintageParams struct { SelfAddr types.Address `json:"selfAddr"` PrevHash types.Hash `json:"prevHash"` TokenName string `json:"tokenName"` TokenSymbol string `json:"tokenSymbol"` TotalSupply string `json:"totalSupply"` Decimals uint8 `json:"decimals"` Beneficial types.Address `json:"beneficial"` NEP5TxId string `json:"nep5TxId"` }
type NEP5PledgeAPI ¶ added in v1.4.0
type NEP5PledgeAPI struct {
// contains filtered or unexported fields
}
func NewNEP5PledgeAPI ¶ added in v1.4.0
func NewNEP5PledgeAPI(cfgFile string, l ledger.Store) *NEP5PledgeAPI
func (*NEP5PledgeAPI) GetAllPledgeInfo ¶ added in v1.4.0
func (p *NEP5PledgeAPI) GetAllPledgeInfo() ([]*NEP5PledgeInfo, error)
search all pledge info
func (*NEP5PledgeAPI) GetBeneficialPledgeInfos ¶ added in v1.4.0
func (p *NEP5PledgeAPI) GetBeneficialPledgeInfos(beneficial types.Address, pType string) (*PledgeInfos, error)
get pledge info by beneficial,pType ,return PledgeInfos
func (*NEP5PledgeAPI) GetBeneficialPledgeInfosByAddress ¶ added in v1.4.0
func (p *NEP5PledgeAPI) GetBeneficialPledgeInfosByAddress(beneficial types.Address) *PledgeInfos
get pledge info by beneficial,pType ,return PledgeInfos
func (*NEP5PledgeAPI) GetPledgeBeneficialAmount ¶ added in v1.4.0
func (p *NEP5PledgeAPI) GetPledgeBeneficialAmount(beneficial types.Address, pType string) (*big.Int, error)
search pledge info by beneficial address,pType,return total amount
func (*NEP5PledgeAPI) GetPledgeBeneficialTotalAmount ¶ added in v1.4.0
get pledge total amount by beneficial address ,return total amount
func (*NEP5PledgeAPI) GetPledgeBlock ¶ added in v1.4.0
func (p *NEP5PledgeAPI) GetPledgeBlock(param *PledgeParam) (*types.StateBlock, error)
func (*NEP5PledgeAPI) GetPledgeData ¶ added in v1.4.0
func (p *NEP5PledgeAPI) GetPledgeData(param *PledgeParam) ([]byte, error)
func (*NEP5PledgeAPI) GetPledgeInfo ¶ added in v1.4.0
func (p *NEP5PledgeAPI) GetPledgeInfo(param *WithdrawPledgeParam) ([]*NEP5PledgeInfo, error)
search pledge info by Beneficial,amount pType
func (*NEP5PledgeAPI) GetPledgeInfoWithNEP5TxId ¶ added in v1.4.0
func (p *NEP5PledgeAPI) GetPledgeInfoWithNEP5TxId(param *WithdrawPledgeParam) (*NEP5PledgeInfo, error)
search pledge info by nep5Txid
func (*NEP5PledgeAPI) GetPledgeInfoWithTimeExpired ¶ added in v1.4.0
func (p *NEP5PledgeAPI) GetPledgeInfoWithTimeExpired(param *WithdrawPledgeParam) ([]*NEP5PledgeInfo, error)
search pledge info by Beneficial,amount pType
func (*NEP5PledgeAPI) GetPledgeInfosByPledgeAddress ¶ added in v1.4.0
func (p *NEP5PledgeAPI) GetPledgeInfosByPledgeAddress(addr types.Address) *PledgeInfos
get pledge info by pledge address ,return pledgeinfos
func (*NEP5PledgeAPI) GetPledgeRewardBlock ¶ added in v1.4.0
func (p *NEP5PledgeAPI) GetPledgeRewardBlock(input *types.StateBlock) (*types.StateBlock, error)
func (*NEP5PledgeAPI) GetPledgeRewardBlockBySendHash ¶ added in v1.4.0
func (p *NEP5PledgeAPI) GetPledgeRewardBlockBySendHash(sendHash types.Hash) (*types.StateBlock, error)
func (*NEP5PledgeAPI) GetTotalPledgeAmount ¶ added in v1.4.0
func (p *NEP5PledgeAPI) GetTotalPledgeAmount() (*big.Int, error)
GetTotalPledgeAmount get all pledge amount
func (*NEP5PledgeAPI) GetWithdrawPledgeBlock ¶ added in v1.4.0
func (p *NEP5PledgeAPI) GetWithdrawPledgeBlock(param *WithdrawPledgeParam) (*types.StateBlock, error)
func (*NEP5PledgeAPI) GetWithdrawPledgeData ¶ added in v1.4.0
func (p *NEP5PledgeAPI) GetWithdrawPledgeData(param *WithdrawPledgeParam) ([]byte, error)
func (*NEP5PledgeAPI) GetWithdrawRewardBlock ¶ added in v1.4.0
func (p *NEP5PledgeAPI) GetWithdrawRewardBlock(input *types.StateBlock) (*types.StateBlock, error)
func (*NEP5PledgeAPI) GetWithdrawRewardBlockBySendHash ¶ added in v1.4.0
func (p *NEP5PledgeAPI) GetWithdrawRewardBlockBySendHash(sendHash types.Hash) (*types.StateBlock, error)
func (*NEP5PledgeAPI) ParsePledgeInfo ¶ added in v1.4.0
func (p *NEP5PledgeAPI) ParsePledgeInfo(data []byte) (*cabi.NEP5PledgeInfo, error)
type NEP5PledgeInfo ¶ added in v1.1.0
type NetApi ¶ added in v0.0.5
type NetApi struct {
// contains filtered or unexported fields
}
func (*NetApi) ConnectPeersInfo ¶ added in v1.1.1
func (*NetApi) GetAllPeersInfo ¶ added in v1.3.1
func (*NetApi) GetBandwidthStats ¶ added in v1.3.0
func (q *NetApi) GetBandwidthStats() *topic.EventBandwidthStats
func (*NetApi) GetOnlinePeersInfo ¶ added in v1.3.1
func (*NetApi) OnlineRepresentatives ¶ added in v0.0.5
func (*NetApi) OnlineRepsInfo ¶ added in v1.2.3
func (q *NetApi) OnlineRepsInfo() *OnlineRepTotal
func (*NetApi) PeersCount ¶ added in v1.3.1
type NodeStatus ¶ added in v1.4.2
type OnlineRepInfo ¶ added in v1.2.3
type OnlineRepTotal ¶ added in v1.2.3
type OnlineRepTotal struct { Reps []*OnlineRepInfo ValidVotes types.Balance ValidVotesPercent string }
type OracleParam ¶ added in v1.4.0
type PKDAvailRewardInfo ¶ added in v1.4.0
type PKDAvailRewardInfo struct { LastEndHeight uint64 `json:"lastEndHeight"` LatestBlockHeight uint64 `json:"latestBlockHeight"` NodeRewardHeight uint64 `json:"nodeRewardHeight"` AvailEndHeight uint64 `json:"availEndHeight"` AvailRewardAmount types.Balance `json:"availRewardAmount"` NeedCallReward bool `json:"needCallReward"` }
type PKDHistoryRewardInfo ¶ added in v1.4.0
type PKDRewardParam ¶ added in v1.4.0
type PKDVerifierStateList ¶ added in v1.4.0
type PKDVerifierStateList struct { VerifierNum int `json:"verifierNum"` AllVerifiers map[types.Address]*types.PovVerifierState `json:"allVerifiers"` }
type POVStatus ¶ added in v1.4.2
type POVStatus struct { PovEnabled bool `json:"povEnabled"` SyncState int `json:"syncState"` SyncStateStr string `json:"syncStateStr"` PovLedgerStats *PovLedgerStats `json:"povLedgerStats"` PovMiningInfo *PovApiGetMiningInfo `json:"povMiningInfo"` LatestHeader *PovApiHeader `json:"latestHeader"` }
type PermissionApi ¶ added in v1.4.0
type PermissionApi struct {
// contains filtered or unexported fields
}
func NewPermissionApi ¶ added in v1.4.0
func NewPermissionApi(cfgFile string, l ledger.Store) *PermissionApi
func (*PermissionApi) GetAdmin ¶ added in v1.4.0
func (p *PermissionApi) GetAdmin() (*AdminUser, error)
func (*PermissionApi) GetAdminHandoverBlock ¶ added in v1.4.0
func (p *PermissionApi) GetAdminHandoverBlock(param *AdminUpdateParam) (*types.StateBlock, error)
func (*PermissionApi) GetNode ¶ added in v1.4.0
func (p *PermissionApi) GetNode(id string) (*NodeInfo, error)
func (*PermissionApi) GetNodeUpdateBlock ¶ added in v1.4.0
func (p *PermissionApi) GetNodeUpdateBlock(param *NodeParam) (*types.StateBlock, error)
func (*PermissionApi) GetNodes ¶ added in v1.4.0
func (p *PermissionApi) GetNodes(count int, offset int) ([]*NodeInfo, error)
func (*PermissionApi) GetNodesCount ¶ added in v1.4.0
func (p *PermissionApi) GetNodesCount() int
type PledgeInfos ¶ added in v1.1.0
type PledgeInfos struct { PledgeInfo []*NEP5PledgeInfo TotalAmounts *big.Int }
type PledgeParam ¶ added in v1.1.0
type PovApi ¶ added in v1.2.3
type PovApi struct {
// contains filtered or unexported fields
}
func (*PovApi) BatchGetHeadersByHeight ¶ added in v1.2.3
func (*PovApi) CheckAllAccountStates ¶ added in v1.3.3
func (api *PovApi) CheckAllAccountStates() (*PovApiCheckStateRsp, error)
func (*PovApi) DumpBlockState ¶ added in v1.2.3
func (api *PovApi) DumpBlockState(blockHash types.Hash) (*PovApiDumpState, error)
func (*PovApi) DumpContractState ¶ added in v1.4.0
func (*PovApi) GetAccountState ¶ added in v1.2.3
func (*PovApi) GetAccountStateByBlockHash ¶ added in v1.2.3
func (*PovApi) GetAccountStateByBlockHeight ¶ added in v1.2.3
func (*PovApi) GetAllOnlineRepStates ¶ added in v1.3.0
func (api *PovApi) GetAllOnlineRepStates(header *types.PovHeader) []*types.PovRepState
func (*PovApi) GetAllRepStatesByBlockHash ¶ added in v1.3.0
func (api *PovApi) GetAllRepStatesByBlockHash(blockHash types.Hash) (*PovApiRepState, error)
func (*PovApi) GetAllRepStatesByBlockHeight ¶ added in v1.3.0
func (api *PovApi) GetAllRepStatesByBlockHeight(blockHeight uint64) (*PovApiRepState, error)
func (*PovApi) GetAllRepStatesByStateHash ¶ added in v1.3.0
func (api *PovApi) GetAllRepStatesByStateHash(stateHash types.Hash) (*PovApiRepState, error)
func (*PovApi) GetBlockByHash ¶ added in v1.2.3
func (*PovApi) GetBlockByHeight ¶ added in v1.2.3
func (*PovApi) GetBlockTDByHash ¶ added in v1.3.0
func (*PovApi) GetBlockTDByHeight ¶ added in v1.3.0
func (*PovApi) GetDiffDayStat ¶ added in v1.3.1
func (api *PovApi) GetDiffDayStat(dayIndex uint32) (*types.PovDiffDayStat, error)
func (*PovApi) GetDiffDayStatByHeight ¶ added in v1.3.1
func (api *PovApi) GetDiffDayStatByHeight(height uint64) (*types.PovDiffDayStat, error)
func (*PovApi) GetFittestHeader ¶ added in v1.2.3
func (api *PovApi) GetFittestHeader(gap uint64) (*PovApiHeader, error)
func (*PovApi) GetHashInfo ¶ added in v1.3.0
func (api *PovApi) GetHashInfo(height uint64, lookup uint64) (*PovApiHashInfo, error)
func (*PovApi) GetHeaderByHash ¶ added in v1.2.3
func (api *PovApi) GetHeaderByHash(blockHash types.Hash) (*PovApiHeader, error)
func (*PovApi) GetHeaderByHeight ¶ added in v1.2.3
func (api *PovApi) GetHeaderByHeight(height uint64) (*PovApiHeader, error)
func (*PovApi) GetLastNHourInfo ¶ added in v1.3.0
func (api *PovApi) GetLastNHourInfo(endHeight uint64, timeSpan uint32) (*PovApiGetLastNHourInfo, error)
func (*PovApi) GetLatestAccountState ¶ added in v1.2.3
func (api *PovApi) GetLatestAccountState(address types.Address) (*PovApiState, error)
func (*PovApi) GetLatestBlock ¶ added in v1.2.3
func (api *PovApi) GetLatestBlock(txOffset uint32, txLimit uint32) (*PovApiBlock, error)
func (*PovApi) GetLatestHeader ¶ added in v1.2.3
func (api *PovApi) GetLatestHeader() (*PovApiHeader, error)
func (*PovApi) GetLedgerStats ¶ added in v1.2.3
func (api *PovApi) GetLedgerStats() (*PovLedgerStats, error)
func (*PovApi) GetMinerDayStat ¶ added in v1.3.1
func (api *PovApi) GetMinerDayStat(dayIndex uint32) (*types.PovMinerDayStat, error)
func (*PovApi) GetMinerDayStatByHeight ¶ added in v1.3.1
func (api *PovApi) GetMinerDayStatByHeight(height uint64) (*types.PovMinerDayStat, error)
func (*PovApi) GetMinerStats ¶ added in v1.2.3
func (api *PovApi) GetMinerStats(addrs []types.Address) (*PovMinerStats, error)
func (*PovApi) GetMiningInfo ¶ added in v1.3.0
func (api *PovApi) GetMiningInfo() (*PovApiGetMiningInfo, error)
func (*PovApi) GetPovStatus ¶ added in v1.2.3
func (*PovApi) GetRepStatesByHeightAndAccount ¶ added in v1.3.1
func (*PovApi) GetRepStats ¶ added in v1.3.0
func (api *PovApi) GetRepStats(addrs []types.Address) (*PovRepStats, error)
func (*PovApi) GetTransaction ¶ added in v1.2.3
func (api *PovApi) GetTransaction(txHash types.Hash) (*PovApiTxLookup, error)
func (*PovApi) GetTransactionByBlockHashAndIndex ¶ added in v1.2.3
func (*PovApi) GetTransactionByBlockHeightAndIndex ¶ added in v1.2.3
func (api *PovApi) GetTransactionByBlockHeightAndIndex(height uint64, index uint32) (*PovApiTxLookup, error)
func (*PovApi) StartMining ¶ added in v1.4.0
func (*PovApi) StopMining ¶ added in v1.4.0
func (*PovApi) SubmitWork ¶ added in v1.3.0
func (api *PovApi) SubmitWork(work *PovApiSubmitWork) error
type PovApiBatchHeader ¶ added in v1.2.3
type PovApiBatchHeader struct { Count int `json:"count"` Headers []*PovApiHeader `json:"headers"` }
type PovApiBlock ¶ added in v1.2.3
type PovApiCheckStateRsp ¶ added in v1.3.3
type PovApiContractState ¶ added in v1.4.0
type PovApiDumpState ¶ added in v1.2.3
type PovApiDumpState struct { StateHash types.Hash `json:"stateHash"` Accounts map[types.Address]*types.PovAccountState `json:"accounts"` Reps map[types.Address]*types.PovRepState `json:"reps"` Contracts map[types.Address]*types.PovContractState `json:"contracts"` }
type PovApiGetLastNHourInfo ¶ added in v1.3.0
type PovApiGetLastNHourInfo struct { MaxTxPerBlock uint32 MinTxPerBlock uint32 AvgTxPerBlock uint32 MaxTxPerHour uint32 MinTxPerHour uint32 AvgTxPerHour uint32 MaxBlockPerHour uint32 MinBlockPerHour uint32 AvgBlockPerHour uint32 AllBlockNum uint32 AllTxNum uint32 Sha256dBlockNum uint32 X11BlockNum uint32 ScryptBlockNum uint32 AuxBlockNum uint32 HourItemList []*PovApiGetLastNHourItem }
type PovApiGetLastNHourItem ¶ added in v1.3.0
type PovApiGetMiningInfo ¶ added in v1.3.0
type PovApiGetMiningInfo struct { SyncState int `json:"syncState"` SyncStateStr string `json:"syncStateStr"` CurrentBlockHeight uint64 `json:"currentBlockHeight"` CurrentBlockHash types.Hash `json:"currentBlockHash"` CurrentBlockSize uint32 `json:"currentBlockSize"` CurrentBlockTx uint32 `json:"currentBlockTx"` CurrentBlockAlgo types.PovAlgoType `json:"currentBlockAlgo"` PooledTx uint32 `json:"pooledTx"` Difficulty float64 `json:"difficulty"` HashInfo *PovApiHashInfo `json:"hashInfo"` MinerAddr string `json:"minerAddr"` AlgoName string `json:"algoName"` AlgoEfficiency uint `json:"algoEfficiency"` CpuMining bool `json:"cpuMining"` }
type PovApiGetWork ¶ added in v1.3.0
type PovApiGetWork struct { WorkHash types.Hash `json:"workHash"` Version uint32 `json:"version"` Previous types.Hash `json:"previous"` Bits uint32 `json:"bits"` Height uint64 `json:"height"` MinTime uint32 `json:"minTime"` MerkleBranch []*types.Hash `json:"merkleBranch"` CoinBaseData1 types.HexBytes `json:"coinbaseData1"` CoinBaseData2 types.HexBytes `json:"coinbaseData2"` }
type PovApiHashInfo ¶ added in v1.3.0
type PovApiHeader ¶ added in v1.2.3
type PovApiKeyValPair ¶ added in v1.4.0
type PovApiRepState ¶ added in v1.3.0
type PovApiState ¶ added in v1.2.3
type PovApiState struct { AccountState *types.PovAccountState `json:"accountState"` RepState *types.PovRepState `json:"repState"` ContractState *types.PovContractState `json:"contractState"` }
type PovApiSubmitWork ¶ added in v1.3.0
type PovApiSubmitWork struct { WorkHash types.Hash `json:"workHash"` BlockHash types.Hash `json:"blockHash"` MerkleRoot types.Hash `json:"merkleRoot"` Timestamp uint32 `json:"timestamp"` Nonce uint32 `json:"nonce"` CoinbaseExtra types.HexBytes `json:"coinbaseExtra"` CoinbaseHash types.Hash `json:"coinbaseHash"` AuxPow *types.PovAuxHeader `json:"auxPow"` }
type PovApiTxLookup ¶ added in v1.2.3
type PovApiTxLookup struct { TxHash types.Hash `json:"txHash"` TxLookup *types.PovTxLookup `json:"txLookup"` CoinbaseTx *types.PovCoinBaseTx `json:"coinbaseTx"` AccountTx *types.StateBlock `json:"accountTx"` }
type PovLedgerStats ¶ added in v1.2.3
type PovMinerStatItem ¶ added in v1.2.3
type PovMinerStatItem struct { Account types.Address `json:"account"` MainBlockNum uint32 `json:"mainBlockNum"` MainRewardAmount types.Balance `json:"mainRewardAmount"` StableBlockNum uint32 `json:"stableBlockNum"` StableRewardAmount types.Balance `json:"stableRewardAmount"` FirstBlockTime time.Time `json:"firstBlockTime"` LastBlockTime time.Time `json:"lastBlockTime"` FirstBlockHeight uint64 `json:"firstBlockHeight"` LastBlockHeight uint64 `json:"lastBlockHeight"` IsHourOnline bool `json:"isHourOnline"` IsDayOnline bool `json:"isDayOnline"` }
type PovMinerStats ¶ added in v1.2.3
type PovMinerStats struct { MinerCount int `json:"minerCount"` HourOnlineCount int `json:"hourOnlineCount"` DayOnlineCount int `json:"dayOnlineCount"` MinerStats map[types.Address]*PovMinerStatItem `json:"minerStats"` TotalBlockNum uint32 `json:"totalBlockNum"` TotalRewardAmount types.Balance `json:"totalRewardAmount"` TotalMinerReward types.Balance `json:"totalMinerReward"` TotalRepReward types.Balance `json:"totalRepReward"` LatestBlockHeight uint64 `json:"latestBlockHeight"` }
type PovRepStatItem ¶ added in v1.3.1
type PovRepStatItem struct { MainBlockNum uint32 `json:"mainBlockNum"` MainRewardAmount types.Balance `json:"mainRewardAmount"` MainOnlinePeriod uint32 `json:"mainOnlinePeriod"` StableBlockNum uint32 `json:"stableBlockNum"` StableRewardAmount types.Balance `json:"stableRewardAmount"` StableOnlinePeriod uint32 `json:"stableOnlinePeriod"` LastOnlineTime time.Time `json:"lastOnlineTime"` LastOnlineHeight uint64 `json:"lastOnlineHeight"` IsOnline bool `json:"isOnline"` }
type PovRepStats ¶ added in v1.3.0
type PovRepStats struct { RepCount uint32 `json:"repCount"` RepStats map[types.Address]*PovRepStatItem `json:"repStats"` TotalBlockNum uint32 `json:"totalBlockNum"` TotalPeriod uint32 `json:"totalPeriod"` TotalRewardAmount types.Balance `json:"totalRewardAmount"` LatestBlockHeight uint64 `json:"latestBlockHeight"` }
type PovSubscriber ¶ added in v1.3.0
type PovSubscriber struct {
// contains filtered or unexported fields
}
type PovSubscription ¶ added in v1.3.0
type PovSubscription struct {
// contains filtered or unexported fields
}
PovSubscription subscript event from chain, and deliver to every connected websocket
func NewPovSubscription ¶ added in v1.3.0
func NewPovSubscription(ctx context.Context, eb event.EventBus) *PovSubscription
func (*PovSubscription) AddChan ¶ added in v1.4.0
func (r *PovSubscription) AddChan(subID string, ch chan struct{})
func (*PovSubscription) FetchBlocks ¶ added in v1.4.0
func (r *PovSubscription) FetchBlocks(subID string) []*types.PovBlock
func (*PovSubscription) RemoveChan ¶ added in v1.4.0
func (r *PovSubscription) RemoveChan(subID string)
type PrivacyApi ¶ added in v1.4.0
type PrivacyApi struct {
// contains filtered or unexported fields
}
func NewPrivacyApi ¶ added in v1.4.0
func NewPrivacyApi(cfg *config.Config, l ledger.Store, eb event.EventBus, cc *chainctx.ChainContext) *PrivacyApi
func (*PrivacyApi) DistributeRawPayload ¶ added in v1.4.0
func (api *PrivacyApi) DistributeRawPayload(param *PrivacyDistributeParam) ([]byte, error)
func (*PrivacyApi) GetBlockPrivatePayload ¶ added in v1.4.0
func (api *PrivacyApi) GetBlockPrivatePayload(blockHash types.Hash) ([]byte, error)
func (*PrivacyApi) GetDemoKV ¶ added in v1.4.0
func (api *PrivacyApi) GetDemoKV(key []byte) ([]byte, error)
GetDemoKV returns KV in PrivacyKV contract (just for demo in testnet)
func (*PrivacyApi) GetRawPayload ¶ added in v1.4.0
func (api *PrivacyApi) GetRawPayload(enclaveKey []byte) ([]byte, error)
type PrivacyDistributeParam ¶ added in v1.4.0
type PtmKeyApi ¶ added in v1.4.0
type PtmKeyApi struct {
// contains filtered or unexported fields
}
func (*PtmKeyApi) GetPtmKeyByAccount ¶ added in v1.4.0
func (p *PtmKeyApi) GetPtmKeyByAccount(account types.Address) ([]*PtmKeyUpdateParam, error)
func (*PtmKeyApi) GetPtmKeyByAccountAndBtype ¶ added in v1.4.0
func (*PtmKeyApi) GetPtmKeyDeleteBlock ¶ added in v1.4.0
func (p *PtmKeyApi) GetPtmKeyDeleteBlock(param *PtmKeyDeleteParam) (*types.StateBlock, error)
func (*PtmKeyApi) GetPtmKeyUpdateBlock ¶ added in v1.4.0
func (p *PtmKeyApi) GetPtmKeyUpdateBlock(param *PtmKeyUpdateParam) (*types.StateBlock, error)
type PtmKeyDeleteParam ¶ added in v1.4.0
type PtmKeyUpdateParam ¶ added in v1.4.0
type PublicKeyDistributionApi ¶ added in v1.4.0
type PublicKeyDistributionApi struct {
// contains filtered or unexported fields
}
func NewPublicKeyDistributionApi ¶ added in v1.4.0
func NewPublicKeyDistributionApi(cfgFile string, l ledger.Store) *PublicKeyDistributionApi
func (*PublicKeyDistributionApi) GetActiveVerifiers ¶ added in v1.4.0
func (p *PublicKeyDistributionApi) GetActiveVerifiers(vType string) ([]*VerifierRegParam, error)
func (*PublicKeyDistributionApi) GetAllVerifierStatesByBlockHeight ¶ added in v1.4.0
func (p *PublicKeyDistributionApi) GetAllVerifierStatesByBlockHeight(height uint64) (*PKDVerifierStateList, error)
func (*PublicKeyDistributionApi) GetAllVerifiers ¶ added in v1.4.0
func (p *PublicKeyDistributionApi) GetAllVerifiers() ([]*VerifierRegParam, error)
func (*PublicKeyDistributionApi) GetAvailRewardInfo ¶ added in v1.4.0
func (p *PublicKeyDistributionApi) GetAvailRewardInfo(account types.Address) (*PKDAvailRewardInfo, error)
func (*PublicKeyDistributionApi) GetOracleBlock ¶ added in v1.4.0
func (p *PublicKeyDistributionApi) GetOracleBlock(param *OracleParam) (*types.StateBlock, error)
func (*PublicKeyDistributionApi) GetOracleInfosByAccountAndType ¶ added in v1.4.0
func (p *PublicKeyDistributionApi) GetOracleInfosByAccountAndType(account types.Address, oType string) ([]*OracleParam, error)
func (*PublicKeyDistributionApi) GetOracleInfosByHash ¶ added in v1.4.0
func (p *PublicKeyDistributionApi) GetOracleInfosByHash(hash string) ([]*OracleParam, error)
func (*PublicKeyDistributionApi) GetOracleInfosByType ¶ added in v1.4.0
func (p *PublicKeyDistributionApi) GetOracleInfosByType(oType string) ([]*OracleParam, error)
func (*PublicKeyDistributionApi) GetOracleInfosByTypeAndID ¶ added in v1.4.0
func (p *PublicKeyDistributionApi) GetOracleInfosByTypeAndID(oType string, id string) ([]*OracleParam, error)
func (*PublicKeyDistributionApi) GetPubKeyByTypeAndID ¶ added in v1.4.0
func (p *PublicKeyDistributionApi) GetPubKeyByTypeAndID(pType string, pID string) ([]*PublishInfoState, error)
func (*PublicKeyDistributionApi) GetPublishBlock ¶ added in v1.4.0
func (p *PublicKeyDistributionApi) GetPublishBlock(param *PublishParam) (*PublishRet, error)
func (*PublicKeyDistributionApi) GetPublishInfosByAccountAndType ¶ added in v1.4.0
func (p *PublicKeyDistributionApi) GetPublishInfosByAccountAndType(account types.Address, pType string) ([]*PublishInfoState, error)
func (*PublicKeyDistributionApi) GetPublishInfosByType ¶ added in v1.4.0
func (p *PublicKeyDistributionApi) GetPublishInfosByType(pType string) ([]*PublishInfoState, error)
func (*PublicKeyDistributionApi) GetRecommendPubKey ¶ added in v1.4.0
func (p *PublicKeyDistributionApi) GetRecommendPubKey(pType string, pID string) (*PublishInfoState, error)
func (*PublicKeyDistributionApi) GetRewardHistory ¶ added in v1.4.0
func (p *PublicKeyDistributionApi) GetRewardHistory(account types.Address) (*PKDHistoryRewardInfo, error)
func (*PublicKeyDistributionApi) GetRewardRecvBlock ¶ added in v1.4.0
func (p *PublicKeyDistributionApi) GetRewardRecvBlock(input *types.StateBlock) (*types.StateBlock, error)
func (*PublicKeyDistributionApi) GetRewardRecvBlockBySendHash ¶ added in v1.4.0
func (p *PublicKeyDistributionApi) GetRewardRecvBlockBySendHash(sendHash types.Hash) (*types.StateBlock, error)
func (*PublicKeyDistributionApi) GetRewardSendBlock ¶ added in v1.4.0
func (p *PublicKeyDistributionApi) GetRewardSendBlock(param *PKDRewardParam) (*types.StateBlock, error)
func (*PublicKeyDistributionApi) GetUnPublishBlock ¶ added in v1.4.0
func (p *PublicKeyDistributionApi) GetUnPublishBlock(param *UnPublishParam) (*types.StateBlock, error)
func (*PublicKeyDistributionApi) GetVerifierHeartBlock ¶ added in v1.4.0
func (p *PublicKeyDistributionApi) GetVerifierHeartBlock(account types.Address, vTypes []string) (*types.StateBlock, error)
func (*PublicKeyDistributionApi) GetVerifierRegisterBlock ¶ added in v1.4.0
func (p *PublicKeyDistributionApi) GetVerifierRegisterBlock(param *VerifierRegParam) (*types.StateBlock, error)
func (*PublicKeyDistributionApi) GetVerifierStateByBlockHeight ¶ added in v1.4.0
func (p *PublicKeyDistributionApi) GetVerifierStateByBlockHeight(height uint64, address types.Address) (*types.PovVerifierState, error)
func (*PublicKeyDistributionApi) GetVerifierUnregisterBlock ¶ added in v1.4.0
func (p *PublicKeyDistributionApi) GetVerifierUnregisterBlock(param *VerifierUnRegParam) (*types.StateBlock, error)
func (*PublicKeyDistributionApi) GetVerifiersByAccount ¶ added in v1.4.0
func (p *PublicKeyDistributionApi) GetVerifiersByAccount(account types.Address) ([]*VerifierRegParam, error)
func (*PublicKeyDistributionApi) GetVerifiersByType ¶ added in v1.4.0
func (p *PublicKeyDistributionApi) GetVerifiersByType(vType string) ([]*VerifierRegParam, error)
func (*PublicKeyDistributionApi) PackRewardData ¶ added in v1.4.0
func (p *PublicKeyDistributionApi) PackRewardData(param *PKDRewardParam) ([]byte, error)
func (*PublicKeyDistributionApi) UnpackRewardData ¶ added in v1.4.0
func (p *PublicKeyDistributionApi) UnpackRewardData(data []byte) (*PKDRewardParam, error)
type PublishInfoState ¶ added in v1.4.0
type PublishInfoState struct { *PublishParam State *types.PovPublishState `json:"state"` }
type PublishParam ¶ added in v1.4.0
type PublishParam struct { Account types.Address `json:"account"` PType string `json:"type"` PID string `json:"id"` PubKey string `json:"pubKey"` KeyType string `json:"keyType"` Fee types.Balance `json:"fee"` Verifiers []types.Address `json:"verifiers"` Codes []types.Hash `json:"codes"` Hash string `json:"hash"` }
type PublishRet ¶ added in v1.4.0
type PublishRet struct { Block *types.StateBlock `json:"block"` Verifiers map[string]*VerifierContent `json:"verifiers"` }
type RepApi ¶ added in v1.3.0
type RepApi struct {
// contains filtered or unexported fields
}
func (*RepApi) GetAvailRewardInfo ¶ added in v1.3.0
func (r *RepApi) GetAvailRewardInfo(account types.Address) (*RepAvailRewardInfo, error)
func (*RepApi) GetRepStateWithHeight ¶ added in v1.3.0
func (r *RepApi) GetRepStateWithHeight(params *RepStateParams) (*types.PovRepState, error)
func (*RepApi) GetRewardData ¶ added in v1.3.0
func (r *RepApi) GetRewardData(param *RepRewardParam) ([]byte, error)
func (*RepApi) GetRewardHistory ¶ added in v1.3.0
func (r *RepApi) GetRewardHistory(account types.Address) (*RepHistoryRewardInfo, error)
func (*RepApi) GetRewardRecvBlock ¶ added in v1.3.0
func (r *RepApi) GetRewardRecvBlock(input *types.StateBlock) (*types.StateBlock, error)
func (*RepApi) GetRewardRecvBlockBySendHash ¶ added in v1.3.0
func (*RepApi) GetRewardSendBlock ¶ added in v1.3.0
func (r *RepApi) GetRewardSendBlock(param *RepRewardParam) (*types.StateBlock, error)
func (*RepApi) UnpackRewardData ¶ added in v1.3.0
func (r *RepApi) UnpackRewardData(data []byte) (*RepRewardParam, error)
type RepAvailRewardInfo ¶ added in v1.3.0
type RepAvailRewardInfo struct { LastEndHeight uint64 `json:"lastEndHeight"` LatestBlockHeight uint64 `json:"latestBlockHeight"` NodeRewardHeight uint64 `json:"nodeRewardHeight"` AvailStartHeight uint64 `json:"availStartHeight"` AvailEndHeight uint64 `json:"availEndHeight"` AvailRewardBlocks uint64 `json:"availRewardBlocks"` AvailRewardAmount types.Balance `json:"availRewardAmount"` NeedCallReward bool `json:"needCallReward"` }
type RepHistoryRewardInfo ¶ added in v1.3.0
type RepRewardParam ¶ added in v1.3.0
type RepStateParams ¶ added in v1.3.0
type RewardParam ¶ added in v1.2.3
type RewardsAPI ¶ added in v1.4.0
type RewardsAPI struct {
// contains filtered or unexported fields
}
func NewRewardsAPI ¶ added in v1.4.0
func NewRewardsAPI(l ledger.Store, cc *chainctx.ChainContext) *RewardsAPI
func (*RewardsAPI) GetConfidantRewards ¶ added in v1.4.0
func (*RewardsAPI) GetConfidantRewordsDetail ¶ added in v1.4.0
func (r *RewardsAPI) GetConfidantRewordsDetail(confidant types.Address) (map[string][]*cabi.RewardsInfo, error)
func (*RewardsAPI) GetReceiveRewardBlock ¶ added in v1.4.0
func (r *RewardsAPI) GetReceiveRewardBlock(send *types.Hash) (*types.StateBlock, error)
func (*RewardsAPI) GetRewardsDetail ¶ added in v1.4.0
func (r *RewardsAPI) GetRewardsDetail(txId string) ([]*cabi.RewardsInfo, error)
func (*RewardsAPI) GetSendConfidantBlock ¶ added in v1.4.0
func (r *RewardsAPI) GetSendConfidantBlock(param *RewardsParam, sign *types.Signature) (*types.StateBlock, error)
func (*RewardsAPI) GetSendRewardBlock ¶ added in v1.4.0
func (r *RewardsAPI) GetSendRewardBlock(param *RewardsParam, sign *types.Signature) (*types.StateBlock, error)
func (*RewardsAPI) GetTotalRewards ¶ added in v1.4.0
func (r *RewardsAPI) GetTotalRewards(txId string) (*big.Int, error)
func (*RewardsAPI) GetUnsignedConfidantData ¶ added in v1.4.0
func (r *RewardsAPI) GetUnsignedConfidantData(param *RewardsParam) (types.Hash, error)
func (*RewardsAPI) GetUnsignedRewardData ¶ added in v1.4.0
func (r *RewardsAPI) GetUnsignedRewardData(param *RewardsParam) (types.Hash, error)
func (*RewardsAPI) IsAirdropRewards ¶ added in v1.4.0
func (r *RewardsAPI) IsAirdropRewards(data []byte) bool
type RewardsParam ¶ added in v1.2.0
type UnPublishParam ¶ added in v1.4.0
type UncheckInfo ¶ added in v1.4.0
type UtilAPI ¶ added in v1.4.0
type UtilAPI struct {
// contains filtered or unexported fields
}