Documentation ¶
Index ¶
- Constants
- Variables
- type AccountRsp
- type AddBlock
- type AddBlockRsp
- type BlockHash
- type BlockHeadersResponse
- type BlockInfosResponse
- type CloseFetcher
- type CreateAccount
- type CreateAccountRsp
- type ExportAccount
- type ExportAccountRsp
- type FinderResult
- type GetABI
- type GetABIRsp
- type GetAccounts
- type GetAccountsRsp
- type GetAddressesMsg
- type GetAncestor
- type GetAncestorRsp
- type GetAnchors
- type GetAnchorsRsp
- type GetBestBlock
- type GetBestBlockNo
- type GetBestBlockNoRsp
- type GetBestBlockRsp
- type GetBlock
- type GetBlockByNo
- type GetBlockByNoRsp
- type GetBlockChunks
- type GetBlockChunksRsp
- type GetBlockHeaders
- type GetBlockInfos
- type GetBlockRsp
- type GetElected
- type GetHashByNo
- type GetHashByNoRsp
- type GetHashes
- type GetHashesRsp
- type GetMetrics
- type GetMissing
- type GetMissingBlocks
- type GetMissingRsp
- type GetNameInfo
- type GetNameInfoRsp
- type GetPeers
- type GetPeersRsp
- type GetQuery
- type GetQueryRsp
- type GetReceipt
- type GetReceiptRsp
- type GetStaking
- type GetStakingRsp
- type GetState
- type GetStateAndProof
- type GetStateAndProofRsp
- type GetStateQuery
- type GetStateQueryRsp
- type GetStateRsp
- type GetSyncAncestor
- type GetSyncAncestorRsp
- type GetTransactions
- type GetTx
- type GetTxRsp
- type GetVote
- type GetVoteRsp
- type Helper
- type ImportAccount
- type ImportAccountRsp
- type LockAccount
- type MapQueryMsg
- type MapQueryRsp
- type MemPoolDel
- type MemPoolDelRsp
- type MemPoolExist
- type MemPoolExistRsp
- type MemPoolGet
- type MemPoolGetRsp
- type MemPoolPut
- type MemPoolPutRsp
- type NotifyNewBlock
- type NotifyNewTransactions
- type PingMsg
- type SignTx
- type SignTxRsp
- type StartFetch
- type SyncBlockState
- type SyncStart
- type SyncStop
- type TXHash
- type TransactionsResponse
- type UnlockAccount
- type VerifyTx
- type VerifyTxRsp
Constants ¶
const AccountsSvc = "AccountsSvc"
const ChainSvc = "ChainSvc"
const MapSvc = "mapSvc"
const MemPoolSvc = "MemPoolSvc"
MemPoolSvc is exported name for MemPool service
const P2PSvc = "p2pSvc"
const RPCSvc = "RPCSvc"
const RestSvc = "RestSvc"
const SyncerSvc = "SyncerSvc"
Variables ¶
var ( RemotePeerFailError = fmt.Errorf("remote peer return error") PeerNotFoundError = fmt.Errorf("remote peer was not found") MissingHashError = fmt.Errorf("some block hash not found") UnexpectedBlockError = fmt.Errorf("unexpected blocks response") )
errors which async responses of p2p actor, such as GetBlockChunksRsp, can contains,
Functions ¶
This section is empty.
Types ¶
type AccountRsp ¶
type BlockHeadersResponse ¶
type BlockHeadersResponse struct { Hashes []BlockHash Headers []*types.BlockHeader }
BlockHeadersResponse is data from other peer, as a response of types.GetBlockRequest p2p module will send this to chainservice actor.
type BlockInfosResponse ¶
BlockInfosResponse is data from other peer, as a response of types.GetBlockRequest p2p module will send this to chainservice actor.
type CloseFetcher ¶ added in v0.8.1
type CloseFetcher struct {
FromWho string
}
type CreateAccount ¶
type CreateAccount struct {
Passphrase string
}
type CreateAccountRsp ¶
type ExportAccount ¶
type ExportAccountRsp ¶
type FinderResult ¶ added in v0.8.1
type GetAccounts ¶
type GetAccounts struct{}
type GetAccountsRsp ¶
type GetAccountsRsp struct {
Accounts *types.AccountList
}
type GetAddressesMsg ¶
GetAddressesMsg send types.AddressesRequest to dest peer. the dest peer will send types.AddressesResponse. The actor returns true if sending is successful.
type GetAncestor ¶ added in v0.8.1
receive from p2p
type GetAncestorRsp ¶ added in v0.8.1
response to p2p for GetAncestor message
type GetAnchors ¶ added in v0.8.1
type GetAnchors struct{}
type GetAnchorsRsp ¶ added in v0.8.1
type GetBestBlock ¶
type GetBestBlock struct{}
type GetBestBlockNo ¶
type GetBestBlockNo struct{}
type GetBestBlockNoRsp ¶
type GetBestBlockRsp ¶
type GetBestBlockRsp GetBlockRsp
type GetBlockByNo ¶
type GetBlockByNoRsp ¶
type GetBlockByNoRsp GetBlockRsp
type GetBlockChunks ¶ added in v0.8.1
type GetBlockChunks struct { GetBlockInfos TTL time.Duration }
type GetBlockChunksRsp ¶ added in v0.8.1
type GetBlockHeaders ¶
type GetBlockHeaders struct { ToWhom peer.ID // Hash is the first block to get. Height will be used when Hash mi empty Hash BlockHash Height uint64 Asc bool Offset uint64 MaxSize uint32 }
GetBlockHeaders send type.GetBlockRequest to dest peer The actor returns true if sending is successful.
type GetBlockInfos ¶
type GetBlockInfos struct { ToWhom peer.ID Hashes []BlockHash }
GetBlockInfos send types.GetBlockRequest to dest peer. The actor returns true if sending is successful.
type GetBlockRsp ¶
type GetElected ¶
type GetElected struct {
N int
}
GetElected is request to get voting result about top N elect
type GetHashByNo ¶ added in v0.8.2
type GetHashByNoRsp ¶ added in v0.8.2
type GetHashesRsp ¶ added in v0.8.1
type GetMetrics ¶ added in v0.8.2
type GetMetrics struct { }
type GetMissing ¶
type GetMissingBlocks ¶
type GetMissingBlocks struct { ToWhom peer.ID Hashes []BlockHash }
GetMissingBlocks send types.GetMissingRequest to dest peer. The actor returns true if sending is successful. Not used (need to be async operation)
type GetMissingRsp ¶
type GetNameInfo ¶ added in v0.9.4
type GetNameInfo struct {
Name string
}
type GetNameInfoRsp ¶ added in v0.9.4
type GetPeers ¶
type GetPeers struct { }
GetPeers requests p2p actor to get remote peers that is connected. The actor returns *GetPeersRsp
type GetPeersRsp ¶
type GetPeersRsp struct { Peers []*types.PeerAddress Hiddens []bool // last received block notice LastBlks []*types.NewBlockNotice States []types.PeerState }
GetPeersRsp contains peer meta information and current states.
type GetQueryRsp ¶
type GetReceipt ¶
type GetReceipt struct {
TxHash []byte
}
type GetReceiptRsp ¶
type GetStaking ¶ added in v0.8.1
type GetStaking struct {
Addr []byte
}
type GetStakingRsp ¶ added in v0.8.1
type GetStateAndProof ¶
type GetStateAndProofRsp ¶
type GetStateAndProofRsp struct { StateProof *types.StateProof Err error }
type GetStateQuery ¶ added in v0.8.1
type GetStateQueryRsp ¶ added in v0.8.1
type GetStateQueryRsp struct { Result *types.StateQueryProof Err error }
type GetSyncAncestor ¶ added in v0.8.1
type GetSyncAncestor struct { ToWhom peer.ID Hashes [][]byte }
GetSyncAncestor is sent from Syncer, send types.GetAncestorRequest to dest peer.
type GetSyncAncestorRsp ¶ added in v0.8.1
GetSyncAncestorRsp is data from other peer, as a response of types.GetAncestorRequest
type GetTransactions ¶
type GetTransactions struct { ToWhom peer.ID Hashes []TXHash }
GetTransactions send types.GetTransactionsRequest to dest peer. The receiving peer will send types.GetTransactionsResponse The actor returns true if sending is successful.
type GetVoteRsp ¶
GetElectedRsp is return to get voting result
type Helper ¶
type Helper interface { // ExtractBlockFromResponseAndError get rawResponse and error and return pointer of Block ExtractBlockFromResponseAndError(rawResponse interface{}, err error) (*types.Block, error) ExtractBlockFromResponse(rawResponse interface{}) (*types.Block, error) ExtractTxFromResponseAndError(rawResponse interface{}, err error) (*types.Tx, error) ExtractTxFromResponse(rawResponse interface{}) (*types.Tx, error) ExtractTxsFromResponseAndError(rawResponse interface{}, err error) ([]*types.Tx, error) ExtractTxsFromResponse(rawResponse interface{}) ([]*types.Tx, error) }
Helper is helper interface for extracting tx or block from actor response
type ImportAccount ¶
type ImportAccountRsp ¶
type LockAccount ¶
type MapQueryMsg ¶ added in v0.9.4
type MapQueryRsp ¶ added in v0.9.4
type MapQueryRsp struct { Peers []*types.PeerAddress Err error }
type MemPoolDel ¶
MemPoolDel is interface of MemPool service for deleting transactions including given transactions
type MemPoolDelRsp ¶
type MemPoolDelRsp struct {
Err error
}
MemPoolDelRsp defines struct of result for MemPoolDel
type MemPoolExist ¶
type MemPoolExist struct {
Hash []byte
}
MemPoolExist is interface of MemPool service for retrieving transaction according to given hash
type MemPoolExistRsp ¶
MemPoolExistRsp defines struct of result for MemPoolExist
type MemPoolGet ¶
type MemPoolGet struct {
MaxBlockBodySize uint32
}
MemPoolGet is interface of MemPool service for retrieving transactions
type MemPoolGetRsp ¶
MemPoolGetRsp defines struct of result for MemPoolGet
type MemPoolPut ¶
MemPoolPut is interface of MemPool service for inserting transactions
type MemPoolPutRsp ¶
type MemPoolPutRsp struct {
Err error
}
MemPoolPutRsp defines struct of result for MemPoolPut
type NotifyNewBlock ¶
NotifyNewBlock send types.NewBlockNotice to other peers. The receiving peer will send GetBlockHeadersRequest or GetBlockRequest if needed. The actor returns true if sending is successful.
type NotifyNewTransactions ¶
NotifyNewTransactions send types.NewTransactionsNotice to other peers. The actor returns true if sending is successful.
type PingMsg ¶
type PingMsg struct {
ToWhom peer.ID
}
PingMsg send types.Ping to each peer. The actor returns true if sending is successful.
type SyncBlockState ¶
SyncBlockState is request to sync from remote peer. It returns sync result.
type TransactionsResponse ¶
type TransactionsResponse struct {
// contains filtered or unexported fields
}
TransactionsResponse is data from other peer, as a response of types.GetTransactionsRequest p2p module will send this to mempool actor.