message

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: May 22, 2019 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 PolarisSvc = "polarisSvc"
View Source
const RPCSvc = "RPCSvc"
View Source
const RestSvc = "RestSvc"
View Source
const SyncerSvc = "SyncerSvc"

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")
)

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 peer.ID
	Block  *types.Block
	Bstate interface{}
	IsSync bool
}

type AddBlockRsp

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

type BlackListMsg added in v0.10.0

type BlackListMsg PaginationMsg

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 peer.ID
	Blocks   []*types.Block
}

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 {
	Seq     uint64
	FromWho string
}

type CreateAccount

type CreateAccount struct {
	Passphrase string
}

type CreateAccountRsp

type CreateAccountRsp struct {
	Account *types.Account
}

type CurrentListMsg added in v0.10.0

type CurrentListMsg PaginationMsg

type ExportAccount

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

type ExportAccountRsp

type ExportAccountRsp struct {
	Wif []byte
	Err error
}

type FinderResult added in v0.8.1

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 added in v1.0.0

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 peer.ID
	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 added in v0.8.1

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

receive from p2p

type GetAncestorRsp added in v0.8.1

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

response to p2p for GetAncestor message

type GetAnchors added in v0.8.1

type GetAnchors struct {
	Seq uint64
}

type GetAnchorsRsp added in v0.8.1

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 added in v0.8.1

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

type GetBlockChunksRsp added in v0.8.1

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

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 GetBlockRsp struct {
	Block *types.Block
	Err   error
}

type GetElected

type GetElected struct {
	Id string
	N  uint32
}

GetElected is request to get voting result about top N elect

type GetHashByNo added in v0.8.2

type GetHashByNo struct {
	Seq     uint64
	ToWhom  peer.ID
	BlockNo types.BlockNo
}

type GetHashByNoRsp added in v0.8.2

type GetHashByNoRsp struct {
	Seq       uint64
	BlockHash BlockHash
	Err       error
}

type GetHashes added in v0.8.1

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

type GetHashesRsp added in v0.8.1

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

type GetMetrics added in v0.8.2

type GetMetrics struct {
}

type GetNameInfo added in v0.9.4

type GetNameInfo struct {
	Name string
}

type GetNameInfoRsp added in v0.9.4

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

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 GetReceipt

type GetReceipt struct {
	TxHash []byte
}

type GetReceiptRsp

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

type GetSelf added in v1.0.0

type GetSelf struct {
}

type GetServerInfo added in v1.0.0

type GetServerInfo struct {
	Categories []string
}

GetServerInfo for RPC to collect and

type GetStaking added in v0.8.1

type GetStaking struct {
	Addr []byte
}

type GetStakingRsp added in v0.8.1

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 added in v0.8.1

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

type GetStateQueryRsp added in v0.8.1

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

type GetStateRsp

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

type GetSyncAncestor added in v0.8.1

type GetSyncAncestor struct {
	Seq    uint64
	ToWhom peer.ID
	Hashes [][]byte
}

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

type GetSyncAncestorRsp added in v0.8.1

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 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 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
	Ids  []string
}

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
}

type ImportAccountRsp

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

type ListEvents added in v0.12.0

type ListEvents struct {
	Filter *types.FilterInfo
}

type ListEventsRsp added in v0.12.0

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 added in v0.9.4

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

type MapQueryRsp added in v0.9.4

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 MemPoolExist

type MemPoolExist struct {
	Hash []byte
}

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

type MemPoolExistEx added in v0.11.0

type MemPoolExistEx struct {
	Hashes [][]byte
}

type MemPoolExistExRsp added in v0.11.0

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

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 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 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 PaginationMsg added in v0.10.0

type PaginationMsg struct {
	ReferenceHash []byte
	Size          uint32
}

type PeerInfo added in v0.11.0

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

type PingMsg

type PingMsg struct {
	ToWhom peer.ID
}

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

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    peer.ID
	BlockNo   types.BlockNo
	BlockHash []byte
}

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

type SyncStart added in v0.8.1

type SyncStart struct {
	PeerID   peer.ID
	TargetNo types.BlockNo
}

Syncer

type SyncStop added in v0.8.1

type SyncStop struct {
	Seq     uint64
	FromWho string
	Err     error
}

HashDownloader

type TXHash

type TXHash []byte

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 VerifyTx

type VerifyTx struct {
	Tx *types.Tx
}

type VerifyTxRsp

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

type WhiteListMsg added in v0.10.0

type WhiteListMsg PaginationMsg

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