message

package
v0.9.0-build1 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2018 License: MIT Imports: 5 Imported by: 28

Documentation

Index

Constants

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

MemPoolSvc is exported name for MemPool service

View Source
const P2PSvc = "p2pSvc"
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")
)

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 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 {
	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
}

type ExportAccountRsp

type ExportAccountRsp struct {
	Wif []byte
	Err error
}

type FinderResult added in v0.8.1

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

type GetABI

type GetABI struct {
	Contract []byte
}

type GetABIRsp

type GetABIRsp struct {
	ABI *types.ABI
	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{}

type GetAnchorsRsp added in v0.8.1

type GetAnchorsRsp struct {
	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 {
	GetBlockInfos
	TTL time.Duration
}

type GetBlockChunksRsp added in v0.8.1

type GetBlockChunksRsp struct {
	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 {
	N int
}

GetElected is request to get voting result about top N elect

type GetHashByNo added in v0.8.2

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

type GetHashByNoRsp added in v0.8.2

type GetHashByNoRsp struct {
	BlockHash BlockHash
	Err       error
}

type GetHashes added in v0.8.1

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

type GetHashesRsp added in v0.8.1

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

type GetMetrics added in v0.8.2

type GetMetrics struct {
}

type GetMissing

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

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 GetMissingRsp struct {
	TopMatched BlockHash
	TopNumber  types.BlockNo
	StopNumber types.BlockNo
}

type GetNameInfo added in v0.9.0

type GetNameInfo struct {
	Name string
}

type GetNameInfoRsp added in v0.9.0

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

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
	// last received block notice
	LastBlks []*types.NewBlockNotice
	States   []types.PeerState
}

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 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.StateProof
	Err        error
}

type GetStateQuery added in v0.8.1

type GetStateQuery struct {
	ContractAddress []byte
	VarName         string
	VarIndex        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 {
	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 {
	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
}

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 LockAccount

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

type MapQueryMsg added in v0.9.0

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

type MapQueryRsp added in v0.9.0

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

type StartFetch struct{}

HashDownloader

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 {
	FromWho string
	Err     error
}

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
}

Directories

Path Synopsis
Code generated by mockery v1.0.0.
Code generated by mockery v1.0.0.

Jump to

Keyboard shortcuts

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