Documentation ¶
Index ¶
- type BlockBodies
- type BlockHeaders
- type Chain
- type Conn
- type Disconnect
- type Error
- type GetBlockBodies
- type GetBlockHeaders
- type Hello
- type Message
- type NewBlock
- type NewBlockHashes
- type NewPooledTransactionHashes
- type Ping
- type Pong
- type Status
- type Suite
- func (s *Suite) OngTests() []utesting.Test
- func (s *Suite) TestBroadcast(t *utesting.T)
- func (s *Suite) TestBroadcast_66(t *utesting.T)
- func (s *Suite) TestGetBlockBodies(t *utesting.T)
- func (s *Suite) TestGetBlockBodies_66(t *utesting.T)
- func (s *Suite) TestGetBlockHeaders(t *utesting.T)
- func (s *Suite) TestGetBlockHeaders_66(t *utesting.T)
- func (s *Suite) TestLargeAnnounce(t *utesting.T)
- func (s *Suite) TestLargeAnnounce_66(t *utesting.T)
- func (s *Suite) TestMaliciousHandshake(t *utesting.T)
- func (s *Suite) TestMaliciousHandshake_66(t *utesting.T)
- func (s *Suite) TestMaliciousStatus(t *utesting.T)
- func (s *Suite) TestMaliciousStatus_66(t *utesting.T)
- func (s *Suite) TestMaliciousTx(t *utesting.T)
- func (s *Suite) TestMaliciousTx_66(t *utesting.T)
- func (s *Suite) TestSameRequestID_66(t *utesting.T)
- func (s *Suite) TestSimultaneousRequests_66(t *utesting.T)
- func (s *Suite) TestStatus(t *utesting.T)
- func (s *Suite) TestStatus_66(t *utesting.T)
- func (s *Suite) TestTransaction(t *utesting.T)
- func (s *Suite) TestTransaction_66(t *utesting.T)
- func (s *Suite) TestZeroRequestID_66(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 ong.BlockBodiesPacket
BlockBodies is the network packet for block content distribution.
func (BlockBodies) Code ¶
func (bb BlockBodies) Code() int
type BlockHeaders ¶
type BlockHeaders ong.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
func (*Conn) ReadAndServe ¶
ReadAndServe serves GetBlockHeaders requests while waiting on another message from the node.
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 ong.GetBlockBodiesPacket
GetBlockBodies represents a GetBlockBodies request
func (GetBlockBodies) Code ¶
func (gbb GetBlockBodies) Code() int
type GetBlockHeaders ¶
type GetBlockHeaders ong.GetBlockHeadersPacket
GetBlockHeaders represents a block header query.
func (GetBlockHeaders) Code ¶
func (g GetBlockHeaders) 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 ong.NewBlockPacket
NewBlock is the network packet for the block propagation message.
type NewBlockHashes ¶
type NewBlockHashes ong.NewBlockHashesPacket
NewBlockHashes is the network packet for the block announcements.
func (NewBlockHashes) Code ¶
func (nbh NewBlockHashes) Code() int
type NewPooledTransactionHashes ¶
type NewPooledTransactionHashes ong.NewPooledTransactionHashesPacket
NewPooledTransactionHashes is the network packet for the tx hash propagation message.
func (NewPooledTransactionHashes) Code ¶
func (nb NewPooledTransactionHashes) Code() int
type Status ¶
type Status ong.StatusPacket
Status is the network packet for the status message for ong/64 and later.
type Suite ¶
Suite represents a structure used to test the ong protocol of a node(s).
func NewSuite ¶
NewSuite creates and returns a new ong-test suite that can be used to test the given node against the given blockchain data.
func (*Suite) TestBroadcast ¶
TestBroadcast tests whonger a block announcement is correctly propagated to the given node's peer(s).
func (*Suite) TestBroadcast_66 ¶
TestBroadcast_66 tests whonger a block announcement is correctly propagated to the given node's peer(s) on the ong66 protocol.
func (*Suite) TestGetBlockBodies ¶
TestGetBlockBodies tests whonger the given node can respond to a `GetBlockBodies` request and that the response is accurate.
func (*Suite) TestGetBlockBodies_66 ¶
TestGetBlockBodies_66 tests whonger the given node can respond to a `GetBlockBodies` request and that the response is accurate over the ong66 protocol.
func (*Suite) TestGetBlockHeaders ¶
TestGetBlockHeaders tests whonger the given node can respond to a `GetBlockHeaders` request and that the response is accurate.
func (*Suite) TestGetBlockHeaders_66 ¶
TestGetBlockHeaders_66 tests whonger the given node can respond to an ong66 `GetBlockHeaders` request and that the response is accurate.
func (*Suite) TestLargeAnnounce ¶
TestLargeAnnounce tests the announcement mechanism with a large block.
func (*Suite) TestLargeAnnounce_66 ¶
TestLargeAnnounce_66 tests the announcement mechanism with a large block.
func (*Suite) TestMaliciousHandshake ¶
TestMaliciousHandshake tries to send malicious data during the handshake.
func (*Suite) TestMaliciousHandshake_66 ¶
TestMaliciousHandshake_66 tries to send malicious data during the handshake.
func (*Suite) TestMaliciousStatus ¶
TestMaliciousStatus sends a status package with a large total difficulty.
func (*Suite) TestMaliciousStatus_66 ¶
TestMaliciousStatus_66 sends a status package with a large total difficulty.
func (*Suite) TestMaliciousTx ¶
func (*Suite) TestMaliciousTx_66 ¶
func (*Suite) TestSameRequestID_66 ¶
TestSameRequestID_66 sends two requests with the same request ID concurrently to a single node.
func (*Suite) TestSimultaneousRequests_66 ¶
TestSimultaneousRequests_66 sends two simultaneous `GetBlockHeader` requests 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, and then check to make sure the chain head is correct.
func (*Suite) TestStatus_66 ¶
TestStatus_66 attempts to connect to the given node and exchange a status message with it on the ong66 protocol, and then check to make sure the chain head is correct.
func (*Suite) TestTransaction ¶
func (*Suite) TestTransaction_66 ¶
func (*Suite) TestZeroRequestID_66 ¶
TestZeroRequestID_66 checks that a request ID of zero is still handled by the node.
type Transactions ¶
type Transactions ong.TransactionsPacket
func (Transactions) Code ¶
func (t Transactions) Code() int