Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Spec = &protocols.Spec{ Name: "bzzeth", Version: 1, MaxMsgSize: 10 * 1024 * 1024, Messages: []interface{}{ Handshake{}, NewBlockHeaders{}, GetBlockHeaders{}, BlockHeaders{}, }, DisableContext: true, }
Spec is the protocol spec for bzzeth
Functions ¶
This section is empty.
Types ¶
type BlockHeaders ¶
type BlockHeaders struct { Rid uint32 // request id Headers []rlp.RawValue // list of rlp encoded block headers }
BlockHeaders encapsulates actual header blobs sent as a response to GetBlockHeaders multiple responses to the same request, whatever the node has it sends right away
type BzzEth ¶
type BzzEth struct {
// contains filtered or unexported fields
}
BzzEth is a global module handling ethereum state on swarm
func (*BzzEth) Run ¶
Run is the bzzeth protocol run function. - creates a peer - checks if it is a swarm node, put the protocol in idle mode - performs handshake - adds peer to the peerpool - starts incoming message handler loop
type GetBlockHeaders ¶
GetBlockHeaders is used between a Swarm node and the Ethereum node in two cases: 1. When an Ethereum node asks the header corresponding to the hashes in the message (eth -> bzz) 2. When a Swarm node cannot find a particular header in the network, it asks the ethereum node for the header in order to push it to the network (bzz -> eth)
type Handshake ¶
type Handshake struct {
ServeHeaders bool // indicates if this node is expected to serve requests for headers
}
Handshake is used in between the ethereum node and the Swarm node
type NewBlockHeaders ¶
NewBlockHeaders is sent from the Ethereum client to the Swarm node