Class: QuorumSdk::Node

Inherits:
Object
  • Object
show all
Includes:
Announce, AppConfig, Auth, Group, Trx
Defined in:
lib/quorum_sdk/node.rb,
lib/quorum_sdk/node/trx.rb,
lib/quorum_sdk/node/auth.rb,
lib/quorum_sdk/node/group.rb,
lib/quorum_sdk/node/announce.rb,
lib/quorum_sdk/node/app_config.rb

Overview

Wrapper for HTTP APIs as light node client

Defined Under Namespace

Modules: Announce, AppConfig, Auth, Group, Trx

Constant Summary

Constants included from Trx

Trx::ARGUMENTS_FOR_BUILD_TRX, Trx::ARGUMENTS_FOR_SEND_TRX

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Trx

#build_trx, #list_trx, #send_trx

Methods included from Group

#info, #producers, #user_encrypt_pubkeys

Methods included from Auth

#allow_list, #auth_type, #deny_list

Methods included from AppConfig

#app_config, #app_config_keys

Methods included from Announce

#announce, #announced_producers, #announced_users

Constructor Details

#initialize(**kwargs) ⇒ Node

Returns a new instance of Node.



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/quorum_sdk/node.rb', line 16

def initialize(**kwargs)
  config =
    if kwargs[:seed].present?
      QuorumSdk::Utils.parse_seed kwargs[:seed]
    else
      kwargs
    end

  @group_id = config[:group_id]
  @group_name = config[:group_name]
  @consensus_type = config[:consensus_type]
  @encryption_type = config[:encryption_type]
  @app_key = config[:app_key]
  @owner_pubkey = config[:owner_pubkey]
  @signature = config[:signature]
  @cipher_key = config[:cipher_key]
  @chain_url = config[:chain_url]
  @jwt = config[:jwt]

  @client = QuorumSdk::Client.new(@chain_url, @jwt)
end

Instance Attribute Details

#app_keyObject (readonly)

Returns the value of attribute app_key.



13
14
15
# File 'lib/quorum_sdk/node.rb', line 13

def app_key
  @app_key
end

#chain_urlObject (readonly)

Returns the value of attribute chain_url.



13
14
15
# File 'lib/quorum_sdk/node.rb', line 13

def chain_url
  @chain_url
end

#cipher_keyObject (readonly)

Returns the value of attribute cipher_key.



13
14
15
# File 'lib/quorum_sdk/node.rb', line 13

def cipher_key
  @cipher_key
end

#clientObject (readonly)

Returns the value of attribute client.



13
14
15
# File 'lib/quorum_sdk/node.rb', line 13

def client
  @client
end

#consensus_typeObject (readonly)

Returns the value of attribute consensus_type.



13
14
15
# File 'lib/quorum_sdk/node.rb', line 13

def consensus_type
  @consensus_type
end

#encryption_typeObject (readonly)

Returns the value of attribute encryption_type.



13
14
15
# File 'lib/quorum_sdk/node.rb', line 13

def encryption_type
  @encryption_type
end

#group_idObject (readonly)

Returns the value of attribute group_id.



13
14
15
# File 'lib/quorum_sdk/node.rb', line 13

def group_id
  @group_id
end

#group_nameObject (readonly)

Returns the value of attribute group_name.



13
14
15
# File 'lib/quorum_sdk/node.rb', line 13

def group_name
  @group_name
end

#jwtObject (readonly)

Returns the value of attribute jwt.



13
14
15
# File 'lib/quorum_sdk/node.rb', line 13

def jwt
  @jwt
end

#owner_pubkeyObject (readonly)

Returns the value of attribute owner_pubkey.



13
14
15
# File 'lib/quorum_sdk/node.rb', line 13

def owner_pubkey
  @owner_pubkey
end

#signatureObject (readonly)

Returns the value of attribute signature.



13
14
15
# File 'lib/quorum_sdk/node.rb', line 13

def signature
  @signature
end