Class: Bytom::CoreConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/bytom/api/core_config.rb

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ CoreConfig

Returns a new instance of CoreConfig.



6
7
8
# File 'lib/bytom/api/core_config.rb', line 6

def initialize(client)
  @client = client
end

Instance Method Details

#gas_rateObject



17
18
19
# File 'lib/bytom/api/core_config.rb', line 17

def gas_rate
  client.make_request('/gas-rate', 'post', params: {})
end

#is_miningObject

Returns the mining status.



24
25
26
# File 'lib/bytom/api/core_config.rb', line 24

def is_mining
  client.make_request('/is-mining', 'post', params: {})
end

#net_infoObject

Returns the information of current network node.



13
14
15
# File 'lib/bytom/api/core_config.rb', line 13

def net_info
  client.make_request('/net-info', 'post', params: {})
end

#set_mining(is_mining: true) ⇒ Object

Start up node mining.



31
32
33
# File 'lib/bytom/api/core_config.rb', line 31

def set_mining(is_mining: true)
  client.make_request('/set-mining', 'post', params: {is_mining: is_mining})
end