Class: Reth::ETHProtocol::Status

Inherits:
DEVp2p::Command
  • Object
show all
Defined in:
lib/reth/eth_protocol.rb

Overview

Inform a peer of it’s current ethereum state. This message should be sent after the initial handshake and prior to any ethereum related messages.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeStatus

Returns a new instance of Status.



33
34
35
36
# File 'lib/reth/eth_protocol.rb', line 33

def initialize
  super
  @sent = false
end

Instance Attribute Details

#sentObject (readonly)

Returns the value of attribute sent.



31
32
33
# File 'lib/reth/eth_protocol.rb', line 31

def sent
  @sent
end

Instance Method Details

#create(proto, chain_difficulty, chain_head_hash, genesis_hash) ⇒ Object



38
39
40
41
42
# File 'lib/reth/eth_protocol.rb', line 38

def create(proto, chain_difficulty, chain_head_hash, genesis_hash)
  @sent = true
  network_id = proto.service.app.config[:eth].fetch(:network_id, proto.network_id)
  [proto.version, network_id, chain_difficulty, chain_head_hash, genesis_hash]
end