Class: Chain::Config::ClientModule

Inherits:
Chain::ClientModule show all
Defined in:
lib/chain/config.rb

Instance Attribute Summary

Attributes inherited from Chain::ClientModule

#client

Instance Method Summary collapse

Methods inherited from Chain::ClientModule

#initialize

Constructor Details

This class inherits a constructor from Chain::ClientModule

Instance Method Details

#configure(opts) ⇒ void

This method returns an undefined value.

Configure specified Chain Core.

Parameters:

  • opts (Hash)

    Options for configuring Chain Core.

Options Hash (opts):

  • is_generator (Boolean)

    Whether the local core will be a block generator for the blockchain; i.e., you are starting a new blockchain on the local core. ‘false` if you are connecting to a pre-existing blockchain.

  • generator_url (String)

    A URL for the block generator. Required if ‘isGenerator` is false.

  • generator_access_token (String)

    An access token provided by administrators of the block generator. Required if ‘isGenerator` is false.

  • blockchain_id (String)

    The unique ID of the generator’s blockchain. Required if ‘isGenerator` is false.



156
157
158
# File 'lib/chain/config.rb', line 156

def configure(opts)
  client.conn.request('configure', opts)
end

#infoInfo

Get info on specified Chain Core.

Returns:



162
163
164
# File 'lib/chain/config.rb', line 162

def info
  Info.new(client.conn.request('info'))
end

#reset(everything: false) ⇒ void

This method returns an undefined value.

Reset specified Chain Core.

Parameters:

  • everything (Boolean) (defaults to: false)

    If ‘true`, all objects including access tokens and MockHSM keys will be deleted. If `false`, then access tokens and MockHSM keys will be preserved.



145
146
147
# File 'lib/chain/config.rb', line 145

def reset(everything: false)
  client.conn.request('reset', {everything: everything})
end