RecordsKeeperRubyLib 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitignore +2 -1
- data/CODE_OF_CONDUCT.md +0 -8
- data/Gemfile +0 -1
- data/Gemfile.lock +4 -62
- data/LICENSE.txt +2 -2
- data/README.md +92 -1
- data/{RecordsKeeperRuby.gemspec → RecordsKeeperRubyLib.gemspec} +4 -5
- data/bin/console +1 -1
- data/config.yaml +8 -0
- data/docs/{addressdoc.rb → address_doc.rb} +105 -116
- data/docs/{assetsdoc.rb → asset_doc.rb} +54 -65
- data/docs/block_doc.rb +63 -0
- data/docs/blockchain_doc.rb +77 -0
- data/docs/{permissionsdoc.rb → permissions_doc.rb} +54 -65
- data/docs/{streamdoc.rb → stream_doc.rb} +79 -84
- data/docs/{transactiondoc.rb → transaction_doc.rb} +110 -121
- data/docs/{walletdoc.rb → wallet_doc.rb} +122 -133
- data/lib/RecordsKeeperRubyLib.rb +9 -0
- data/lib/{RecordsKeeperRuby → RecordsKeeperRubyLib}/address.rb +198 -186
- data/lib/{RecordsKeeperRuby → RecordsKeeperRubyLib}/assets.rb +99 -87
- data/lib/{RecordsKeeperRuby → RecordsKeeperRubyLib}/block.rb +94 -89
- data/lib/{RecordsKeeperRuby → RecordsKeeperRubyLib}/blockchain.rb +148 -135
- data/lib/RecordsKeeperRubyLib/config.yaml +8 -0
- data/lib/{RecordsKeeperRuby → RecordsKeeperRubyLib}/permissions.rb +77 -77
- data/lib/RecordsKeeperRubyLib/stream.rb +220 -0
- data/lib/{RecordsKeeperRuby → RecordsKeeperRubyLib}/transaction.rb +213 -182
- data/lib/RecordsKeeperRubyLib/version.rb +3 -0
- data/lib/{RecordsKeeperRuby → RecordsKeeperRubyLib}/wallet.rb +263 -252
- data/lib/config.yaml +8 -0
- metadata +27 -41
- data/docs/blockchaindoc.rb +0 -77
- data/docs/blockdoc.rb +0 -76
- data/lib/RecordsKeeperRuby.rb +0 -9
- data/lib/RecordsKeeperRuby/sample_config.yaml +0 -60
- data/lib/RecordsKeeperRuby/stream.rb +0 -169
- data/lib/RecordsKeeperRuby/version.rb +0 -3
- data/lib/sample_config.yaml +0 -60
- data/sample_config.yaml +0 -60
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: d324ac6751d6dca6221d87cc8ba6def45563226e
|
4
|
+
data.tar.gz: 9b6277d16371801e4f1be36795b47085d782fdaf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cec03224ca43aec072128a23dce1812a24ea2611ae87c74367f60cca388aa7d80a8bc436b26be0e2e72654aeb9544990e5de32ef260e2d9a019ca1453912186c
|
7
|
+
data.tar.gz: 3e631c9d26741cb4be3f49e3d0a89f0b2bab081f42827b3bb8ca561017789e18405f56a8886da590ce803ea92eecd248b350369e77fc9d324cb63dbd23666be7
|
data/.gitignore
CHANGED
data/CODE_OF_CONDUCT.md
CHANGED
@@ -64,11 +64,3 @@ Further details of specific enforcement policies may be posted separately.
|
|
64
64
|
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
65
|
faith may face temporary or permanent repercussions as determined by other
|
66
66
|
members of the project's leadership.
|
67
|
-
|
68
|
-
## Attribution
|
69
|
-
|
70
|
-
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
-
available at [http://contributor-covenant.org/version/1/4][version]
|
72
|
-
|
73
|
-
[homepage]: http://contributor-covenant.org
|
74
|
-
[version]: http://contributor-covenant.org/version/1/4/
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,71 +1,24 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
RecordsKeeperRubyLib (0.
|
4
|
+
RecordsKeeperRubyLib (0.3.0)
|
5
5
|
binary_parser (~> 1.3.0)
|
6
6
|
hex_string (~> 1.0.1)
|
7
7
|
httparty (~> 0.16.2)
|
8
8
|
json (~> 2.1.0)
|
9
|
-
rspec-rails (~> 3.7.2)
|
10
9
|
test-unit (~> 3.2.8)
|
11
10
|
|
12
11
|
GEM
|
13
12
|
remote: https://rubygems.org/
|
14
13
|
specs:
|
15
|
-
actionpack (5.2.0)
|
16
|
-
actionview (= 5.2.0)
|
17
|
-
activesupport (= 5.2.0)
|
18
|
-
rack (~> 2.0)
|
19
|
-
rack-test (>= 0.6.3)
|
20
|
-
rails-dom-testing (~> 2.0)
|
21
|
-
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
22
|
-
actionview (5.2.0)
|
23
|
-
activesupport (= 5.2.0)
|
24
|
-
builder (~> 3.1)
|
25
|
-
erubi (~> 1.4)
|
26
|
-
rails-dom-testing (~> 2.0)
|
27
|
-
rails-html-sanitizer (~> 1.0, >= 1.0.3)
|
28
|
-
activesupport (5.2.0)
|
29
|
-
concurrent-ruby (~> 1.0, >= 1.0.2)
|
30
|
-
i18n (>= 0.7, < 2)
|
31
|
-
minitest (~> 5.1)
|
32
|
-
tzinfo (~> 1.1)
|
33
14
|
binary_parser (1.3.0)
|
34
|
-
builder (3.2.3)
|
35
|
-
concurrent-ruby (1.0.5)
|
36
|
-
crass (1.0.4)
|
37
15
|
diff-lcs (1.3)
|
38
|
-
erubi (1.7.1)
|
39
16
|
hex_string (1.0.1)
|
40
17
|
httparty (0.16.2)
|
41
18
|
multi_xml (>= 0.5.2)
|
42
|
-
i18n (1.0.1)
|
43
|
-
concurrent-ruby (~> 1.0)
|
44
19
|
json (2.1.0)
|
45
|
-
loofah (2.2.2)
|
46
|
-
crass (~> 1.0.2)
|
47
|
-
nokogiri (>= 1.5.9)
|
48
|
-
method_source (0.9.0)
|
49
|
-
mini_portile2 (2.3.0)
|
50
|
-
minitest (5.11.3)
|
51
20
|
multi_xml (0.6.0)
|
52
|
-
nokogiri (1.8.2-x64-mingw32)
|
53
|
-
mini_portile2 (~> 2.3.0)
|
54
21
|
power_assert (1.1.1)
|
55
|
-
rack (2.0.5)
|
56
|
-
rack-test (1.0.0)
|
57
|
-
rack (>= 1.0, < 3)
|
58
|
-
rails-dom-testing (2.0.3)
|
59
|
-
activesupport (>= 4.2.0)
|
60
|
-
nokogiri (>= 1.6)
|
61
|
-
rails-html-sanitizer (1.0.4)
|
62
|
-
loofah (~> 2.2, >= 2.2.2)
|
63
|
-
railties (5.2.0)
|
64
|
-
actionpack (= 5.2.0)
|
65
|
-
activesupport (= 5.2.0)
|
66
|
-
method_source
|
67
|
-
rake (>= 0.8.7)
|
68
|
-
thor (>= 0.18.1, < 2.0)
|
69
22
|
rake (10.5.0)
|
70
23
|
rspec (3.7.0)
|
71
24
|
rspec-core (~> 3.7.0)
|
@@ -79,24 +32,14 @@ GEM
|
|
79
32
|
rspec-mocks (3.7.0)
|
80
33
|
diff-lcs (>= 1.2.0, < 2.0)
|
81
34
|
rspec-support (~> 3.7.0)
|
82
|
-
rspec-rails (3.7.2)
|
83
|
-
actionpack (>= 3.0)
|
84
|
-
activesupport (>= 3.0)
|
85
|
-
railties (>= 3.0)
|
86
|
-
rspec-core (~> 3.7.0)
|
87
|
-
rspec-expectations (~> 3.7.0)
|
88
|
-
rspec-mocks (~> 3.7.0)
|
89
|
-
rspec-support (~> 3.7.0)
|
90
35
|
rspec-support (3.7.1)
|
91
36
|
test-unit (3.2.8)
|
92
37
|
power_assert
|
93
|
-
thor (0.20.0)
|
94
|
-
thread_safe (0.3.6)
|
95
|
-
tzinfo (1.2.5)
|
96
|
-
thread_safe (~> 0.1)
|
97
38
|
|
98
39
|
PLATFORMS
|
40
|
+
ruby
|
99
41
|
x64-mingw32
|
42
|
+
x86_64-linux
|
100
43
|
|
101
44
|
DEPENDENCIES
|
102
45
|
RecordsKeeperRubyLib!
|
@@ -107,8 +50,7 @@ DEPENDENCIES
|
|
107
50
|
json (= 2.1.0)
|
108
51
|
rake (~> 10.0)
|
109
52
|
rspec (~> 3.0)
|
110
|
-
rspec-rails (= 3.7.2)
|
111
53
|
test-unit (= 3.2.8)
|
112
54
|
|
113
55
|
BUNDLED WITH
|
114
|
-
1.16.
|
56
|
+
1.16.3
|
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -1 +1,92 @@
|
|
1
|
-
|
1
|
+
RecordsKeeper-Ruby-SDK
|
2
|
+
=========================
|
3
|
+
|
4
|
+
It is an infrastructure to build RecordsKeeper blockchain-based applications, products and is used to work around applications that are built on top of this blockchain platform.
|
5
|
+
|
6
|
+
**Note:** If you're looking for the RecordsKeeper Ruby Library please see: [RecordsKeeper Ruby Library](https://github.com/RecordsKeeper/recordskeeper-ruby-sdk)
|
7
|
+
|
8
|
+
|
9
|
+
## Getting Started
|
10
|
+
|
11
|
+
Before you begin you need to setup Ruby Development Environment.
|
12
|
+
|
13
|
+
|
14
|
+
Import these ruby libraries first to get started with the library classes and functions.
|
15
|
+
|
16
|
+
|
17
|
+
```bash
|
18
|
+
require 'rubygems'
|
19
|
+
require 'httparty'
|
20
|
+
require 'json'
|
21
|
+
require 'binary_parser'
|
22
|
+
require 'yaml'
|
23
|
+
require 'hex_string'
|
24
|
+
```
|
25
|
+
|
26
|
+
|
27
|
+
Creating Connection
|
28
|
+
-------------------
|
29
|
+
|
30
|
+
Entry point for accessing Address class resources.
|
31
|
+
|
32
|
+
Make Config file to import config parameters.
|
33
|
+
|
34
|
+
Import chain url and chain name from config file:
|
35
|
+
|
36
|
+
* URL: Url to connect to the chain ([RPC Host]:[RPC Port])
|
37
|
+
* Chain-name: chain name
|
38
|
+
|
39
|
+
```bash
|
40
|
+
|
41
|
+
url = network['url']
|
42
|
+
chain-name = network['chain']
|
43
|
+
|
44
|
+
```
|
45
|
+
|
46
|
+
Node Authentication
|
47
|
+
-------------------
|
48
|
+
|
49
|
+
Import user name and password values from config file to authenticate the node:
|
50
|
+
|
51
|
+
* User name: The rpc user is used to call the APIs.
|
52
|
+
* Password: The rpc password is used to authenticate the APIs.
|
53
|
+
|
54
|
+
```bash
|
55
|
+
|
56
|
+
user = network['rkuser']
|
57
|
+
password = network['passwd']
|
58
|
+
|
59
|
+
```
|
60
|
+
|
61
|
+
## Libraries
|
62
|
+
|
63
|
+
- [Address](https://github.com/RecordsKeeper/recordskeeper-ruby-sdk/blob/master/lib/RecordsKeeperRubyLib/address.rb) Library to work with RecordsKeeper addresses. You can generate new address, check all addresses, check address validity, check address permissions, check address balance by using Address class. You just have to pass parameters to invoke the pre-defined functions.
|
64
|
+
|
65
|
+
- [Assets](https://github.com/RecordsKeeper/recordskeeper-ruby-sdk/blob/master/lib/RecordsKeeperRubyLib/assets.rb) Library to work with RecordsKeeper assets. You can create new assets and list all assets by using Assets class. You just have to pass parameters to invoke the pre-defined functions.
|
66
|
+
|
67
|
+
- [Block](https://github.com/RecordsKeeper/recordskeeper-ruby-sdk/blob/master/lib/RecordsKeeperRubyLib/block.rb) Library to work with RecordsKeeper block informaion. You can collect block information by using block class. You just have to pass parameters to invoke the pre-defined functions.
|
68
|
+
|
69
|
+
- [Blockchain](https://github.com/RecordsKeeper/recordskeeper-ruby-sdk/blob/master/lib/RecordsKeeperRubyLib/blockchain.rb) Library to work with RecordsKeeper block informaion. You can collect block information by using block class. You just have to pass parameters to invoke the pre-defined functions.
|
70
|
+
|
71
|
+
- [Permissions](https://github.com/RecordsKeeper/recordskeeper-ruby-sdk/blob/master/lib/RecordsKeeperRubyLib/permissions.rb) Library to work with RecordsKeeper permissions. You can grant and revoke permissions like connect, send, receive, create, issue, mine, activate, admin by using Assets class. You just have to pass parameters to invoke the pre-defined functions.
|
72
|
+
|
73
|
+
- [Stream](https://github.com/RecordsKeeper/recordskeeper-ruby-sdk/blob/master/lib/RecordsKeeperRubyLib/stream.rb) Library to work with RecordsKeeper streams. You can publish, retrieve and verify stream data by using stream class. You just have to pass parameters to invoke the pre-defined functions.
|
74
|
+
|
75
|
+
- [Transaction](https://github.com/RecordsKeeper/recordskeeper-ruby-sdk/blob/master/lib/RecordsKeeperRubyLib/transaction.rb) Library to work with RecordsKeeper transactions. You can send transaction, create raw transaction, sign raw transaction, send raw transaction, send signed transaction, retrieve transaction information and calculate transaction's fees by using transaction class. You just have to pass parameters to invoke the pre-defined functions.
|
76
|
+
|
77
|
+
- [Wallet](https://github.com/RecordsKeeper/recordskeeper-ruby-sdk/blob/master/lib/RecordsKeeperRubyLib/wallet.rb) Library to work with RecordsKeeper wallet functionalities. You can create wallet, dump wallet into a file, backup wallet into a file, import wallet from a file, lock wallet, unlock wallet, change wallet's password, retrieve private key, retrieve wallet's information, sign and verify message by using wallet class. You just have to pass parameters to invoke the pre-defined functions.
|
78
|
+
|
79
|
+
|
80
|
+
## Unit Tests
|
81
|
+
|
82
|
+
Under recordskeeper_ruby_ spec/test using test data from config.yaml file.
|
83
|
+
- Command to run a all the tests:
|
84
|
+
[rake spec]
|
85
|
+
- Command to a specific test file:
|
86
|
+
[rspec spec/test_name.rb]
|
87
|
+
|
88
|
+
|
89
|
+
## Documentation
|
90
|
+
|
91
|
+
The complete documentation is here: [RecordsKeeper Ruby Library Documentation](https://github.com/RecordsKeeper/recordskeeper-ruby-sdk/tree/master/docs).
|
92
|
+
|
@@ -1,16 +1,16 @@
|
|
1
1
|
|
2
2
|
lib = File.expand_path("../lib", __FILE__)
|
3
3
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require "
|
4
|
+
require "RecordsKeeperRubyLib/version"
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = "RecordsKeeperRubyLib"
|
8
|
-
spec.version =
|
8
|
+
spec.version = RecordsKeeperRubyLib::VERSION
|
9
9
|
spec.authors = ["Yusra Qureshi"]
|
10
10
|
spec.email = ["yusraq10"]
|
11
11
|
|
12
|
-
spec.summary = %q{
|
13
|
-
spec.description = %q{This is
|
12
|
+
spec.summary = %q{RecordsKeeper-SDK-Ruby}
|
13
|
+
spec.description = %q{This is ruby library for RecordsKeeper.}
|
14
14
|
spec.homepage = "https://github.com/RecordsKeeper"
|
15
15
|
spec.license = "MIT"
|
16
16
|
|
@@ -29,6 +29,5 @@ Gem::Specification.new do |spec|
|
|
29
29
|
spec.add_dependency "binary_parser", "~> 1.3.0"
|
30
30
|
spec.add_dependency "json", "~> 2.1.0"
|
31
31
|
spec.add_dependency "test-unit", "~>3.2.8"
|
32
|
-
spec.add_dependency "rspec-rails", "~> 3.7.2"
|
33
32
|
|
34
33
|
end
|
data/bin/console
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
3
|
require "bundler/setup"
|
4
|
-
require "
|
4
|
+
require "RecordsKeeperRubyLib"
|
5
5
|
|
6
6
|
# You can add fixtures and/or initialization code here to make experimenting
|
7
7
|
# with your gem easier. You can also use a different console, if you like.
|
data/config.yaml
ADDED
@@ -1,116 +1,105 @@
|
|
1
|
-
# = Address Class Usage
|
2
|
-
# This is a library to work with RecordsKeeper block information.
|
3
|
-
# You can generate new address, check all addresses, check address validity, check address permissions, check address balance by using Address class. You just have to pass parameters to invoke the pre-defined functions.
|
4
|
-
# ---------
|
5
|
-
# == Libraries
|
6
|
-
# Require these ruby libraries first to get started with the functionality.
|
7
|
-
# require 'rubygems'
|
8
|
-
# require 'httparty'
|
9
|
-
# require 'json'
|
10
|
-
# require 'binary_parser'
|
11
|
-
# require 'yaml'
|
12
|
-
# -----------------
|
13
|
-
# == Create Connection
|
14
|
-
# Entry point for accessing Address class resources.
|
15
|
-
# * URL: Url to connect to the chain ([RPC Host]:[RPC Port])
|
16
|
-
# * Chain-name: chain name
|
17
|
-
#
|
18
|
-
# * Set a *network* value
|
19
|
-
#
|
20
|
-
#
|
21
|
-
#
|
22
|
-
#
|
23
|
-
#
|
24
|
-
#
|
25
|
-
#
|
26
|
-
#
|
27
|
-
#
|
28
|
-
#
|
29
|
-
#
|
30
|
-
#
|
31
|
-
#
|
32
|
-
#
|
33
|
-
#
|
34
|
-
#
|
35
|
-
#
|
36
|
-
#
|
37
|
-
#
|
38
|
-
#
|
39
|
-
#
|
40
|
-
#
|
41
|
-
#
|
42
|
-
#
|
43
|
-
#
|
44
|
-
#
|
45
|
-
#
|
46
|
-
#
|
47
|
-
#
|
48
|
-
#
|
49
|
-
#
|
50
|
-
#
|
51
|
-
#
|
52
|
-
#
|
53
|
-
#
|
54
|
-
#
|
55
|
-
#
|
56
|
-
# *
|
57
|
-
#
|
58
|
-
#
|
59
|
-
#
|
60
|
-
#
|
61
|
-
#
|
62
|
-
#
|
63
|
-
#
|
64
|
-
#
|
65
|
-
#
|
66
|
-
#
|
67
|
-
#
|
68
|
-
#
|
69
|
-
#
|
70
|
-
#
|
71
|
-
#
|
72
|
-
#
|
73
|
-
#
|
74
|
-
#
|
75
|
-
#
|
76
|
-
#
|
77
|
-
#
|
78
|
-
#
|
79
|
-
#
|
80
|
-
#
|
81
|
-
#
|
82
|
-
#
|
83
|
-
#
|
84
|
-
#
|
85
|
-
#
|
86
|
-
#
|
87
|
-
#
|
88
|
-
#
|
89
|
-
#
|
90
|
-
#
|
91
|
-
#
|
92
|
-
#
|
93
|
-
#
|
94
|
-
#
|
95
|
-
#
|
96
|
-
#
|
97
|
-
#
|
98
|
-
#
|
99
|
-
#
|
100
|
-
#
|
101
|
-
#
|
102
|
-
#
|
103
|
-
#
|
104
|
-
|
105
|
-
|
106
|
-
# === 8. importAddress public_address
|
107
|
-
# To import a non-wallet address on RecordsKeeeper Blockchain
|
108
|
-
#
|
109
|
-
# You have to pass address as argument to the importAddress function call:
|
110
|
-
# * Address: A non-wallet address to import on a particular node
|
111
|
-
# importAddress public_address
|
112
|
-
# response = importAddress public_address # Function call
|
113
|
-
#
|
114
|
-
# puts response # prints response
|
115
|
-
class Address
|
116
|
-
end
|
1
|
+
# = Address Class Usage
|
2
|
+
# This is a library to work with RecordsKeeper block information.
|
3
|
+
# You can generate new address, check all addresses, check address validity, check address permissions, check address balance by using Address class. You just have to pass parameters to invoke the pre-defined functions.
|
4
|
+
# ---------
|
5
|
+
# == Libraries
|
6
|
+
# Require these ruby libraries first to get started with the functionality.
|
7
|
+
# require 'rubygems'
|
8
|
+
# require 'httparty'
|
9
|
+
# require 'json'
|
10
|
+
# require 'binary_parser'
|
11
|
+
# require 'yaml'
|
12
|
+
# -----------------
|
13
|
+
# == Create Connection
|
14
|
+
# Entry point for accessing Address class resources.
|
15
|
+
# * URL: Url to connect to the chain ([RPC Host]:[RPC Port])
|
16
|
+
# * Chain-name: chain name
|
17
|
+
# cfg = YAML::load(File.open('sample_config.yaml','r')) # Loads the configuration file
|
18
|
+
# * Set a *network* value.
|
19
|
+
# network = cfg['network'] # Network variable to store the network that you want to access
|
20
|
+
# * Set url and chain name:
|
21
|
+
# @url = cfg['network']['url']
|
22
|
+
# @chain = cfg['network']['chain']
|
23
|
+
# -------------------
|
24
|
+
# == Node Authentication
|
25
|
+
# Import values from config file.
|
26
|
+
# * User name: The rpc user is used to call the APIs.
|
27
|
+
# * Password: The rpc password is used to authenticate the APIs.
|
28
|
+
# * Set the rpc username and password:
|
29
|
+
# @user = cfg['network']['rkuser']
|
30
|
+
# @password = cfg['network']['passwd']
|
31
|
+
# Now we have node authentication credentials.
|
32
|
+
# ------------
|
33
|
+
# = class Address
|
34
|
+
# Address class is used to call address related functions like generate new address, list all addresses and no of addresses on the node’s wallet, check if given address is valid or not, check if given address has mining permission or not and check a particular address balance on the node functions which are used on the RecordsKeeeper Blockchain.
|
35
|
+
# === 1. getAddress
|
36
|
+
# This function generates a new address on the node wallet.
|
37
|
+
# getAddress
|
38
|
+
# newAddress = getAddress # Function call
|
39
|
+
#
|
40
|
+
# puts newAddress # prints a new address
|
41
|
+
# === 2. getMultisigAddress nrequired, key
|
42
|
+
# This function generates a new multisignature address.
|
43
|
+
#
|
44
|
+
# You have to pass these two arguments to the getMultisigAddress function call:
|
45
|
+
# * nrequired: To pass the no of signatures that are a must to sign a transaction.
|
46
|
+
# * key: To pass any number of comma-separated public addresses that are to be used with this multisig address as a single variable.
|
47
|
+
# getMultisigAddress nrequired, key
|
48
|
+
# newAddress = getMultisigAddress nrequired, key # Function call
|
49
|
+
#
|
50
|
+
# puts newAddress # prints a new address
|
51
|
+
# === 3. getMultisigWalletAddress nrequired, key
|
52
|
+
# This function generates a new multisignature address on the node's wallet.
|
53
|
+
#
|
54
|
+
# You have to pass these two arguments to the getMultisigWalletAddress function call:
|
55
|
+
# * nrequired: This variable is required to pass the number of signatures that are a must to sign a transaction.
|
56
|
+
# * key: This variable is required to pass a string of comma-separated public addresses that are to be used with this multisig address as a single variable.
|
57
|
+
# getMultisigWalletAddress nrequired, key
|
58
|
+
# newAddress = getMultisigWalletAddress nrequired, key # Function call
|
59
|
+
#
|
60
|
+
# puts newAddress #prints a new address
|
61
|
+
# === 4. retrieveAddresses
|
62
|
+
# To list all the addresses and number of addresses on the node's wallet
|
63
|
+
# retrieveAddresses
|
64
|
+
# retrievedinfo = JSON.parse retrieveAddresses # Function call
|
65
|
+
#
|
66
|
+
# puts retrievedinfo['address'] # prints all the addresses of the wallet
|
67
|
+
# puts retrievedinfo['address_count'] # prints the count of addresses in the wallet
|
68
|
+
# === 5. checkifValid address
|
69
|
+
# To check validity of the address
|
70
|
+
#
|
71
|
+
# You have to pass address as argument to the checkifValid function call:
|
72
|
+
# * Address: To check its validity.
|
73
|
+
# checkifValid
|
74
|
+
# addressC = checkifValid address # Function call
|
75
|
+
#
|
76
|
+
# puts addressC # prints validity
|
77
|
+
# === 6. checkifMineAllowed address
|
78
|
+
# To check if given address has mining permission or not
|
79
|
+
#
|
80
|
+
# You have to pass address as argument to the checkifMineAllowed function call:
|
81
|
+
# * Address: To check the permission status
|
82
|
+
# checkifMineAllowed address
|
83
|
+
# permissionCheck = checkifMineAllowed address # Function call
|
84
|
+
#
|
85
|
+
# puts permissionCheck # prints permission status of the given address
|
86
|
+
# === 7. checkBalance address
|
87
|
+
# To check address balance on a particular node
|
88
|
+
#
|
89
|
+
# You have to pass address as argument to the checkifMineAllowed function call:
|
90
|
+
# * Address: To check the balance
|
91
|
+
# checkBalance address
|
92
|
+
# address_balance = checkBalance address # Function call
|
93
|
+
#
|
94
|
+
# puts address_balance # prints balance of the address
|
95
|
+
# === 8. importAddress public_address
|
96
|
+
# To import a non-wallet address on RecordsKeeeper Blockchain
|
97
|
+
#
|
98
|
+
# You have to pass address as argument to the importAddress function call:
|
99
|
+
# * Address: A non-wallet address to import on a particular node
|
100
|
+
# importAddress public_address
|
101
|
+
# response = importAddress public_address # Function call
|
102
|
+
#
|
103
|
+
# puts response # prints response
|
104
|
+
class Address
|
105
|
+
end
|