quorum_sdk 0.1.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +21 -23
- data/README.md +40 -17
- data/lib/proto/chain.proto +169 -234
- data/lib/proto/chain_pb.rb +123 -193
- data/lib/quorum_sdk/account.rb +0 -2
- data/lib/quorum_sdk/chain/chain.rb +18 -0
- data/lib/quorum_sdk/chain/group.rb +69 -0
- data/lib/quorum_sdk/chain/management.rb +143 -0
- data/lib/quorum_sdk/chain/node.rb +18 -0
- data/lib/quorum_sdk/chain.rb +26 -0
- data/lib/quorum_sdk/client.rb +23 -10
- data/lib/quorum_sdk/node/announce.rb +52 -0
- data/lib/quorum_sdk/node/app_config.rb +25 -0
- data/lib/quorum_sdk/node/auth.rb +32 -0
- data/lib/quorum_sdk/node/group.rb +32 -0
- data/lib/quorum_sdk/node/trx.rb +78 -0
- data/lib/quorum_sdk/node.rb +44 -0
- data/lib/quorum_sdk/utils.rb +58 -28
- data/lib/quorum_sdk/version.rb +1 -1
- data/lib/quorum_sdk.rb +2 -2
- metadata +14 -23
- data/activity_stream_pb.rb +0 -146
- data/lib/proto/activity_stream.proto +0 -134
- data/lib/proto/activity_stream_pb.rb +0 -146
- data/lib/quorum_sdk/api/chain.rb +0 -13
- data/lib/quorum_sdk/api/light_node.rb +0 -88
- data/lib/quorum_sdk/api.rb +0 -32
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 245e92c9c15874d6bb256ed440cd35022e5957d5b8ab29e259a53d4453df1a0e
|
4
|
+
data.tar.gz: 1c2fc0cb78d949eafc39b25f7d5f8c74b8c2ca48cf1b7fc035cfb64ad6cef92e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
5
|
-
activesupport (
|
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 (
|
10
|
-
faraday-retry (
|
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.
|
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.
|
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.
|
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.
|
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.
|
49
|
+
minitest (5.18.0)
|
51
50
|
openssl (3.1.0)
|
52
51
|
parallel (1.22.1)
|
53
|
-
parser (3.2.
|
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.
|
62
|
+
regexp_parser (2.7.0)
|
64
63
|
rexml (3.2.5)
|
65
|
-
rubocop (1.
|
64
|
+
rubocop (1.48.1)
|
66
65
|
json (~> 2.3)
|
67
66
|
parallel (~> 1.10)
|
68
|
-
parser (>= 3.
|
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.
|
71
|
+
rubocop-ast (>= 1.26.0, < 2.0)
|
73
72
|
ruby-progressbar (~> 1.7)
|
74
|
-
unicode-display_width (>=
|
75
|
-
rubocop-ast (1.
|
76
|
-
parser (>= 3.
|
77
|
-
ruby-progressbar (1.
|
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
|
-
|
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.
|
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
|
-
###
|
15
|
+
### Initilize
|
16
16
|
|
17
17
|
```ruby
|
18
|
-
#
|
19
|
-
|
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 =
|
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 =
|
39
|
+
trx = node.build_trx data: msg, private_key: account.private_hex
|
32
40
|
|
33
41
|
# push trx to chain
|
34
|
-
|
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 =
|
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 =
|
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
|
-
|
64
|
+
node.send_trx trx
|
56
65
|
# output: { trx_id: '...' }
|
57
66
|
|
58
|
-
# list Trx on chain
|
59
|
-
|
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
|
-
|
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)
|
89
|
+
Check all available proto types in [chain_pb.rb](./lib/proto/chain_pb.rb).
|
67
90
|
|
68
91
|
## Development
|
69
92
|
|