Class: ArkEcosystem::Client::API::One::Peers

Inherits:
Base
  • Object
show all
Defined in:
lib/arkecosystem/client/api/one/peers.rb

Overview

Methods for the Peers API

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from ArkEcosystem::Client::API::Base

Instance Method Details

#all(parameters = {}) ⇒ Faraday::Response

Get all peers.

Parameters:

  • parameters (Hash) (defaults to: {})

Returns:

  • (Faraday::Response)

17
18
19
# File 'lib/arkecosystem/client/api/one/peers.rb', line 17

def all(parameters = {})
  @client.get('peers', parameters)
end

#show(ip_addr, port) ⇒ Faraday::Response

Get the peer by the given ip and port.

Parameters:

  • ip_addr (String)
  • port (Integer)

Returns:

  • (Faraday::Response)

27
28
29
# File 'lib/arkecosystem/client/api/one/peers.rb', line 27

def show(ip_addr, port)
  @client.get('peers/get', ip: ip_addr, port: port)
end

#versionFaraday::Response

Get the node version of the peer.

Returns:

  • (Faraday::Response)

34
35
36
# File 'lib/arkecosystem/client/api/one/peers.rb', line 34

def version
  @client.get('peers/version')
end