chainpoint 0.0.3 → 0.0.4
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 +5 -5
- data/.gitignore +0 -1
- data/.idea/copyright/GPLv3_0.xml +6 -0
- data/.idea/copyright/profiles_settings.xml +7 -0
- data/CONTRIBUTING.md +10 -0
- data/Gemfile +4 -0
- data/Gemfile.lock +39 -0
- data/LICENSE +674 -0
- data/README.md +26 -23
- data/docs/Chainpoint.html +1026 -0
- data/docs/_index.html +107 -0
- data/docs/class_list.html +51 -0
- data/docs/css/common.css +1 -0
- data/docs/css/full_list.css +58 -0
- data/docs/css/style.css +496 -0
- data/docs/file.README.html +203 -0
- data/docs/file_list.html +56 -0
- data/docs/frames.html +17 -0
- data/docs/index.html +203 -0
- data/docs/js/app.js +292 -0
- data/docs/js/full_list.js +216 -0
- data/docs/js/jquery.js +4 -0
- data/docs/method_list.html +123 -0
- data/docs/top-level-namespace.html +110 -0
- data/lib/chainpoint.rb +58 -8
- data/lib/chainpoint/version.rb +19 -1
- metadata +22 -2
@@ -0,0 +1,203 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="UTF-8">
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6
|
+
<title>
|
7
|
+
File: README
|
8
|
+
|
9
|
+
— Documentation by YARD 0.9.18
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="css/common.css" type="text/css" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
pathId = "README";
|
19
|
+
relpath = '';
|
20
|
+
</script>
|
21
|
+
|
22
|
+
|
23
|
+
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
|
24
|
+
|
25
|
+
<script type="text/javascript" charset="utf-8" src="js/app.js"></script>
|
26
|
+
|
27
|
+
|
28
|
+
</head>
|
29
|
+
<body>
|
30
|
+
<div class="nav_wrap">
|
31
|
+
<iframe id="nav" src="file_list.html?1"></iframe>
|
32
|
+
<div id="resizer"></div>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div id="main" tabindex="-1">
|
36
|
+
<div id="header">
|
37
|
+
<div id="menu">
|
38
|
+
|
39
|
+
<a href="_index.html">Index</a> »
|
40
|
+
<span class="title">File: README</span>
|
41
|
+
|
42
|
+
</div>
|
43
|
+
|
44
|
+
<div id="search">
|
45
|
+
|
46
|
+
<a class="full_list_link" id="class_list_link"
|
47
|
+
href="class_list.html">
|
48
|
+
|
49
|
+
<svg width="24" height="24">
|
50
|
+
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
51
|
+
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
52
|
+
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
53
|
+
</svg>
|
54
|
+
</a>
|
55
|
+
|
56
|
+
</div>
|
57
|
+
<div class="clear"></div>
|
58
|
+
</div>
|
59
|
+
|
60
|
+
<div id="content"><div id='filecontents'><h1 id="chainpoint">Chainpoint</h1>
|
61
|
+
|
62
|
+
<p><a href="https://badge.fury.io/rb/chainpoint"><img src="https://badge.fury.io/rb/chainpoint.svg" alt="Gem Version" /></a></p>
|
63
|
+
|
64
|
+
<p><a href="https://rubygems.org/gems/chainpoint">Rubygem Page</a></p>
|
65
|
+
|
66
|
+
<p><a href="https://kenjiohtsuka.github.io/chainpoint_gem/">API Document</a></p>
|
67
|
+
|
68
|
+
<p>This is gem for request to Tierion Chainpoint.
|
69
|
+
For Chainpoint, look at <a href="https://github.com/chainpoint/chainpoint-node/wiki/Node-HTTP-API">Chainpoint Node HTTP API</a>.</p>
|
70
|
+
|
71
|
+
<h2 id="installation">Installation</h2>
|
72
|
+
|
73
|
+
<p>Add this line to your application’s Gemfile:</p>
|
74
|
+
|
75
|
+
<p><code>ruby
|
76
|
+
gem 'chainpoint'
|
77
|
+
</code></p>
|
78
|
+
|
79
|
+
<p>And then execute:</p>
|
80
|
+
|
81
|
+
<pre class="code ruby"><code class="ruby">$ bundle
|
82
|
+
</code></pre>
|
83
|
+
|
84
|
+
<p>Or install it yourself as:</p>
|
85
|
+
|
86
|
+
<pre class="code ruby"><code class="ruby">$ gem install chainpoint
|
87
|
+
</code></pre>
|
88
|
+
|
89
|
+
<h2 id="usage">Usage</h2>
|
90
|
+
|
91
|
+
<h3 id="create-instance">Create Instance</h3>
|
92
|
+
|
93
|
+
<p><code>ruby
|
94
|
+
require 'chainpoint'
|
95
|
+
chainpoint = Chainpoint.new
|
96
|
+
</code></p>
|
97
|
+
|
98
|
+
<h3 id="submit-hash">Submit Hash</h3>
|
99
|
+
|
100
|
+
<p><code>ruby
|
101
|
+
# hash is SHA256
|
102
|
+
# hash = '2fbe59be2be10a4fdeca9c6d3e9f56fc56fb3ee9a8ef2e9be37fced60c264681'
|
103
|
+
chainpoint.submit(hash)
|
104
|
+
</code></p>
|
105
|
+
|
106
|
+
<h4 id="response">Response</h4>
|
107
|
+
|
108
|
+
<p>```ruby
|
109
|
+
[
|
110
|
+
{
|
111
|
+
“hash_id_node” => “1d1aa8a0-8f42-11e8-967f-01a68adfc010”,
|
112
|
+
“hash” => “2fbe59be2be10a4fdeca9c6d3e9f56fc56fb3ee9a8ef2e9be37fced60c264681”
|
113
|
+
“uri” => “http://45.77.197.76”
|
114
|
+
}
|
115
|
+
]</p>
|
116
|
+
|
117
|
+
<p>```</p>
|
118
|
+
|
119
|
+
<p>Or, use <code>submit_data</code>:</p>
|
120
|
+
|
121
|
+
<p><code>ruby
|
122
|
+
chainpoint.submit_data("text")
|
123
|
+
</code></p>
|
124
|
+
|
125
|
+
<h3 id="get-proof">Get Proof</h3>
|
126
|
+
|
127
|
+
<p>Only the node that a hash was submitted to can retrieve the proof, so initialize the client with
|
128
|
+
the uri from the submit response and pass the hash_id_node from the same response:</p>
|
129
|
+
|
130
|
+
<p><code>ruby
|
131
|
+
chainpoint = Chainpoint.new('http://45.77.197.76')
|
132
|
+
chainpoint.get_proof(hash_id_node)
|
133
|
+
</code></p>
|
134
|
+
|
135
|
+
<h4 id="response-1">Response</h4>
|
136
|
+
|
137
|
+
<p><code>
|
138
|
+
[
|
139
|
+
{
|
140
|
+
"hash_id_node"=>"a50eb4d0-8f20-11e8-8da8-0133565a0e60",
|
141
|
+
"proof"=>"eJyNVMGOHDUQ5SP4BI7MTpXLLtt9Wolf4JTLyC6XmZaWmdF0JyHHhAtH9hMgizYgLkgoR/5jJD6G6tlN0O6ClEN3q22/V69cr+qHd5ey38363fzXdp4P07Bev6SxXeyP36xlW8bdYT/u5vULuplfHfS3rz4u3WzLtD1dul415KquKkLxvamULNxIcw/cxZ5Kqrkk7U7tIMUu2hjEseeEvy80m7Ftdvumpy9KAK2+wSp1BytETavUSloBEgUOBZTh/RkyPa/fjvOsd8hNmf90gHYwrpz/GvIAYQB49pFe9seFPoEXCg/oMxSjl9icBldLeEy/IP+bPjx7V49lJ1udrt/8clWqXv0h5WqzLO2Pm7u9t/vD9Pdnn7/+6er05Vnp2IZPyfL1z/vD7bQtKxf4DD7rWMCfkMNj8I+7cZoHDOS8I/AwtBijbx08Bo1aNUPKDTxV7uQoOQ6JtFLqQcEqlynVXtmD1wa5umhlpViJXER2JTTA0JisotC8OKeVMVgmkaVnAUQObCCreQJK9nos8NJ7xS4ZmIu65ok8lALdfNMFU0mYkodmvkKq3jF5VukSu0fhQFEeEh5Pl4196GjZmi89InaS1LnZr7rQagWDmRhkAo5UpMZumwAVs4+a6hPCnDGbex1LK8Bm94TYcs/dW7ZCuWVEqAGc3S9HbdW4oPvlE13P/ISwphyyL+yT3Wlk5hwqhhTsvq0zavApaFMO6HO09J1a7fpC3RGaRH1CyLFbGTwZh6+lcGzeBIWUk5fMORfruu5IQgZXoZnPzNN9KfkSMj5xTbYUncvxg3GsjAMOH8aEXPw7H5ZxMZj1h3vEWY5YEPOzqki3wKU5cz0hSEiNkwjXDsRm/CKliSegiFhRTf9isPJAzu1dU03X358H0VsL9ut9n43t9j7szfPjOF2fLv5P4tpQumvluL4HrJde/wcFK5lW",
|
142
|
+
"anchors_complete"=>["cal"]
|
143
|
+
}
|
144
|
+
]
|
145
|
+
</code></p>
|
146
|
+
|
147
|
+
<h3 id="verify">Verify</h3>
|
148
|
+
|
149
|
+
<p>Pass proof value which is shown on calling <code>get_proof</code>.</p>
|
150
|
+
|
151
|
+
<p><code>ruby
|
152
|
+
c.verify('eJyNVMGOHDUQ5SP4BI7MTpXLLtt9Wolf4JTLyC6XmZaWmdF0JyHHhAtH9hMgizYgLkgoR/5jJD6G6tlN0O6ClEN3q22/V69cr+qHd5ey38363fzXdp4P07Bev6SxXeyP36xlW8bdYT/u5vULuplfHfS3rz4u3WzLtD1dul415KquKkLxvamULNxIcw/cxZ5Kqrkk7U7tIMUu2hjEseeEvy80m7Ftdvumpy9KAK2+wSp1BytETavUSloBEgUOBZTh/RkyPa/fjvOsd8hNmf90gHYwrpz/GvIAYQB49pFe9seFPoEXCg/oMxSjl9icBldLeEy/IP+bPjx7V49lJ1udrt/8clWqXv0h5WqzLO2Pm7u9t/vD9Pdnn7/+6er05Vnp2IZPyfL1z/vD7bQtKxf4DD7rWMCfkMNj8I+7cZoHDOS8I/AwtBijbx08Bo1aNUPKDTxV7uQoOQ6JtFLqQcEqlynVXtmD1wa5umhlpViJXER2JTTA0JisotC8OKeVMVgmkaVnAUQObCCreQJK9nos8NJ7xS4ZmIu65ok8lALdfNMFU0mYkodmvkKq3jF5VukSu0fhQFEeEh5Pl4196GjZmi89InaS1LnZr7rQagWDmRhkAo5UpMZumwAVs4+a6hPCnDGbex1LK8Bm94TYcs/dW7ZCuWVEqAGc3S9HbdW4oPvlE13P/ISwphyyL+yT3Wlk5hwqhhTsvq0zavApaFMO6HO09J1a7fpC3RGaRH1CyLFbGTwZh6+lcGzeBIWUk5fMORfruu5IQgZXoZnPzNN9KfkSMj5xTbYUncvxg3GsjAMOH8aEXPw7H5ZxMZj1h3vEWY5YEPOzqki3wKU5cz0hSEiNkwjXDsRm/CKliSegiFhRTf9isPJAzu1dU03X358H0VsL9ut9n43t9j7szfPjOF2fLv5P4tpQumvluL4HrJde/wcFK5lW')
|
153
|
+
</code></p>
|
154
|
+
|
155
|
+
<h4 id="response-2">Response</h4>
|
156
|
+
|
157
|
+
<p><code>ruby
|
158
|
+
[
|
159
|
+
{
|
160
|
+
"proof_index"=>0,
|
161
|
+
"hash"=>"2fbe59be2be10a4fdeca9c6d3e9f56fc56fb3ee9a8ef2e9be37fced60c264681",
|
162
|
+
"hash_id_node"=>"a50eb4d0-8f20-11e8-8da8-0133565a0e60",
|
163
|
+
"hash_submitted_node_at"=>"2018-07-24T09:05:00Z",
|
164
|
+
"hash_id_core"=>"a804c350-8f20-11e8-890a-01c7d2e52ba5",
|
165
|
+
"hash_submitted_core_at"=>"2018-07-24T09:05:05Z",
|
166
|
+
"anchors"=>[
|
167
|
+
{
|
168
|
+
"branch"=>"cal_anchor_branch",
|
169
|
+
"type"=>"cal",
|
170
|
+
"valid"=>true
|
171
|
+
}
|
172
|
+
],
|
173
|
+
"status"=>"verified"
|
174
|
+
}
|
175
|
+
]
|
176
|
+
</code></p>
|
177
|
+
|
178
|
+
<h2 id="development">Development</h2>
|
179
|
+
|
180
|
+
<p>After checking out the repo, run <code>bin/setup</code> to install dependencies. Then, run <code>rake spec</code> to run the tests. You can also run <code>bin/console</code> for an interactive prompt that will allow you to experiment.</p>
|
181
|
+
|
182
|
+
<p>To install this gem onto your local machine, run <code>bundle exec rake install</code>. To release a new version, update the version number in <code>version.rb</code>, and then run <code>bundle exec rake release</code>, which will create a git tag for the version, push git commits and tags, and push the <code>.gem</code> file to <a href="https://rubygems.org">rubygems.org</a>.</p>
|
183
|
+
|
184
|
+
<h2 id="contributing">Contributing</h2>
|
185
|
+
|
186
|
+
<p>Bug reports and pull requests are welcome on <a href="https://github.com/KenjiOhtsuka/chainpoint_gem">GitHub chainpoint</a>.</p>
|
187
|
+
|
188
|
+
<h2 id="other">Other</h2>
|
189
|
+
|
190
|
+
<ul>
|
191
|
+
<li>PHP <a href="https://packagist.org/packages/kenji-otsuka/chainpoint">Composer Package</a> and its <a href="https://github.com/KenjiOhtsuka/chainpoint_php">GitHub Repository</a>.</li>
|
192
|
+
</ul>
|
193
|
+
</div></div>
|
194
|
+
|
195
|
+
<div id="footer">
|
196
|
+
Generated on Thu Mar 28 19:30:06 2019 by
|
197
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
198
|
+
0.9.18 (ruby-2.5.1).
|
199
|
+
</div>
|
200
|
+
|
201
|
+
</div>
|
202
|
+
</body>
|
203
|
+
</html>
|
data/docs/file_list.html
ADDED
@@ -0,0 +1,56 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
5
|
+
<meta charset="utf-8" />
|
6
|
+
|
7
|
+
<link rel="stylesheet" href="css/full_list.css" type="text/css" media="screen" charset="utf-8" />
|
8
|
+
|
9
|
+
<link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
|
14
|
+
|
15
|
+
<script type="text/javascript" charset="utf-8" src="js/full_list.js"></script>
|
16
|
+
|
17
|
+
|
18
|
+
<title>File List</title>
|
19
|
+
<base id="base_target" target="_parent" />
|
20
|
+
</head>
|
21
|
+
<body>
|
22
|
+
<div id="content">
|
23
|
+
<div class="fixed_header">
|
24
|
+
<h1 id="full_list_header">File List</h1>
|
25
|
+
<div id="full_list_nav">
|
26
|
+
|
27
|
+
<span><a target="_self" href="class_list.html">
|
28
|
+
Classes
|
29
|
+
</a></span>
|
30
|
+
|
31
|
+
<span><a target="_self" href="method_list.html">
|
32
|
+
Methods
|
33
|
+
</a></span>
|
34
|
+
|
35
|
+
<span><a target="_self" href="file_list.html">
|
36
|
+
Files
|
37
|
+
</a></span>
|
38
|
+
|
39
|
+
</div>
|
40
|
+
|
41
|
+
<div id="search">Search: <input type="text" /></div>
|
42
|
+
</div>
|
43
|
+
|
44
|
+
<ul id="full_list" class="file">
|
45
|
+
|
46
|
+
|
47
|
+
<li id="object_README" class="odd">
|
48
|
+
<div class="item"><span class="object_link"><a href="index.html" title="README">README</a></span></div>
|
49
|
+
</li>
|
50
|
+
|
51
|
+
|
52
|
+
|
53
|
+
</ul>
|
54
|
+
</div>
|
55
|
+
</body>
|
56
|
+
</html>
|
data/docs/frames.html
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<title>Documentation by YARD 0.9.18</title>
|
6
|
+
</head>
|
7
|
+
<script type="text/javascript" charset="utf-8">
|
8
|
+
var match = unescape(window.location.hash).match(/^#!(.+)/);
|
9
|
+
var name = match ? match[1] : 'index.html';
|
10
|
+
name = name.replace(/^(\w+):\/\//, '').replace(/^\/\//, '');
|
11
|
+
window.top.location = name;
|
12
|
+
</script>
|
13
|
+
<noscript>
|
14
|
+
<h1>Oops!</h1>
|
15
|
+
<h2>YARD requires JavaScript!</h2>
|
16
|
+
</noscript>
|
17
|
+
</html>
|
data/docs/index.html
ADDED
@@ -0,0 +1,203 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="UTF-8">
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6
|
+
<title>
|
7
|
+
File: README
|
8
|
+
|
9
|
+
— Documentation by YARD 0.9.18
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="css/common.css" type="text/css" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
pathId = "README";
|
19
|
+
relpath = '';
|
20
|
+
</script>
|
21
|
+
|
22
|
+
|
23
|
+
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
|
24
|
+
|
25
|
+
<script type="text/javascript" charset="utf-8" src="js/app.js"></script>
|
26
|
+
|
27
|
+
|
28
|
+
</head>
|
29
|
+
<body>
|
30
|
+
<div class="nav_wrap">
|
31
|
+
<iframe id="nav" src="class_list.html?1"></iframe>
|
32
|
+
<div id="resizer"></div>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div id="main" tabindex="-1">
|
36
|
+
<div id="header">
|
37
|
+
<div id="menu">
|
38
|
+
|
39
|
+
<a href="_index.html">Index</a> »
|
40
|
+
<span class="title">File: README</span>
|
41
|
+
|
42
|
+
</div>
|
43
|
+
|
44
|
+
<div id="search">
|
45
|
+
|
46
|
+
<a class="full_list_link" id="class_list_link"
|
47
|
+
href="class_list.html">
|
48
|
+
|
49
|
+
<svg width="24" height="24">
|
50
|
+
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
51
|
+
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
52
|
+
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
53
|
+
</svg>
|
54
|
+
</a>
|
55
|
+
|
56
|
+
</div>
|
57
|
+
<div class="clear"></div>
|
58
|
+
</div>
|
59
|
+
|
60
|
+
<div id="content"><div id='filecontents'><h1 id="chainpoint">Chainpoint</h1>
|
61
|
+
|
62
|
+
<p><a href="https://badge.fury.io/rb/chainpoint"><img src="https://badge.fury.io/rb/chainpoint.svg" alt="Gem Version" /></a></p>
|
63
|
+
|
64
|
+
<p><a href="https://rubygems.org/gems/chainpoint">Rubygem Page</a></p>
|
65
|
+
|
66
|
+
<p><a href="https://kenjiohtsuka.github.io/chainpoint_gem/">API Document</a></p>
|
67
|
+
|
68
|
+
<p>This is gem for request to Tierion Chainpoint.
|
69
|
+
For Chainpoint, look at <a href="https://github.com/chainpoint/chainpoint-node/wiki/Node-HTTP-API">Chainpoint Node HTTP API</a>.</p>
|
70
|
+
|
71
|
+
<h2 id="installation">Installation</h2>
|
72
|
+
|
73
|
+
<p>Add this line to your application’s Gemfile:</p>
|
74
|
+
|
75
|
+
<p><code>ruby
|
76
|
+
gem 'chainpoint'
|
77
|
+
</code></p>
|
78
|
+
|
79
|
+
<p>And then execute:</p>
|
80
|
+
|
81
|
+
<pre class="code ruby"><code class="ruby">$ bundle
|
82
|
+
</code></pre>
|
83
|
+
|
84
|
+
<p>Or install it yourself as:</p>
|
85
|
+
|
86
|
+
<pre class="code ruby"><code class="ruby">$ gem install chainpoint
|
87
|
+
</code></pre>
|
88
|
+
|
89
|
+
<h2 id="usage">Usage</h2>
|
90
|
+
|
91
|
+
<h3 id="create-instance">Create Instance</h3>
|
92
|
+
|
93
|
+
<p><code>ruby
|
94
|
+
require 'chainpoint'
|
95
|
+
chainpoint = Chainpoint.new
|
96
|
+
</code></p>
|
97
|
+
|
98
|
+
<h3 id="submit-hash">Submit Hash</h3>
|
99
|
+
|
100
|
+
<p><code>ruby
|
101
|
+
# hash is SHA256
|
102
|
+
# hash = '2fbe59be2be10a4fdeca9c6d3e9f56fc56fb3ee9a8ef2e9be37fced60c264681'
|
103
|
+
chainpoint.submit(hash)
|
104
|
+
</code></p>
|
105
|
+
|
106
|
+
<h4 id="response">Response</h4>
|
107
|
+
|
108
|
+
<p>```ruby
|
109
|
+
[
|
110
|
+
{
|
111
|
+
“hash_id_node” => “1d1aa8a0-8f42-11e8-967f-01a68adfc010”,
|
112
|
+
“hash” => “2fbe59be2be10a4fdeca9c6d3e9f56fc56fb3ee9a8ef2e9be37fced60c264681”
|
113
|
+
“uri” => “http://45.77.197.76”
|
114
|
+
}
|
115
|
+
]</p>
|
116
|
+
|
117
|
+
<p>```</p>
|
118
|
+
|
119
|
+
<p>Or, use <code>submit_data</code>:</p>
|
120
|
+
|
121
|
+
<p><code>ruby
|
122
|
+
chainpoint.submit_data("text")
|
123
|
+
</code></p>
|
124
|
+
|
125
|
+
<h3 id="get-proof">Get Proof</h3>
|
126
|
+
|
127
|
+
<p>Only the node that a hash was submitted to can retrieve the proof, so initialize the client with
|
128
|
+
the uri from the submit response and pass the hash_id_node from the same response:</p>
|
129
|
+
|
130
|
+
<p><code>ruby
|
131
|
+
chainpoint = Chainpoint.new('http://45.77.197.76')
|
132
|
+
chainpoint.get_proof(hash_id_node)
|
133
|
+
</code></p>
|
134
|
+
|
135
|
+
<h4 id="response-1">Response</h4>
|
136
|
+
|
137
|
+
<p><code>
|
138
|
+
[
|
139
|
+
{
|
140
|
+
"hash_id_node"=>"a50eb4d0-8f20-11e8-8da8-0133565a0e60",
|
141
|
+
"proof"=>"eJyNVMGOHDUQ5SP4BI7MTpXLLtt9Wolf4JTLyC6XmZaWmdF0JyHHhAtH9hMgizYgLkgoR/5jJD6G6tlN0O6ClEN3q22/V69cr+qHd5ey38363fzXdp4P07Bev6SxXeyP36xlW8bdYT/u5vULuplfHfS3rz4u3WzLtD1dul415KquKkLxvamULNxIcw/cxZ5Kqrkk7U7tIMUu2hjEseeEvy80m7Ftdvumpy9KAK2+wSp1BytETavUSloBEgUOBZTh/RkyPa/fjvOsd8hNmf90gHYwrpz/GvIAYQB49pFe9seFPoEXCg/oMxSjl9icBldLeEy/IP+bPjx7V49lJ1udrt/8clWqXv0h5WqzLO2Pm7u9t/vD9Pdnn7/+6er05Vnp2IZPyfL1z/vD7bQtKxf4DD7rWMCfkMNj8I+7cZoHDOS8I/AwtBijbx08Bo1aNUPKDTxV7uQoOQ6JtFLqQcEqlynVXtmD1wa5umhlpViJXER2JTTA0JisotC8OKeVMVgmkaVnAUQObCCreQJK9nos8NJ7xS4ZmIu65ok8lALdfNMFU0mYkodmvkKq3jF5VukSu0fhQFEeEh5Pl4196GjZmi89InaS1LnZr7rQagWDmRhkAo5UpMZumwAVs4+a6hPCnDGbex1LK8Bm94TYcs/dW7ZCuWVEqAGc3S9HbdW4oPvlE13P/ISwphyyL+yT3Wlk5hwqhhTsvq0zavApaFMO6HO09J1a7fpC3RGaRH1CyLFbGTwZh6+lcGzeBIWUk5fMORfruu5IQgZXoZnPzNN9KfkSMj5xTbYUncvxg3GsjAMOH8aEXPw7H5ZxMZj1h3vEWY5YEPOzqki3wKU5cz0hSEiNkwjXDsRm/CKliSegiFhRTf9isPJAzu1dU03X358H0VsL9ut9n43t9j7szfPjOF2fLv5P4tpQumvluL4HrJde/wcFK5lW",
|
142
|
+
"anchors_complete"=>["cal"]
|
143
|
+
}
|
144
|
+
]
|
145
|
+
</code></p>
|
146
|
+
|
147
|
+
<h3 id="verify">Verify</h3>
|
148
|
+
|
149
|
+
<p>Pass proof value which is shown on calling <code>get_proof</code>.</p>
|
150
|
+
|
151
|
+
<p><code>ruby
|
152
|
+
c.verify('eJyNVMGOHDUQ5SP4BI7MTpXLLtt9Wolf4JTLyC6XmZaWmdF0JyHHhAtH9hMgizYgLkgoR/5jJD6G6tlN0O6ClEN3q22/V69cr+qHd5ey38363fzXdp4P07Bev6SxXeyP36xlW8bdYT/u5vULuplfHfS3rz4u3WzLtD1dul415KquKkLxvamULNxIcw/cxZ5Kqrkk7U7tIMUu2hjEseeEvy80m7Ftdvumpy9KAK2+wSp1BytETavUSloBEgUOBZTh/RkyPa/fjvOsd8hNmf90gHYwrpz/GvIAYQB49pFe9seFPoEXCg/oMxSjl9icBldLeEy/IP+bPjx7V49lJ1udrt/8clWqXv0h5WqzLO2Pm7u9t/vD9Pdnn7/+6er05Vnp2IZPyfL1z/vD7bQtKxf4DD7rWMCfkMNj8I+7cZoHDOS8I/AwtBijbx08Bo1aNUPKDTxV7uQoOQ6JtFLqQcEqlynVXtmD1wa5umhlpViJXER2JTTA0JisotC8OKeVMVgmkaVnAUQObCCreQJK9nos8NJ7xS4ZmIu65ok8lALdfNMFU0mYkodmvkKq3jF5VukSu0fhQFEeEh5Pl4196GjZmi89InaS1LnZr7rQagWDmRhkAo5UpMZumwAVs4+a6hPCnDGbex1LK8Bm94TYcs/dW7ZCuWVEqAGc3S9HbdW4oPvlE13P/ISwphyyL+yT3Wlk5hwqhhTsvq0zavApaFMO6HO09J1a7fpC3RGaRH1CyLFbGTwZh6+lcGzeBIWUk5fMORfruu5IQgZXoZnPzNN9KfkSMj5xTbYUncvxg3GsjAMOH8aEXPw7H5ZxMZj1h3vEWY5YEPOzqki3wKU5cz0hSEiNkwjXDsRm/CKliSegiFhRTf9isPJAzu1dU03X358H0VsL9ut9n43t9j7szfPjOF2fLv5P4tpQumvluL4HrJde/wcFK5lW')
|
153
|
+
</code></p>
|
154
|
+
|
155
|
+
<h4 id="response-2">Response</h4>
|
156
|
+
|
157
|
+
<p><code>ruby
|
158
|
+
[
|
159
|
+
{
|
160
|
+
"proof_index"=>0,
|
161
|
+
"hash"=>"2fbe59be2be10a4fdeca9c6d3e9f56fc56fb3ee9a8ef2e9be37fced60c264681",
|
162
|
+
"hash_id_node"=>"a50eb4d0-8f20-11e8-8da8-0133565a0e60",
|
163
|
+
"hash_submitted_node_at"=>"2018-07-24T09:05:00Z",
|
164
|
+
"hash_id_core"=>"a804c350-8f20-11e8-890a-01c7d2e52ba5",
|
165
|
+
"hash_submitted_core_at"=>"2018-07-24T09:05:05Z",
|
166
|
+
"anchors"=>[
|
167
|
+
{
|
168
|
+
"branch"=>"cal_anchor_branch",
|
169
|
+
"type"=>"cal",
|
170
|
+
"valid"=>true
|
171
|
+
}
|
172
|
+
],
|
173
|
+
"status"=>"verified"
|
174
|
+
}
|
175
|
+
]
|
176
|
+
</code></p>
|
177
|
+
|
178
|
+
<h2 id="development">Development</h2>
|
179
|
+
|
180
|
+
<p>After checking out the repo, run <code>bin/setup</code> to install dependencies. Then, run <code>rake spec</code> to run the tests. You can also run <code>bin/console</code> for an interactive prompt that will allow you to experiment.</p>
|
181
|
+
|
182
|
+
<p>To install this gem onto your local machine, run <code>bundle exec rake install</code>. To release a new version, update the version number in <code>version.rb</code>, and then run <code>bundle exec rake release</code>, which will create a git tag for the version, push git commits and tags, and push the <code>.gem</code> file to <a href="https://rubygems.org">rubygems.org</a>.</p>
|
183
|
+
|
184
|
+
<h2 id="contributing">Contributing</h2>
|
185
|
+
|
186
|
+
<p>Bug reports and pull requests are welcome on <a href="https://github.com/KenjiOhtsuka/chainpoint_gem">GitHub chainpoint</a>.</p>
|
187
|
+
|
188
|
+
<h2 id="other">Other</h2>
|
189
|
+
|
190
|
+
<ul>
|
191
|
+
<li>PHP <a href="https://packagist.org/packages/kenji-otsuka/chainpoint">Composer Package</a> and its <a href="https://github.com/KenjiOhtsuka/chainpoint_php">GitHub Repository</a>.</li>
|
192
|
+
</ul>
|
193
|
+
</div></div>
|
194
|
+
|
195
|
+
<div id="footer">
|
196
|
+
Generated on Thu Mar 28 19:30:06 2019 by
|
197
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
198
|
+
0.9.18 (ruby-2.5.1).
|
199
|
+
</div>
|
200
|
+
|
201
|
+
</div>
|
202
|
+
</body>
|
203
|
+
</html>
|