Module: Elrond::Api::Node::Endpoints::Nodes

Included in:
Client
Defined in:
lib/elrond/api/node/endpoints/nodes.rb

Instance Method Summary collapse

Instance Method Details

#address(options: {}) ⇒ Object



7
8
9
10
# File 'lib/elrond/api/node/endpoints/nodes.rb', line 7

def address(options: {})
  response    =   get("/node/address", options: options)&.body
  response    =   response.fetch("address", nil) if response && response.is_a?(Hash)
end

#heartbeat(options: {}) ⇒ Object



12
13
14
15
# File 'lib/elrond/api/node/endpoints/nodes.rb', line 12

def heartbeat(options: {})
  response    =   get("/node/heartbeatstatus", options: options)&.body
  response    =   response.fetch("message", []) if response && response.is_a?(Hash)
end

#start(options: {}) ⇒ Object



17
18
19
20
# File 'lib/elrond/api/node/endpoints/nodes.rb', line 17

def start(options: {})
  response    =   get("/node/start", options: options)&.body
  response    =   response.fetch("message", nil) if response && response.is_a?(Hash)
end

#statistics(options: {}) ⇒ Object



22
23
24
25
# File 'lib/elrond/api/node/endpoints/nodes.rb', line 22

def statistics(options: {})
  response    =   get("/node/statistics", options: options)&.body
  response    =   response.fetch("statistics", {}) if response && response.is_a?(Hash)
end

#status(options: {}) ⇒ Object



27
28
29
30
# File 'lib/elrond/api/node/endpoints/nodes.rb', line 27

def status(options: {})
  response    =   get("/node/status", options: options)&.body
  response    =   response.fetch("details", {}) if response && response.is_a?(Hash)
end

#stop(options: {}) ⇒ Object



32
33
34
35
# File 'lib/elrond/api/node/endpoints/nodes.rb', line 32

def stop(options: {})
  response    =   get("/node/stop", options: options)&.body
  response    =   response.fetch("message", nil) if response && response.is_a?(Hash)
end