Documentation ¶
Index ¶
- type BlockBodies
- type BlockHeaders
- type Chain
- func (c *Chain) ForkID() forkid.ID
- func (c *Chain) GetHeaders(req GetBlockHeaders) (BlockHeaders, error)
- func (c *Chain) Head() *types.Block
- func (c *Chain) Len() int
- func (c *Chain) Shorten(height int) *Chain
- func (c *Chain) TD(height int) *big.Int
- func (c *Chain) TotalDifficultyAt(height int) *big.Int
- type Conn
- type Disconnect
- type Error
- type GetBlockBodies
- type GetBlockHeaders
- type GetPooledTransactions
- type Hello
- type Message
- type NewBlock
- type NewBlockHashes
- type NewPooledTransactionHashes
- type Ping
- type Pong
- type PooledTransactions
- type Status
- type Suite
- func (s *Suite) AllEthTests() []utesting.Test
- func (s *Suite) Eth67Tests() []utesting.Test
- func (s *Suite) EthTests() []utesting.Test
- func (s *Suite) Is_67(t *utesting.T)
- func (s *Suite) TestBlockHashAnnounce(t *utesting.T)
- func (s *Suite) TestBlockHashAnnounce67(t *utesting.T)
- func (s *Suite) TestBroadcast(t *utesting.T)
- func (s *Suite) TestBroadcast67(t *utesting.T)
- func (s *Suite) TestGetBlockBodies(t *utesting.T)
- func (s *Suite) TestGetBlockBodies67(t *utesting.T)
- func (s *Suite) TestGetBlockHeaders(t *utesting.T)
- func (s *Suite) TestGetBlockHeaders67(t *utesting.T)
- func (s *Suite) TestLargeAnnounce(t *utesting.T)
- func (s *Suite) TestLargeAnnounce67(t *utesting.T)
- func (s *Suite) TestLargeTxRequest67(t *utesting.T)
- func (s *Suite) TestMaliciousHandshake(t *utesting.T)
- func (s *Suite) TestMaliciousHandshake67(t *utesting.T)
- func (s *Suite) TestMaliciousStatus(t *utesting.T)
- func (s *Suite) TestMaliciousStatus67(t *utesting.T)
- func (s *Suite) TestMaliciousTx(t *utesting.T)
- func (s *Suite) TestMaliciousTx67(t *utesting.T)
- func (s *Suite) TestNewPooledTxs67(t *utesting.T)
- func (s *Suite) TestOldAnnounce(t *utesting.T)
- func (s *Suite) TestOldAnnounce67(t *utesting.T)
- func (s *Suite) TestSameRequestID67(t *utesting.T)
- func (s *Suite) TestSimultaneousRequests67(t *utesting.T)
- func (s *Suite) TestStatus(t *utesting.T)
- func (s *Suite) TestStatus67(t *utesting.T)
- func (s *Suite) TestTransaction(t *utesting.T)
- func (s *Suite) TestTransaction67(t *utesting.T)
- func (s *Suite) TestZeroRequestID67(t *utesting.T)
- type Transactions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlockBodies ¶
type BlockBodies eth.BlockBodiesPacket
BlockBodies is the network packet for block content distribution.
func (BlockBodies) Code ¶
func (bb BlockBodies) Code() int
type BlockHeaders ¶
type BlockHeaders eth.BlockHeadersPacket
func (BlockHeaders) Code ¶
func (bh BlockHeaders) Code() int
type Chain ¶
type Chain struct {
// contains filtered or unexported fields
}
func (*Chain) GetHeaders ¶
func (c *Chain) GetHeaders(req GetBlockHeaders) (BlockHeaders, 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 (d Disconnect) Code() int
type GetBlockBodies ¶
type GetBlockBodies eth.GetBlockBodiesPacket
GetBlockBodies represents a GetBlockBodies request
func (GetBlockBodies) Code ¶
func (gbb GetBlockBodies) Code() int
type GetBlockHeaders ¶
type GetBlockHeaders eth.GetBlockHeadersPacket
GetBlockHeaders represents a block header query.
func (GetBlockHeaders) Code ¶
func (g GetBlockHeaders) Code() int
type GetPooledTransactions ¶
type GetPooledTransactions eth.GetPooledTransactionsPacket
func (GetPooledTransactions) Code ¶
func (gpt GetPooledTransactions) Code() int
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 (nbh NewBlockHashes) Code() int
type NewPooledTransactionHashes ¶
type NewPooledTransactionHashes eth.NewPooledTransactionHashesPacket
NewPooledTransactionHashes is the network packet for the tx hash propagation message.
func (NewPooledTransactionHashes) Code ¶
func (nb NewPooledTransactionHashes) Code() int
type PooledTransactions ¶
type PooledTransactions eth.PooledTransactionsPacket
func (PooledTransactions) Code ¶
func (pt PooledTransactions) Code() int
type Status ¶
type Status eth.StatusPacket
Status is the network packet for the status message for eth/64 and later.
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) AllEthTests ¶
func (*Suite) Eth67Tests ¶ added in v1.6.0
func (*Suite) Is_67 ¶ added in v1.6.0
Is_67 checks if the node supports the celo67 (eth66) protocol version, and if not, exists the test suite
func (*Suite) TestBlockHashAnnounce ¶
TestBlockHashAnnounce sends a new block hash announcement and expects the node to perform a `GetBlockHeaders` request.
func (*Suite) TestBlockHashAnnounce67 ¶ added in v1.6.0
TestBlockHashAnnounce67 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 given node's peer(s).
func (*Suite) TestBroadcast67 ¶ added in v1.6.0
TestBroadcast67 tests whether a block announcement is correctly propagated to the given node's peer(s) on the celo67 (eth66) protocol.
func (*Suite) TestGetBlockBodies ¶
TestGetBlockBodies tests whether the given node can respond to a `GetBlockBodies` request and that the response is accurate.
func (*Suite) TestGetBlockBodies67 ¶ added in v1.6.0
TestGetBlockBodies67 tests whether the given node can respond to a `GetBlockBodies` request and that the response is accurate over the celo67 (eth66) protocol.
func (*Suite) TestGetBlockHeaders ¶
TestGetBlockHeaders tests whether the given node can respond to a `GetBlockHeaders` request accurately.
func (*Suite) TestGetBlockHeaders67 ¶ added in v1.6.0
TestGetBlockHeaders67 tests whether the given node can respond to an celo67 (eth66) `GetBlockHeaders` request and that the response is accurate.
func (*Suite) TestLargeAnnounce ¶
TestLargeAnnounce tests the announcement mechanism with a large block.
func (*Suite) TestLargeAnnounce67 ¶ added in v1.6.0
TestLargeAnnounce67 tests the announcement mechanism with a large block over the celo67 (eth66) protocol.
func (*Suite) TestLargeTxRequest67 ¶ added in v1.6.0
TestLargeTxRequest67 tests whether a node can fulfill a large GetPooledTransactions request.
func (*Suite) TestMaliciousHandshake ¶
TestMaliciousHandshake tries to send malicious data during the handshake.
func (*Suite) TestMaliciousHandshake67 ¶ added in v1.6.0
TestMaliciousHandshake67 tries to send malicious data during the handshake.
func (*Suite) TestMaliciousStatus ¶
TestMaliciousStatus sends a status package with a large total difficulty.
func (*Suite) TestMaliciousStatus67 ¶ added in v1.6.0
TestMaliciousStatus67 sends a status package with a large total difficulty over the celo67 (eth66) protocol.
func (*Suite) TestMaliciousTx ¶
TestMaliciousTx sends several invalid transactions and tests whether the node will propagate them.
func (*Suite) TestMaliciousTx67 ¶ added in v1.6.0
TestMaliciousTx67 sends several invalid transactions and tests whether the node will propagate them.
func (*Suite) TestNewPooledTxs67 ¶ added in v1.6.0
TestNewPooledTxs67 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) TestOldAnnounce67 ¶ added in v1.6.0
TestOldAnnounce67 tests the announcement mechanism with an old block, over the celo67 (eth66) protocol.
func (*Suite) TestSameRequestID67 ¶ added in v1.6.0
TestSameRequestID_67 sends two requests with the same request ID to a single node.
func (*Suite) TestSimultaneousRequests67 ¶ added in v1.6.0
TestSimultaneousRequests67 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) TestStatus ¶
TestStatus attempts to connect to the given node and exchange a status message with it.
func (*Suite) TestStatus67 ¶ added in v1.6.0
TestStatus67 attempts to connect to the given node and exchange a status message with it on the celo67 (eth66) protocol.
func (*Suite) TestTransaction ¶
TestTransaction sends a valid transaction to the node and checks if the transaction gets propagated.
func (*Suite) TestTransaction67 ¶ added in v1.6.0
TestTransaction67 sends a valid transaction to the node and checks if the transaction gets propagated.
func (*Suite) TestZeroRequestID67 ¶ added in v1.6.0
TestZeroRequestID_67 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 (t Transactions) Code() int