Class: Ethereum::Connection
- Defined in:
- lib/elchapo/ethereum/connection.rb
Constant Summary
Constants inherited from Client
Ethereum::Client::DEFAULT_GAS_LIMIT, Ethereum::Client::DEFAULT_GAS_PRICE, Ethereum::Client::RPC_COMMANDS, Ethereum::Client::RPC_MANAGEMENT_COMMANDS
Instance Attribute Summary collapse
-
#ipcpath ⇒ Object
Returns the value of attribute ipcpath.
Attributes inherited from Client
#command, #default_account, #gas_limit, #gas_price, #id, #log, #logger
Instance Method Summary collapse
-
#initialize(ipcpath) ⇒ Connection
constructor
A new instance of Connection.
- #send_single(payload) ⇒ Object
Methods inherited from Client
#encode_params, #get_id, #int_to_hex, #reset_id, #send_command
Constructor Details
#initialize(ipcpath) ⇒ Connection
Returns a new instance of Connection.
6 7 8 9 |
# File 'lib/elchapo/ethereum/connection.rb', line 6 def initialize(ipcpath) super() @ipcpath = ipcpath end |
Instance Attribute Details
#ipcpath ⇒ Object
Returns the value of attribute ipcpath.
4 5 6 |
# File 'lib/elchapo/ethereum/connection.rb', line 4 def ipcpath @ipcpath end |
Instance Method Details
#send_single(payload) ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/elchapo/ethereum/connection.rb', line 11 def send_single(payload) socket = UNIXSocket.new(@ipcpath) socket.puts(payload) read = socket.recvmsg(nil)[0] socket.close return read end |