Documentation ¶
Index ¶
- type AccountRange
- type BlockBodies
- type BlockHeaders
- type ByteCodes
- type Chain
- func (c *Chain) ForkID() forkid.ID
- func (c *Chain) GetHeaders(req *GetBlockHeaders) ([]*types.Header, error)
- func (c *Chain) Head() *types.Block
- func (c *Chain) Len() int
- func (c *Chain) RootAt(height int) common.Hash
- func (c *Chain) Shorten(height int) *Chain
- func (c *Chain) TD() *big.Int
- func (c *Chain) TotalDifficultyAt(height int) *big.Int
- type Conn
- type Disconnect
- type Error
- type GetAccountRange
- type GetBlockBodies
- type GetBlockHeaders
- type GetByteCodes
- type GetPooledTransactions
- type GetStorageRanges
- type GetTrieNodes
- type Hello
- type Message
- type NewBlock
- type NewBlockHashes
- type NewPooledTransactionHashes
- type NewPooledTransactionHashes66
- type Ping
- type Pong
- type PooledTransactions
- type Status
- type StorageRanges
- type Suite
- func (s *Suite) EthTests() []utesting.Test
- func (s *Suite) SnapTests() []utesting.Test
- func (s *Suite) TestBlockHashAnnounce(t *utesting.T)
- func (s *Suite) TestBroadcast(t *utesting.T)
- func (s *Suite) TestGetBlockBodies(t *utesting.T)
- func (s *Suite) TestGetBlockHeaders(t *utesting.T)
- func (s *Suite) TestLargeAnnounce(t *utesting.T)
- func (s *Suite) TestLargeTxRequest(t *utesting.T)
- func (s *Suite) TestMaliciousHandshake(t *utesting.T)
- func (s *Suite) TestMaliciousStatus(t *utesting.T)
- func (s *Suite) TestMaliciousTx(t *utesting.T)
- func (s *Suite) TestNewPooledTxs(t *utesting.T)
- func (s *Suite) TestOldAnnounce(t *utesting.T)
- func (s *Suite) TestSameRequestID(t *utesting.T)
- func (s *Suite) TestSimultaneousRequests(t *utesting.T)
- func (s *Suite) TestSnapGetAccountRange(t *utesting.T)
- func (s *Suite) TestSnapGetByteCodes(t *utesting.T)
- func (s *Suite) TestSnapGetStorageRanges(t *utesting.T)
- func (s *Suite) TestSnapStatus(t *utesting.T)
- func (s *Suite) TestSnapTrieNodes(t *utesting.T)
- func (s *Suite) TestStatus(t *utesting.T)
- func (s *Suite) TestTransaction(t *utesting.T)
- func (s *Suite) TestZeroRequestID(t *utesting.T)
- type Transactions
- type TrieNodes
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountRange ¶ added in v1.8.0
type AccountRange snap.AccountRangePacket
func (AccountRange) Code ¶ added in v1.8.0
func (msg AccountRange) Code() int
func (AccountRange) ReqID ¶ added in v1.8.0
func (msg AccountRange) ReqID() uint64
type BlockBodies ¶
type BlockBodies eth.BlockBodiesPacket66
BlockBodies is the network packet for block content distribution.
func (BlockBodies) Code ¶
func (msg BlockBodies) Code() int
func (BlockBodies) ReqID ¶ added in v1.8.0
func (msg BlockBodies) ReqID() uint64
type BlockHeaders ¶
type BlockHeaders eth.BlockHeadersPacket66
func (BlockHeaders) Code ¶
func (msg BlockHeaders) Code() int
func (BlockHeaders) ReqID ¶ added in v1.8.0
func (msg BlockHeaders) ReqID() uint64
type ByteCodes ¶ added in v1.8.0
type ByteCodes snap.ByteCodesPacket
type Chain ¶
type Chain struct {
// contains filtered or unexported fields
}
func (*Chain) GetHeaders ¶
func (c *Chain) GetHeaders(req *GetBlockHeaders) ([]*types.Header, error)
type Conn ¶
Conn represents an individual connection with a peer
type Disconnect ¶
type Disconnect struct {
Reason p2p.DiscReason
}
Disconnect is the RLP structure for a disconnect message.
func (Disconnect) Code ¶
func (msg Disconnect) Code() int
func (Disconnect) ReqID ¶ added in v1.8.0
func (msg Disconnect) ReqID() uint64
type GetAccountRange ¶ added in v1.8.0
type GetAccountRange snap.GetAccountRangePacket
GetAccountRange represents an account range query.
func (GetAccountRange) Code ¶ added in v1.8.0
func (msg GetAccountRange) Code() int
func (GetAccountRange) ReqID ¶ added in v1.8.0
func (msg GetAccountRange) ReqID() uint64
type GetBlockBodies ¶
type GetBlockBodies eth.GetBlockBodiesPacket66
GetBlockBodies represents a GetBlockBodies request
func (GetBlockBodies) Code ¶
func (msg GetBlockBodies) Code() int
func (GetBlockBodies) ReqID ¶ added in v1.8.0
func (msg GetBlockBodies) ReqID() uint64
type GetBlockHeaders ¶
type GetBlockHeaders eth.GetBlockHeadersPacket66
GetBlockHeaders represents a block header query.
func (GetBlockHeaders) Code ¶
func (msg GetBlockHeaders) Code() int
func (GetBlockHeaders) ReqID ¶ added in v1.8.0
func (msg GetBlockHeaders) ReqID() uint64
type GetByteCodes ¶ added in v1.8.0
type GetByteCodes snap.GetByteCodesPacket
func (GetByteCodes) Code ¶ added in v1.8.0
func (msg GetByteCodes) Code() int
func (GetByteCodes) ReqID ¶ added in v1.8.0
func (msg GetByteCodes) ReqID() uint64
type GetPooledTransactions ¶
type GetPooledTransactions eth.GetPooledTransactionsPacket66
func (GetPooledTransactions) Code ¶
func (msg GetPooledTransactions) Code() int
func (GetPooledTransactions) ReqID ¶ added in v1.8.0
func (msg GetPooledTransactions) ReqID() uint64
type GetStorageRanges ¶ added in v1.8.0
type GetStorageRanges snap.GetStorageRangesPacket
func (GetStorageRanges) Code ¶ added in v1.8.0
func (msg GetStorageRanges) Code() int
func (GetStorageRanges) ReqID ¶ added in v1.8.0
func (msg GetStorageRanges) ReqID() uint64
type GetTrieNodes ¶ added in v1.8.0
type GetTrieNodes snap.GetTrieNodesPacket
func (GetTrieNodes) Code ¶ added in v1.8.0
func (msg GetTrieNodes) Code() int
func (GetTrieNodes) ReqID ¶ added in v1.8.0
func (msg GetTrieNodes) ReqID() uint64
type Hello ¶
type Hello struct { Version uint64 Name string Caps []p2p.Cap ListenPort uint64 ID []byte // secp256k1 public key // Ignore additional fields (for forward compatibility). Rest []rlp.RawValue `rlp:"tail"` }
Hello is the RLP structure of the protocol handshake.
type NewBlock ¶
type NewBlock eth.NewBlockPacket
NewBlock is the network packet for the block propagation message.
type NewBlockHashes ¶
type NewBlockHashes eth.NewBlockHashesPacket
NewBlockHashes is the network packet for the block announcements.
func (NewBlockHashes) Code ¶
func (msg NewBlockHashes) Code() int
func (NewBlockHashes) ReqID ¶ added in v1.8.0
func (msg NewBlockHashes) ReqID() uint64
type NewPooledTransactionHashes ¶
type NewPooledTransactionHashes eth.NewPooledTransactionHashesPacket68
NewPooledTransactionHashes is the network packet for the tx hash propagation message.
func (NewPooledTransactionHashes) Code ¶
func (msg NewPooledTransactionHashes) Code() int
func (NewPooledTransactionHashes) ReqID ¶ added in v1.8.0
func (msg NewPooledTransactionHashes) ReqID() uint64
type NewPooledTransactionHashes66 ¶ added in v1.8.0
type NewPooledTransactionHashes66 eth.NewPooledTransactionHashesPacket66
NewPooledTransactionHashes66 is the network packet for the tx hash propagation message.
func (NewPooledTransactionHashes66) Code ¶ added in v1.8.0
func (msg NewPooledTransactionHashes66) Code() int
func (NewPooledTransactionHashes66) ReqID ¶ added in v1.8.0
func (msg NewPooledTransactionHashes66) ReqID() uint64
type PooledTransactions ¶
type PooledTransactions eth.PooledTransactionsPacket66
func (PooledTransactions) Code ¶
func (msg PooledTransactions) Code() int
func (PooledTransactions) ReqID ¶ added in v1.8.0
func (msg PooledTransactions) ReqID() uint64
type Status ¶
type Status eth.StatusPacket
Status is the network packet for the status message for eth/64 and later.
type StorageRanges ¶ added in v1.8.0
type StorageRanges snap.StorageRangesPacket
func (StorageRanges) Code ¶ added in v1.8.0
func (msg StorageRanges) Code() int
func (StorageRanges) ReqID ¶ added in v1.8.0
func (msg StorageRanges) ReqID() uint64
type Suite ¶
Suite represents a structure used to test a node's conformance to the eth protocol.
func NewSuite ¶
NewSuite creates and returns a new eth-test suite that can be used to test the given node against the given blockchain data.
func (*Suite) TestBlockHashAnnounce ¶ added in v1.8.0
TestBlockHashAnnounce sends a new block hash announcement and expects the node to perform a `GetBlockHeaders` request.
func (*Suite) TestBroadcast ¶
TestBroadcast tests whether a block announcement is correctly propagated to the node's peers.
func (*Suite) TestGetBlockBodies ¶
TestGetBlockBodies tests whether the given node can respond to a `GetBlockBodies` request and that the response is accurate.
func (*Suite) TestGetBlockHeaders ¶
TestGetBlockHeaders tests whether the given node can respond to an eth `GetBlockHeaders` request and that the response is accurate.
func (*Suite) TestLargeAnnounce ¶
TestLargeAnnounce tests the announcement mechanism with a large block.
func (*Suite) TestLargeTxRequest ¶ added in v1.8.0
TestLargeTxRequest tests whether a node can fulfill a large GetPooledTransactions request.
func (*Suite) TestMaliciousHandshake ¶
TestMaliciousHandshake tries to send malicious data during the handshake.
func (*Suite) TestMaliciousStatus ¶
TestMaliciousStatus sends a status package with a large total difficulty.
func (*Suite) TestMaliciousTx ¶
TestMaliciousTx sends several invalid transactions and tests whether the node will propagate them.
func (*Suite) TestNewPooledTxs ¶ added in v1.8.0
TestNewPooledTxs tests whether a node will do a GetPooledTransactions request upon receiving a NewPooledTransactionHashes announcement.
func (*Suite) TestOldAnnounce ¶
TestOldAnnounce tests the announcement mechanism with an old block.
func (*Suite) TestSameRequestID ¶ added in v1.8.0
TestSameRequestID sends two requests with the same request ID to a single node.
func (*Suite) TestSimultaneousRequests ¶ added in v1.8.0
TestSimultaneousRequests sends two simultaneous `GetBlockHeader` requests from the same connection with different request IDs and checks to make sure the node responds with the correct headers per request.
func (*Suite) TestSnapGetAccountRange ¶ added in v1.8.0
TestSnapGetAccountRange various forms of GetAccountRange requests.
func (*Suite) TestSnapGetByteCodes ¶ added in v1.8.0
TestSnapGetByteCodes various forms of GetByteCodes requests.
func (*Suite) TestSnapGetStorageRanges ¶ added in v1.8.0
TestSnapGetStorageRanges various forms of GetStorageRanges requests.
func (*Suite) TestSnapStatus ¶ added in v1.8.0
func (*Suite) TestSnapTrieNodes ¶ added in v1.8.0
TestSnapTrieNodes various forms of GetTrieNodes requests.
func (*Suite) TestStatus ¶
TestStatus attempts to connect to the given node and exchange a status message with it on the eth protocol.
func (*Suite) TestTransaction ¶
TestTransaction sends a valid transaction to the node and checks if the transaction gets propagated.
func (*Suite) TestZeroRequestID ¶ added in v1.8.0
TestZeroRequestID checks that a message with a request ID of zero is still handled by the node.
type Transactions ¶
type Transactions eth.TransactionsPacket
func (Transactions) Code ¶
func (msg Transactions) Code() int
func (Transactions) ReqID ¶ added in v1.8.0
func (msg Transactions) ReqID() uint64