quorum_sdk 0.1.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f5413ed30f64c3a49e504bdf32952cfa1746447093c633b258d6e82a944d18ae
4
- data.tar.gz: a5f94483b0c31d0beb170e7f2a1c6de8710e6676c5454540eaca2239acd4f25e
3
+ metadata.gz: 245e92c9c15874d6bb256ed440cd35022e5957d5b8ab29e259a53d4453df1a0e
4
+ data.tar.gz: 1c2fc0cb78d949eafc39b25f7d5f8c74b8c2ca48cf1b7fc035cfb64ad6cef92e
5
5
  SHA512:
6
- metadata.gz: 6f6e0592db3e59d3280de1abbb4e6bace334901f386eb28b242ebc33b6c7645d04f948eb289e9ec89347c309f7c592602f2d369f9735d983d1498e91af1ec627
7
- data.tar.gz: 0be661ec49361ccb2d3603e85c53ee4acba82ef28801c04ee633e9b0c9d4d699d830e9e83a9bc65b0f26bec7727974196706a058a7637904287014732e05f092
6
+ metadata.gz: 93a857d4eb6197c52b83447640c146d9818723eebdc8102552e5140fc32c939316c6c0f546bf203d4e0d5dd458be37d2a0afef957d1fd2d74b8fe71bec5d4ef6
7
+ data.tar.gz: c48771075369a6b8d27c7ddc04a9593fe782a4a1189c069271535a8d5d2830d4c64f25604a0530fb84b415840625bfec73df30c5332c9aa4e0990508b7cfc810
data/Gemfile.lock CHANGED
@@ -1,20 +1,19 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- quorum_sdk (0.1.0)
5
- activesupport (>= 5)
4
+ quorum_sdk (0.3.0)
5
+ activesupport (~> 7)
6
6
  addressable (~> 2)
7
7
  bcrypt (~> 3.1)
8
8
  eth (~> 0.5)
9
- faraday (>= 2)
10
- faraday-retry (>= 2)
9
+ faraday (~> 2)
10
+ faraday-retry (~> 2)
11
11
  google-protobuf (~> 3)
12
- sha3 (~> 1.0)
13
12
 
14
13
  GEM
15
14
  remote: https://rubygems.org/
16
15
  specs:
17
- activesupport (7.0.4)
16
+ activesupport (7.0.4.3)
18
17
  concurrent-ruby (~> 1.0, >= 1.0.2)
19
18
  i18n (>= 1.6, < 2)
20
19
  minitest (>= 5.1)
@@ -23,34 +22,34 @@ GEM
23
22
  public_suffix (>= 2.0.2, < 6.0)
24
23
  ast (2.4.2)
25
24
  bcrypt (3.1.18)
26
- concurrent-ruby (1.1.10)
25
+ concurrent-ruby (1.2.2)
27
26
  eth (0.5.10)
28
27
  keccak (~> 1.3)
29
28
  konstructor (~> 1.0)
30
29
  openssl (>= 2.2, < 4.0)
31
30
  rbsecp256k1 (~> 5.1)
32
31
  scrypt (~> 3.0)
33
- faraday (2.7.2)
32
+ faraday (2.7.4)
34
33
  faraday-net_http (>= 2.0, < 3.1)
35
34
  ruby2_keywords (>= 0.0.4)
36
35
  faraday-net_http (3.0.2)
37
- faraday-retry (2.0.0)
36
+ faraday-retry (2.1.0)
38
37
  faraday (~> 2.0)
39
38
  ffi (1.15.5)
40
39
  ffi-compiler (1.0.1)
41
40
  ffi (>= 1.0.0)
42
41
  rake
43
- google-protobuf (3.21.12)
42
+ google-protobuf (3.22.2-x86_64-linux)
44
43
  i18n (1.12.0)
45
44
  concurrent-ruby (~> 1.0)
46
45
  json (2.6.3)
47
46
  keccak (1.3.1)
48
47
  konstructor (1.0.2)
49
48
  mini_portile2 (2.8.1)
50
- minitest (5.17.0)
49
+ minitest (5.18.0)
51
50
  openssl (3.1.0)
52
51
  parallel (1.22.1)
53
- parser (3.2.0.0)
52
+ parser (3.2.1.1)
54
53
  ast (~> 2.4.1)
55
54
  pkg-config (1.5.1)
56
55
  public_suffix (5.0.1)
@@ -60,27 +59,26 @@ GEM
60
59
  mini_portile2 (~> 2.8)
61
60
  pkg-config (~> 1.5)
62
61
  rubyzip (~> 2.3)
63
- regexp_parser (2.6.1)
62
+ regexp_parser (2.7.0)
64
63
  rexml (3.2.5)
65
- rubocop (1.42.0)
64
+ rubocop (1.48.1)
66
65
  json (~> 2.3)
67
66
  parallel (~> 1.10)
68
- parser (>= 3.1.2.1)
67
+ parser (>= 3.2.0.0)
69
68
  rainbow (>= 2.2.2, < 4.0)
70
69
  regexp_parser (>= 1.8, < 3.0)
71
70
  rexml (>= 3.2.5, < 4.0)
72
- rubocop-ast (>= 1.24.1, < 2.0)
71
+ rubocop-ast (>= 1.26.0, < 2.0)
73
72
  ruby-progressbar (~> 1.7)
74
- unicode-display_width (>= 1.4.0, < 3.0)
75
- rubocop-ast (1.24.1)
76
- parser (>= 3.1.1.0)
77
- ruby-progressbar (1.11.0)
73
+ unicode-display_width (>= 2.4.0, < 3.0)
74
+ rubocop-ast (1.27.0)
75
+ parser (>= 3.2.1.0)
76
+ ruby-progressbar (1.13.0)
78
77
  ruby2_keywords (0.0.5)
79
78
  rubyzip (2.3.2)
80
79
  scrypt (3.0.7)
81
80
  ffi-compiler (>= 1.0, < 2.0)
82
- sha3 (1.0.5)
83
- tzinfo (2.0.5)
81
+ tzinfo (2.0.6)
84
82
  concurrent-ruby (~> 1.0)
85
83
  unicode-display_width (2.4.2)
86
84
 
@@ -94,4 +92,4 @@ DEPENDENCIES
94
92
  rubocop (~> 1.21)
95
93
 
96
94
  BUNDLED WITH
97
- 2.4.2
95
+ 2.4.8
data/README.md CHANGED
@@ -10,16 +10,24 @@ If bundler is not being used to manage dependencies, install the gem by executin
10
10
 
11
11
  $ gem install quorum_sdk
12
12
 
13
- ## Usage
13
+ ## LightNode Usage
14
14
 
15
- ### Send a trx
15
+ ### Initilize
16
16
 
17
17
  ```ruby
18
- # initilize SDK
19
- rum = QuorumSdk::API.new "rum://...."
18
+ # Initilize by seed url
19
+ node = QuorumSdk::Node.new seed: "rum://...."
20
+ ```
21
+
22
+ ### Send a trx
20
23
 
24
+ ```ruby
21
25
  # build a message
22
- msg = Quorum::Pb::Object.new(type: 'Note', name: 'A title', content: 'Something awesome.')
26
+ msg = {
27
+ type: 'Note',
28
+ name: 'A title',
29
+ content: 'Something awesome'
30
+ }
23
31
 
24
32
  # prepare an ETH account
25
33
  account = QuorumSdk::Account.new
@@ -28,10 +36,10 @@ account = QuorumSdk::Account.new
28
36
  # account = QuorumSdk::Account.new priv: private_key
29
37
 
30
38
  # build trx
31
- trx = rum.build_trx data: msg, private_key: account.private_hex
39
+ trx = node.build_trx data: msg, private_key: account.private_hex
32
40
 
33
41
  # push trx to chain
34
- rum.send_trx trx
42
+ node.send_trx trx
35
43
  # output: { trx_id: '...' }
36
44
 
37
45
  ```
@@ -39,31 +47,46 @@ rum.send_trx trx
39
47
  Build a activity message
40
48
 
41
49
  ```ruby
42
- # initilize SDK
43
- rum = QuorumSdk::API.new "rum://...."
44
-
45
50
  # build a Note type object
46
- note = QuorumSdk::Pb::Object.new(type: 'Note', name: 'A title', content: 'Something awesome.')
51
+ note = {
52
+ type: 'Note',
53
+ name: 'A title',
54
+ content: 'Something awesome.'
55
+ }
47
56
 
48
57
  # build Activity object, wrapping Note object
49
- activity = Quorum::Pb::Activity.new(type: 'Create', object: note)
58
+ activity = { type: 'Create', object: note }
50
59
 
51
60
  # build Trx
52
61
  trx = rum.build_trx data: activity, private_key: account.private_hex
53
62
 
54
63
  # push trx to chain
55
- rum.send_trx trx
64
+ node.send_trx trx
56
65
  # output: { trx_id: '...' }
57
66
 
58
- # list Trx on chain
59
- rum.list_trx
67
+ # list Trx in the group on chain
68
+ node.list_trx
60
69
  # output: [{ trx_id: '...', Data: { type: 'Create', object: { type: 'Note', name: 'A title', content: 'Something awesome' }}}]
61
70
 
62
71
  ```
63
72
 
64
- ### Proto
73
+ ## FullNode Usage
74
+
75
+ ### Initilize
76
+
77
+ ```ruby
78
+ chain = QuorumSdk::Chain.new chain_url: 'http://127.0.0.1:8002', jwt: ''
79
+
80
+ # list joined groups
81
+ chain.groups
82
+
83
+ # network
84
+ chain.network
85
+ ```
86
+
87
+ ## Proto
65
88
 
66
- Check all available proto types in [chain_pb.rb](./lib/proto/chain_pb.rb) and [activity_stream_pb.rb](./lib/proto/activity_stream_pb.rb).
89
+ Check all available proto types in [chain_pb.rb](./lib/proto/chain_pb.rb).
67
90
 
68
91
  ## Development
69
92