Class: Casper::Entity::Status
- Inherits:
-
Object
- Object
- Casper::Entity::Status
- Defined in:
- lib/entity/status.rb
Instance Method Summary collapse
-
#get_api_version ⇒ String
The RPC API version.
-
#get_build_version ⇒ String
The compiled node version.
-
#get_chainspec_name ⇒ String
The chainspec name.
-
#get_last_added_block_info ⇒ Hash
The minimal info of the last block from the linear chain.
-
#get_next_upgrade ⇒ String
Information about the next scheduled upgrade.
-
#get_our_public_signing_key ⇒ String
Our public signing key.
-
#get_peers ⇒ Array<Peer>
The node ID and network address of each connected peer.
-
#get_round_length ⇒ Integer
The next round length if this node is a validator.
-
#get_starting_state_root_hash ⇒ String
The state root hash used at the start of the current sessio.
-
#get_uptime ⇒ String
The time that passed since the node has started.
-
#initialize(status = {}) ⇒ Status
constructor
A new instance of Status.
Constructor Details
#initialize(status = {}) ⇒ Status
Returns a new instance of Status.
15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/entity/status.rb', line 15 def initialize(status = {}) @api_version = status[:api_version] @chainspec_name = status[:chainspec_name] @starting_state_root_hash = status[:starting_state_root_hash] @peers = [] status[:peers].map { |peer| @peers << Casper::Entity::Peer.new(peer)} @last_added_block_info = status[:last_added_block_info] @our_public_signing_key = status[:our_public_signing_key] @round_length = status[:round_length] @next_upgrade = status[:next_upgrade] @build_version = status[:build_version] @uptime = status[:uptime] end |
Instance Method Details
#get_api_version ⇒ String
Returns the RPC API version.
30 31 32 |
# File 'lib/entity/status.rb', line 30 def get_api_version @api_version end |
#get_build_version ⇒ String
Returns the compiled node version.
70 71 72 |
# File 'lib/entity/status.rb', line 70 def get_build_version @build_version end |
#get_chainspec_name ⇒ String
Returns the chainspec name.
35 36 37 |
# File 'lib/entity/status.rb', line 35 def get_chainspec_name @chainspec_name end |
#get_last_added_block_info ⇒ Hash
Returns the minimal info of the last block from the linear chain.
50 51 52 |
# File 'lib/entity/status.rb', line 50 def get_last_added_block_info @last_added_block_info end |
#get_next_upgrade ⇒ String
Returns information about the next scheduled upgrade.
65 66 67 |
# File 'lib/entity/status.rb', line 65 def get_next_upgrade @next_upgrade end |
#get_our_public_signing_key ⇒ String
Returns Our public signing key.
55 56 57 |
# File 'lib/entity/status.rb', line 55 def get_our_public_signing_key @our_public_signing_key end |
#get_peers ⇒ Array<Peer>
Returns the node ID and network address of each connected peer.
45 46 47 |
# File 'lib/entity/status.rb', line 45 def get_peers @peers end |
#get_round_length ⇒ Integer
Returns the next round length if this node is a validator.
60 61 62 |
# File 'lib/entity/status.rb', line 60 def get_round_length @round_length end |
#get_starting_state_root_hash ⇒ String
Returns the state root hash used at the start of the current sessio.
40 41 42 |
# File 'lib/entity/status.rb', line 40 def get_starting_state_root_hash @starting_state_root_hash end |
#get_uptime ⇒ String
Returns the time that passed since the node has started.
75 76 77 |
# File 'lib/entity/status.rb', line 75 def get_uptime @uptime end |