Class: Algorand::AlgodClient

Inherits:
Object
  • Object
show all
Defined in:
lib/algorand/algod_client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(host: Configuration.algod_host, token:) ⇒ AlgodClient

Returns a new instance of AlgodClient.



7
8
9
10
# File 'lib/algorand/algod_client.rb', line 7

def initialize(host: Configuration.algod_host,  token:)
  @host = host
  @token = token
end

Instance Attribute Details

#hostObject (readonly)

Returns the value of attribute host.



5
6
7
# File 'lib/algorand/algod_client.rb', line 5

def host
  @host
end

#tokenObject (readonly)

Returns the value of attribute token.



5
6
7
# File 'lib/algorand/algod_client.rb', line 5

def token
  @token
end

Instance Method Details

#testObject



12
13
14
# File 'lib/algorand/algod_client.rb', line 12

def test
  HTTParty.get("http://#{host}/v2/status", headers: headers)
end