message

package
v2.5.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 20, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const AccountsSvc = "AccountsSvc"
View Source
const ChainSvc = "ChainSvc"
View Source
const MapSvc = "mapSvc"
View Source
const MaxReqestHashes = 1000
View Source
const MemPoolSvc = "MemPoolSvc"

MemPoolSvc is exported name for MemPool service

View Source
const P2PSvc = "p2pSvc"
View Source
const PolarisRPCSvc = "pRpcSvc"
View Source
const RPCSvc = "RPCSvc"
View Source
const RestSvc = "RestSvc"
View Source
const SyncerSvc = "SyncerSvc"
View Source
const Web3Svc = "web3Svc"

Variables

View Source
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")
	TooFewBlocksError    = fmt.Errorf("too few blocks received that expected")
	TooManyBlocksError   = fmt.Errorf("too many blocks received that expected")
	TooBigBlockError     = fmt.Errorf("block size limit exceeded")
	InvalidArgumentError = fmt.Errorf("invalid argument")
	WrongBlockHashError  = fmt.Errorf("wrong block hash")
)

errors which async responses of p2p actor, such as GetBlockChunksRsp, can contains,

Functions

This section is empty.

Types

type AccountRsp

type AccountRsp struct {
	Account *types.Account
	Err     error
}

type AddBlock

type AddBlock struct {
	PeerID types.PeerID
	Block  *types.Block
	Bstate interface{}
	IsSync bool
}

type AddBlockRsp

type AddBlockRsp struct {
	BlockNo   types.BlockNo
	BlockHash []byte
	Err       error
}

type BlockHash

type BlockHash []byte

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

type BlockInfosResponse struct {
	FromWhom types.PeerID
	Blocks   []*types.Block
}

BlockInfosResponse is data from other peer, as a response of types.GetBlockRequest p2p module will send this to chainservice actor.

type ChangeDesignatedPeers

type ChangeDesignatedPeers struct {
	Add    []types.PeerAddress
	Remove []types.PeerID
}

ChangeDesignatedPeers will trigger connect or disconnect peers

type CheckFeeDelegation

type CheckFeeDelegation struct {
	Payload  []byte
	Contract []byte
	Sender   []byte
	TxHash   []byte
	Amount   []byte
}

type CheckFeeDelegationRsp

type CheckFeeDelegationRsp struct {
	Err error
}

type CloseFetcher

type CloseFetcher struct {
	Seq     uint64
	FromWho string
}

type CreateAccount

type CreateAccount struct {
	Passphrase string
}

type CreateAccountRsp

type CreateAccountRsp struct {
	Account *types.Account
}

type ExportAccount

type ExportAccount struct {
	Account    *types.Account
	Pass       string
	AsKeystore bool
}

type ExportAccountRsp

type ExportAccountRsp struct {
	Wif []byte
	Err error
}

type FinderResult

type FinderResult struct {
	Seq      uint64
	Ancestor *types.BlockInfo
	Err      error
}

type GetABI

type GetABI struct {
	Contract []byte
}

type GetABIRsp

type GetABIRsp struct {
	ABI *types.ABI
	Err error
}

type GetAccountVoteRsp

type GetAccountVoteRsp struct {
	Info *types.AccountVoteInfo
	Err  error
}

type GetAccounts

type GetAccounts struct{}

type GetAccountsRsp

type GetAccountsRsp struct {
	Accounts *types.AccountList
}

type GetAddressesMsg

type GetAddressesMsg struct {
	ToWhom types.PeerID
	Size   uint32
	Offset uint32
}

GetAddressesMsg send types.AddressesRequest to dest peer. the dest peer will send types.AddressesResponse. The actor returns true if sending is successful.

type GetAncestor

type GetAncestor struct {
	Hashes   [][]byte
	StopHash []byte
}

receive from p2p

type GetAncestorRsp

type GetAncestorRsp struct {
	Ancestor *types.BlockInfo
	Err      error
}

response to p2p for GetAncestor message

type GetAnchors

type GetAnchors struct {
	Seq uint64
}

type GetAnchorsRsp

type GetAnchorsRsp struct {
	Seq    uint64
	Hashes [][]byte
	LastNo types.BlockNo
	Err    error
}

type GetBestBlock

type GetBestBlock struct{}

type GetBestBlockNo

type GetBestBlockNo struct{}

type GetBestBlockNoRsp

type GetBestBlockNoRsp struct {
	BlockNo types.BlockNo
}

type GetBestBlockRsp

type GetBestBlockRsp GetBlockRsp

type GetBlock

type GetBlock struct {
	BlockHash []byte
}

type GetBlockByNo

type GetBlockByNo struct {
	BlockNo types.BlockNo
}

type GetBlockByNoRsp

type GetBlockByNoRsp GetBlockRsp

type GetBlockChunks

type GetBlockChunks struct {
	Seq uint64
	GetBlockInfos
	TTL time.Duration
}

type GetBlockChunksRsp

type GetBlockChunksRsp struct {
	Seq    uint64
	ToWhom types.PeerID
	Blocks []*types.Block
	Err    error
}

type GetBlockHeaders

type GetBlockHeaders struct {
	ToWhom types.PeerID
	// 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 types.PeerID
	Hashes []BlockHash
}

GetBlockInfos send types.GetBlockRequest to dest peer. The actor returns true if sending is successful.

type GetBlockRsp

type GetBlockRsp struct {
	Block *types.Block
	Err   error
}

type GetCluster

type GetCluster struct {
	BestBlockHash BlockHash
	ReplyC        chan *GetClusterRsp
}

type GetClusterRsp

type GetClusterRsp struct {
	ClusterID     uint64
	ChainID       BlockHash
	Members       []*types.MemberAttr
	Err           error
	HardStateInfo *types.HardStateInfo
}

type GetElected

type GetElected struct {
	Id string
	N  uint32
}

GetElected is request to get voting result about top N elect

type GetEnterpriseConf

type GetEnterpriseConf struct {
	Key string
}

type GetEnterpriseConfRsp

type GetEnterpriseConfRsp struct {
	Conf *types.EnterpriseConfig
	Err  error
}

type GetHashByNo

type GetHashByNo struct {
	Seq     uint64
	ToWhom  types.PeerID
	BlockNo types.BlockNo
}

type GetHashByNoRsp

type GetHashByNoRsp struct {
	Seq       uint64
	BlockHash BlockHash
	Err       error
}

type GetHashes

type GetHashes struct {
	Seq      uint64
	ToWhom   types.PeerID
	PrevInfo *types.BlockInfo
	Count    uint64
}

type GetHashesRsp

type GetHashesRsp struct {
	Seq      uint64
	PrevInfo *types.BlockInfo
	Hashes   []BlockHash
	Count    uint64
	Err      error
}

type GetMetrics

type GetMetrics struct {
}

type GetNameInfo

type GetNameInfo struct {
	Name    string
	BlockNo types.BlockNo
}

type GetNameInfoRsp

type GetNameInfoRsp struct {
	Owner *types.NameInfo
	Err   error
}

type GetParams

type GetParams struct{}

type GetParamsRsp

type GetParamsRsp struct {
	BpCount      int
	MinStaking   *big.Int
	MaxBlockSize uint64
}

type GetPeers

type GetPeers struct {
	NoHidden bool
	ShowSelf bool
}

GetPeers requests p2p actor to get remote peers that is connected. The actor returns *GetPeersRsp

type GetPeersRsp

type GetPeersRsp struct {
	Peers []*PeerInfo
}

GetPeersRsp contains peer meta information and current states.

type GetQuery

type GetQuery struct {
	Contract  []byte
	Queryinfo []byte
}

type GetQueryRsp

type GetQueryRsp struct {
	Result []byte
	Err    error
}

type GetRaftTransport

type GetRaftTransport struct {
	Cluster interface{}
}

type GetReceipt

type GetReceipt struct {
	TxHash []byte
}

type GetReceiptRsp

type GetReceiptRsp struct {
	Receipt *types.Receipt
	Err     error
}

type GetReceipts added in v2.5.0

type GetReceipts struct {
	BlockHash []byte
}

type GetReceiptsByNo added in v2.5.0

type GetReceiptsByNo struct {
	BlockNo types.BlockNo
}

type GetReceiptsByNoRsp added in v2.5.0

type GetReceiptsByNoRsp GetReceiptsRsp

type GetReceiptsRsp added in v2.5.0

type GetReceiptsRsp struct {
	Receipts *types.Receipts
	Err      error
}

type GetSelf

type GetSelf struct {
}

type GetServerInfo

type GetServerInfo struct {
	Categories []string
}

GetServerInfo for RPC to collect and

type GetStaking

type GetStaking struct {
	Addr []byte
}

type GetStakingRsp

type GetStakingRsp struct {
	Staking *types.Staking
	Err     error
}

type GetState

type GetState struct {
	Account []byte
}

type GetStateAndProof

type GetStateAndProof struct {
	Account    []byte
	Root       []byte
	Compressed bool
}

type GetStateAndProofRsp

type GetStateAndProofRsp struct {
	StateProof *types.AccountProof
	Err        error
}

type GetStateQuery

type GetStateQuery struct {
	ContractAddress []byte
	StorageKeys     [][]byte
	Root            []byte
	Compressed      bool
}

type GetStateQueryRsp

type GetStateQueryRsp struct {
	Result *types.StateQueryProof
	Err    error
}

type GetStateRsp

type GetStateRsp struct {
	Account []byte
	State   *types.State
	Err     error
}

type GetSyncAncestor

type GetSyncAncestor struct {
	Seq    uint64
	ToWhom types.PeerID
	Hashes [][]byte
}

GetSyncAncestor is sent from Syncer, send types.GetAncestorRequest to dest peer.

type GetSyncAncestorRsp

type GetSyncAncestorRsp struct {
	Seq      uint64
	Ancestor *types.BlockInfo
}

GetSyncAncestorRsp is data from other peer, as a response of types.GetAncestorRequest

type GetTransactions

type GetTransactions struct {
	ToWhom types.PeerID
	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 GetTx

type GetTx struct {
	TxHash []byte
}

type GetTxRsp

type GetTxRsp struct {
	Tx    *types.Tx
	TxIds *types.TxIdx
	Err   error
}

type GetVote

type GetVote struct {
	Addr []byte
}

type GetVoteRsp

type GetVoteRsp struct {
	Top *types.VoteList
	Err error
}

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

func GetHelper

func GetHelper() Helper

type ImportAccount

type ImportAccount struct {
	Wif      []byte
	OldPass  string
	NewPass  string
	Keystore []byte
}

type ImportAccountRsp

type ImportAccountRsp struct {
	Account *types.Account
	Err     error
}

type IssueAgentCertificate

type IssueAgentCertificate struct {
	ProducerID types.PeerID
}

type ListEvents

type ListEvents struct {
	Filter *types.FilterInfo
}

type ListEventsRsp

type ListEventsRsp struct {
	Events []*types.Event
	Err    error
}

response to p2p for GetAncestor message

type LockAccount

type LockAccount struct {
	Account    *types.Account
	Passphrase string
}

type MapQueryMsg

type MapQueryMsg struct {
	Count     int
	BestBlock *types.Block
}

type MapQueryRsp

type MapQueryRsp struct {
	Peers []*types.PeerAddress
	Err   error
}

type MemPoolDel

type MemPoolDel struct {
	Block *types.Block
}

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 MemPoolDelTx

type MemPoolDelTx struct {
	Tx *types.Tx
}

MemPoolDelTx is interface of MemPool service for deleting a transaction

type MemPoolDelTxRsp

type MemPoolDelTxRsp struct {
	Err error
}

MemPoolDelTxRsp defines struct of result for MemPoolDelTx

type MemPoolEnableWhitelist

type MemPoolEnableWhitelist struct {
	On bool
}

type MemPoolExist

type MemPoolExist struct {
	Hash []byte
}

MemPoolExist is interface of MemPool service for retrieving transaction according to given hash

type MemPoolExistEx

type MemPoolExistEx struct {
	Hashes [][]byte
}

MemPoolExistEx is for getting retrieving multiple transactions.

type MemPoolExistExRsp

type MemPoolExistExRsp struct {
	Txs []*types.Tx
}

MemPoolExistExRsp can contains nil element if requested tx is missing in mempool.

type MemPoolExistRsp

type MemPoolExistRsp struct {
	Tx *types.Tx
}

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

type MemPoolGetRsp struct {
	Txs []types.Transaction
	Err error
}

MemPoolGetRsp defines struct of result for MemPoolGet

type MemPoolList

type MemPoolList struct {
	Limit int
}

MemPoolList is interface of MemPool service for retrieving hashes of transactions

type MemPoolListRsp

type MemPoolListRsp struct {
	Hashes  []types.TxID
	HasMore bool
}

type MemPoolPut

type MemPoolPut struct {
	Tx *types.Tx
}

MemPoolPut is interface of MemPool service for inserting transactions

type MemPoolPutRsp

type MemPoolPutRsp struct {
	Err error
}

MemPoolPutRsp defines struct of result for MemPoolPut

type MemPoolSetWhitelist

type MemPoolSetWhitelist struct {
	Accounts []string
}

type MemPoolTx

type MemPoolTx struct {
	Accounts []types.Address
}

type MemPoolTxRsp

type MemPoolTxRsp MemPoolTxStatRsp

type MemPoolTxStat

type MemPoolTxStat struct {
}

type MemPoolTxStatRsp

type MemPoolTxStatRsp struct {
	Data []byte
}

type NotifyCertRenewed

type NotifyCertRenewed struct {
	Cert *types.AgentCertificate
}

type NotifyNewBlock

type NotifyNewBlock struct {
	Produced bool
	BlockNo  uint64
	Block    *types.Block
}

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

type NotifyNewTransactions struct {
	Txs []*types.Tx
}

NotifyNewTransactions send types.NewTransactionsNotice to other peers. The actor returns true if sending is successful.

type P2PWhiteListConfEnableEvent

type P2PWhiteListConfEnableEvent struct {
	Name string
	On   bool
}

type P2PWhiteListConfSetEvent

type P2PWhiteListConfSetEvent struct {
	Name   string
	Values []string
}

type PeerInfo

type PeerInfo struct {
	Addr            *types.PeerAddress
	Certificates    []*types.AgentCertificate
	AcceptedRole    types.PeerRole
	Version         string
	Hidden          bool
	CheckTime       time.Time
	LastBlockHash   []byte
	LastBlockNumber uint64
	State           types.PeerState
	Self            bool
}

type PingMsg

type PingMsg struct {
	ToWhom types.PeerID
}

PingMsg send types.Ping to each peer. The actor returns true if sending is successful.

type RaftClusterEvent

type RaftClusterEvent struct {
	BPAdded   []types.PeerID
	BPRemoved []types.PeerID
}

type SendRaft

type SendRaft struct {
	ToWhom types.PeerID
	Body   interface{} // for avoiding dependency cycle, though it must be raftpb.Message.
}

type SendRaftRsp

type SendRaftRsp struct {
	Err error
}

type SignTx

type SignTx struct {
	Tx        *types.Tx
	Requester []byte
}

type SignTxRsp

type SignTxRsp struct {
	Tx  *types.Tx
	Err error
}

type SyncBlockState

type SyncBlockState struct {
	PeerID    types.PeerID
	BlockNo   types.BlockNo
	BlockHash []byte
}

SyncBlockState is request to sync from remote peer. It returns sync result.

type SyncStart

type SyncStart struct {
	PeerID   types.PeerID
	TargetNo types.BlockNo
	NotifyC  chan error
}

Syncer

type SyncStop

type SyncStop struct {
	Seq     uint64
	FromWho string
	Err     error
}

HashDownloader

type TXHash

type TXHash []byte

type TossBPNotice

type TossBPNotice struct {
	Block *types.Block
	// toss notice to internal zone or not
	TossIn bool
	// OriginalMsg is actually p2pcommon.Message. it is declared by interface{} for ad-hoc way to avoid import cycle
	OriginalMsg interface{}
}

type TossDirection

type TossDirection bool

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.

type UnlockAccount

type UnlockAccount struct {
	Account    *types.Account
	Passphrase string
}

type VerifyStart

type VerifyStart struct{}

type VerifyTx

type VerifyTx struct {
	Tx *types.Tx
}

type VerifyTxRsp

type VerifyTxRsp struct {
	Tx  *types.Tx
	Err error
}

Directories

Path Synopsis
Package messagemock is a generated GoMock package.
Package messagemock is a generated GoMock package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL