nanook 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (189) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/lib/nanook/version.rb +1 -1
  4. data/nanook.gemspec +1 -1
  5. metadata +1 -185
  6. data/docs/0.7.0/apple-touch-icon.png +0 -0
  7. data/docs/0.7.0/classes/Nanook.html +0 -572
  8. data/docs/0.7.0/classes/Nanook/Account.html +0 -909
  9. data/docs/0.7.0/classes/Nanook/Block.html +0 -717
  10. data/docs/0.7.0/classes/Nanook/Error.html +0 -84
  11. data/docs/0.7.0/classes/Nanook/Key.html +0 -253
  12. data/docs/0.7.0/classes/Nanook/Node.html +0 -657
  13. data/docs/0.7.0/classes/Nanook/Rpc.html +0 -247
  14. data/docs/0.7.0/classes/Nanook/Util.html +0 -197
  15. data/docs/0.7.0/classes/Nanook/Wallet.html +0 -986
  16. data/docs/0.7.0/classes/Nanook/WalletAccount.html +0 -446
  17. data/docs/0.7.0/classes/Nanook/WorkPeer.html +0 -294
  18. data/docs/0.7.0/created.rid +0 -14
  19. data/docs/0.7.0/css/github.css +0 -123
  20. data/docs/0.7.0/css/main.css +0 -374
  21. data/docs/0.7.0/css/panel.css +0 -360
  22. data/docs/0.7.0/css/reset.css +0 -48
  23. data/docs/0.7.0/favicon.ico +0 -0
  24. data/docs/0.7.0/files/README_md.html +0 -418
  25. data/docs/0.7.0/files/lib/nanook/account_rb.html +0 -89
  26. data/docs/0.7.0/files/lib/nanook/block_rb.html +0 -89
  27. data/docs/0.7.0/files/lib/nanook/error_rb.html +0 -89
  28. data/docs/0.7.0/files/lib/nanook/key_rb.html +0 -89
  29. data/docs/0.7.0/files/lib/nanook/node_rb.html +0 -89
  30. data/docs/0.7.0/files/lib/nanook/rpc_rb.html +0 -99
  31. data/docs/0.7.0/files/lib/nanook/util_rb.html +0 -89
  32. data/docs/0.7.0/files/lib/nanook/version_rb.html +0 -84
  33. data/docs/0.7.0/files/lib/nanook/wallet_account_rb.html +0 -89
  34. data/docs/0.7.0/files/lib/nanook/wallet_rb.html +0 -89
  35. data/docs/0.7.0/files/lib/nanook/work_peer_rb.html +0 -89
  36. data/docs/0.7.0/files/lib/nanook_rb.html +0 -94
  37. data/docs/0.7.0/i/arrow-down.svg +0 -8
  38. data/docs/0.7.0/i/arrow-right.svg +0 -8
  39. data/docs/0.7.0/i/search.svg +0 -12
  40. data/docs/0.7.0/i/tree_bg.svg +0 -8
  41. data/docs/0.7.0/index.html +0 -11
  42. data/docs/0.7.0/js/highlight.pack.js +0 -1
  43. data/docs/0.7.0/js/jquery-1.3.2.min.js +0 -19
  44. data/docs/0.7.0/js/main.js +0 -25
  45. data/docs/0.7.0/js/navigation.js +0 -142
  46. data/docs/0.7.0/js/search_index.js +0 -1
  47. data/docs/0.7.0/js/searchdoc.js +0 -465
  48. data/docs/0.7.0/js/searcher.js +0 -229
  49. data/docs/0.7.0/panel/index.html +0 -47
  50. data/docs/0.7.0/panel/links.html +0 -32
  51. data/docs/0.7.0/panel/tree.js +0 -1
  52. data/docs/0.8.0/apple-touch-icon.png +0 -0
  53. data/docs/0.8.0/classes/Nanook.html +0 -621
  54. data/docs/0.8.0/classes/Nanook/Account.html +0 -971
  55. data/docs/0.8.0/classes/Nanook/Block.html +0 -759
  56. data/docs/0.8.0/classes/Nanook/Error.html +0 -84
  57. data/docs/0.8.0/classes/Nanook/Key.html +0 -295
  58. data/docs/0.8.0/classes/Nanook/Node.html +0 -657
  59. data/docs/0.8.0/classes/Nanook/Rpc.html +0 -247
  60. data/docs/0.8.0/classes/Nanook/Util.html +0 -264
  61. data/docs/0.8.0/classes/Nanook/Wallet.html +0 -1056
  62. data/docs/0.8.0/classes/Nanook/WalletAccount.html +0 -582
  63. data/docs/0.8.0/classes/Nanook/WorkPeer.html +0 -294
  64. data/docs/0.8.0/created.rid +0 -14
  65. data/docs/0.8.0/css/github.css +0 -123
  66. data/docs/0.8.0/css/main.css +0 -374
  67. data/docs/0.8.0/css/panel.css +0 -360
  68. data/docs/0.8.0/css/reset.css +0 -48
  69. data/docs/0.8.0/favicon.ico +0 -0
  70. data/docs/0.8.0/files/README_md.html +0 -423
  71. data/docs/0.8.0/files/lib/nanook/account_rb.html +0 -89
  72. data/docs/0.8.0/files/lib/nanook/block_rb.html +0 -89
  73. data/docs/0.8.0/files/lib/nanook/error_rb.html +0 -89
  74. data/docs/0.8.0/files/lib/nanook/key_rb.html +0 -89
  75. data/docs/0.8.0/files/lib/nanook/node_rb.html +0 -89
  76. data/docs/0.8.0/files/lib/nanook/rpc_rb.html +0 -99
  77. data/docs/0.8.0/files/lib/nanook/util_rb.html +0 -97
  78. data/docs/0.8.0/files/lib/nanook/version_rb.html +0 -84
  79. data/docs/0.8.0/files/lib/nanook/wallet_account_rb.html +0 -89
  80. data/docs/0.8.0/files/lib/nanook/wallet_rb.html +0 -89
  81. data/docs/0.8.0/files/lib/nanook/work_peer_rb.html +0 -89
  82. data/docs/0.8.0/files/lib/nanook_rb.html +0 -94
  83. data/docs/0.8.0/i/arrow-down.svg +0 -8
  84. data/docs/0.8.0/i/arrow-right.svg +0 -8
  85. data/docs/0.8.0/i/search.svg +0 -12
  86. data/docs/0.8.0/i/tree_bg.svg +0 -8
  87. data/docs/0.8.0/index.html +0 -11
  88. data/docs/0.8.0/js/highlight.pack.js +0 -1
  89. data/docs/0.8.0/js/jquery-1.3.2.min.js +0 -19
  90. data/docs/0.8.0/js/main.js +0 -25
  91. data/docs/0.8.0/js/navigation.js +0 -142
  92. data/docs/0.8.0/js/search_index.js +0 -1
  93. data/docs/0.8.0/js/searchdoc.js +0 -465
  94. data/docs/0.8.0/js/searcher.js +0 -229
  95. data/docs/0.8.0/panel/index.html +0 -47
  96. data/docs/0.8.0/panel/links.html +0 -32
  97. data/docs/0.8.0/panel/tree.js +0 -1
  98. data/docs/1.0.0/apple-touch-icon.png +0 -0
  99. data/docs/1.0.0/classes/Nanook.html +0 -621
  100. data/docs/1.0.0/classes/Nanook/Account.html +0 -989
  101. data/docs/1.0.0/classes/Nanook/Block.html +0 -929
  102. data/docs/1.0.0/classes/Nanook/Error.html +0 -84
  103. data/docs/1.0.0/classes/Nanook/Key.html +0 -295
  104. data/docs/1.0.0/classes/Nanook/Node.html +0 -657
  105. data/docs/1.0.0/classes/Nanook/Rpc.html +0 -247
  106. data/docs/1.0.0/classes/Nanook/Util.html +0 -264
  107. data/docs/1.0.0/classes/Nanook/Wallet.html +0 -1084
  108. data/docs/1.0.0/classes/Nanook/WalletAccount.html +0 -582
  109. data/docs/1.0.0/classes/Nanook/WorkPeer.html +0 -294
  110. data/docs/1.0.0/created.rid +0 -14
  111. data/docs/1.0.0/css/github.css +0 -123
  112. data/docs/1.0.0/css/main.css +0 -374
  113. data/docs/1.0.0/css/panel.css +0 -360
  114. data/docs/1.0.0/css/reset.css +0 -48
  115. data/docs/1.0.0/favicon.ico +0 -0
  116. data/docs/1.0.0/files/README_md.html +0 -443
  117. data/docs/1.0.0/files/lib/nanook/account_rb.html +0 -89
  118. data/docs/1.0.0/files/lib/nanook/block_rb.html +0 -89
  119. data/docs/1.0.0/files/lib/nanook/error_rb.html +0 -89
  120. data/docs/1.0.0/files/lib/nanook/key_rb.html +0 -89
  121. data/docs/1.0.0/files/lib/nanook/node_rb.html +0 -89
  122. data/docs/1.0.0/files/lib/nanook/rpc_rb.html +0 -99
  123. data/docs/1.0.0/files/lib/nanook/util_rb.html +0 -97
  124. data/docs/1.0.0/files/lib/nanook/version_rb.html +0 -84
  125. data/docs/1.0.0/files/lib/nanook/wallet_account_rb.html +0 -89
  126. data/docs/1.0.0/files/lib/nanook/wallet_rb.html +0 -89
  127. data/docs/1.0.0/files/lib/nanook/work_peer_rb.html +0 -89
  128. data/docs/1.0.0/files/lib/nanook_rb.html +0 -94
  129. data/docs/1.0.0/i/arrow-down.svg +0 -8
  130. data/docs/1.0.0/i/arrow-right.svg +0 -8
  131. data/docs/1.0.0/i/search.svg +0 -12
  132. data/docs/1.0.0/i/tree_bg.svg +0 -8
  133. data/docs/1.0.0/index.html +0 -11
  134. data/docs/1.0.0/js/highlight.pack.js +0 -1
  135. data/docs/1.0.0/js/jquery-1.3.2.min.js +0 -19
  136. data/docs/1.0.0/js/main.js +0 -25
  137. data/docs/1.0.0/js/navigation.js +0 -142
  138. data/docs/1.0.0/js/search_index.js +0 -1
  139. data/docs/1.0.0/js/searchdoc.js +0 -465
  140. data/docs/1.0.0/js/searcher.js +0 -229
  141. data/docs/1.0.0/panel/index.html +0 -47
  142. data/docs/1.0.0/panel/links.html +0 -32
  143. data/docs/1.0.0/panel/tree.js +0 -1
  144. data/docs/apple-touch-icon.png +0 -0
  145. data/docs/classes/Nanook.html +0 -572
  146. data/docs/classes/Nanook/Account.html +0 -907
  147. data/docs/classes/Nanook/Block.html +0 -717
  148. data/docs/classes/Nanook/Error.html +0 -84
  149. data/docs/classes/Nanook/Key.html +0 -253
  150. data/docs/classes/Nanook/Node.html +0 -657
  151. data/docs/classes/Nanook/Rpc.html +0 -247
  152. data/docs/classes/Nanook/Util.html +0 -197
  153. data/docs/classes/Nanook/Wallet.html +0 -778
  154. data/docs/classes/Nanook/WalletAccount.html +0 -447
  155. data/docs/classes/Nanook/WorkPeer.html +0 -294
  156. data/docs/created.rid +0 -14
  157. data/docs/css/github.css +0 -123
  158. data/docs/css/main.css +0 -374
  159. data/docs/css/panel.css +0 -360
  160. data/docs/css/reset.css +0 -48
  161. data/docs/favicon.ico +0 -0
  162. data/docs/files/README_md.html +0 -408
  163. data/docs/files/lib/nanook/account_rb.html +0 -89
  164. data/docs/files/lib/nanook/block_rb.html +0 -89
  165. data/docs/files/lib/nanook/error_rb.html +0 -89
  166. data/docs/files/lib/nanook/key_rb.html +0 -89
  167. data/docs/files/lib/nanook/node_rb.html +0 -89
  168. data/docs/files/lib/nanook/rpc_rb.html +0 -99
  169. data/docs/files/lib/nanook/util_rb.html +0 -89
  170. data/docs/files/lib/nanook/version_rb.html +0 -84
  171. data/docs/files/lib/nanook/wallet_account_rb.html +0 -89
  172. data/docs/files/lib/nanook/wallet_rb.html +0 -89
  173. data/docs/files/lib/nanook/work_peer_rb.html +0 -89
  174. data/docs/files/lib/nanook_rb.html +0 -94
  175. data/docs/i/arrow-down.svg +0 -8
  176. data/docs/i/arrow-right.svg +0 -8
  177. data/docs/i/search.svg +0 -12
  178. data/docs/i/tree_bg.svg +0 -8
  179. data/docs/index.html +0 -11
  180. data/docs/js/highlight.pack.js +0 -1
  181. data/docs/js/jquery-1.3.2.min.js +0 -19
  182. data/docs/js/main.js +0 -25
  183. data/docs/js/navigation.js +0 -142
  184. data/docs/js/search_index.js +0 -1
  185. data/docs/js/searchdoc.js +0 -465
  186. data/docs/js/searcher.js +0 -229
  187. data/docs/panel/index.html +0 -47
  188. data/docs/panel/links.html +0 -32
  189. data/docs/panel/tree.js +0 -1
@@ -1,929 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <title>Nanook::Block</title>
5
- <meta charset="UTF-8" />
6
- <link rel="stylesheet" href="../../css/reset.css" type="text/css" media="screen" />
7
- <link rel="stylesheet" href="../../css/main.css" type="text/css" media="screen" />
8
- <link rel="stylesheet" href="../../css/github.css" type="text/css" media="screen" />
9
- <script src="../../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
10
- <script src="../../js/main.js" type="text/javascript" charset="utf-8"></script>
11
- <script src="../../js/highlight.pack.js" type="text/javascript" charset="utf-8"></script>
12
-
13
-
14
- <meta property="og:title" value="Nanook::Block">
15
-
16
-
17
-
18
- <meta name="description" content="The Nanook::Block class contains methods to discover publicly-available information about blocks on the nano network.">
19
- <meta property="og:description" content="The Nanook::Block class contains methods to discover publicly-available information about blocks on the nano network.">
20
-
21
-
22
- <meta name="keywords" content="Nanook::Block class">
23
-
24
- <meta name="keywords" content="new, account, cancel_work, chain, generate_work, history, id, info, is_valid_work?, republish, pending?, publish, process, successors">
25
-
26
- </head>
27
-
28
- <body>
29
- <div class="banner">
30
-
31
- <h1>
32
- <span class="type">Class</span>
33
- Nanook::Block
34
-
35
- <span class="parent">&lt;
36
-
37
- Object
38
-
39
- </span>
40
-
41
- </h1>
42
- <ul class="files">
43
-
44
- <li><a href="../../files/lib/nanook/block_rb.html">lib/nanook/block.rb</a></li>
45
-
46
- </ul>
47
- </div>
48
- <div id="bodyContent">
49
- <div id="content">
50
-
51
- <div class="description">
52
-
53
- <p>The <code>Nanook::Block</code> class contains methods to discover
54
- publicly-available information about blocks on the nano network.</p>
55
-
56
- <p>A block is represented by a unique id like this:</p>
57
-
58
- <pre><code>&quot;FBF8B0E6623A31AB528EBD839EEAA91CAFD25C12294C46754E45FD017F7939EB&quot;
59
- </code></pre>
60
-
61
- <p>Initialize this class through the convenient <a
62
- href="../Nanook.html#method-i-block">Nanook#block</a> method:</p>
63
-
64
- <pre><code>nanook = Nanook.new
65
- account = nanook.block(&quot;FBF8B0E...&quot;)
66
- </code></pre>
67
-
68
- <p>Or compose the longhand way like this:</p>
69
-
70
- <pre><code>rpc_conn = Nanook::Rpc.new
71
- block = Nanook::Block.new(rpc_conn, &quot;FBF8B0E...&quot;)
72
- </code></pre>
73
-
74
- </div>
75
-
76
-
77
-
78
-
79
-
80
-
81
-
82
-
83
-
84
-
85
-
86
-
87
-
88
-
89
- <!-- Method ref -->
90
- <div class="sectiontitle">Methods</div>
91
- <dl class="methods">
92
-
93
- <dt>A</dt>
94
- <dd>
95
- <ul>
96
-
97
-
98
- <li>
99
- <a href="#method-i-account">account</a>
100
- </li>
101
-
102
- </ul>
103
- </dd>
104
-
105
- <dt>C</dt>
106
- <dd>
107
- <ul>
108
-
109
-
110
- <li>
111
- <a href="#method-i-cancel_work">cancel_work</a>,
112
- </li>
113
-
114
-
115
- <li>
116
- <a href="#method-i-chain">chain</a>
117
- </li>
118
-
119
- </ul>
120
- </dd>
121
-
122
- <dt>G</dt>
123
- <dd>
124
- <ul>
125
-
126
-
127
- <li>
128
- <a href="#method-i-generate_work">generate_work</a>
129
- </li>
130
-
131
- </ul>
132
- </dd>
133
-
134
- <dt>H</dt>
135
- <dd>
136
- <ul>
137
-
138
-
139
- <li>
140
- <a href="#method-i-history">history</a>
141
- </li>
142
-
143
- </ul>
144
- </dd>
145
-
146
- <dt>I</dt>
147
- <dd>
148
- <ul>
149
-
150
-
151
- <li>
152
- <a href="#method-i-id">id</a>,
153
- </li>
154
-
155
-
156
- <li>
157
- <a href="#method-i-info">info</a>,
158
- </li>
159
-
160
-
161
- <li>
162
- <a href="#method-i-is_valid_work-3F">is_valid_work?</a>
163
- </li>
164
-
165
- </ul>
166
- </dd>
167
-
168
- <dt>N</dt>
169
- <dd>
170
- <ul>
171
-
172
-
173
- <li>
174
- <a href="#method-c-new">new</a>
175
- </li>
176
-
177
- </ul>
178
- </dd>
179
-
180
- <dt>P</dt>
181
- <dd>
182
- <ul>
183
-
184
-
185
- <li>
186
- <a href="#method-i-pending-3F">pending?</a>,
187
- </li>
188
-
189
-
190
- <li>
191
- <a href="#method-i-process">process</a>,
192
- </li>
193
-
194
-
195
- <li>
196
- <a href="#method-i-publish">publish</a>
197
- </li>
198
-
199
- </ul>
200
- </dd>
201
-
202
- <dt>R</dt>
203
- <dd>
204
- <ul>
205
-
206
-
207
- <li>
208
- <a href="#method-i-republish">republish</a>
209
- </li>
210
-
211
- </ul>
212
- </dd>
213
-
214
- <dt>S</dt>
215
- <dd>
216
- <ul>
217
-
218
-
219
- <li>
220
- <a href="#method-i-successors">successors</a>
221
- </li>
222
-
223
- </ul>
224
- </dd>
225
-
226
- </dl>
227
-
228
-
229
-
230
-
231
-
232
-
233
-
234
-
235
-
236
-
237
-
238
-
239
-
240
-
241
-
242
-
243
-
244
-
245
- <!-- Methods -->
246
-
247
- <div class="sectiontitle">Class Public methods</div>
248
-
249
- <div class="method">
250
- <div class="title method-title" id="method-c-new">
251
-
252
- <b>new</b>(rpc, block)
253
-
254
- <a href="../../classes/Nanook/Block.html#method-c-new" name="method-c-new" class="permalink">Link</a>
255
- </div>
256
-
257
-
258
- <div class="description">
259
-
260
- </div>
261
-
262
-
263
-
264
-
265
-
266
-
267
-
268
-
269
- <div class="sourcecode">
270
-
271
- <p class="source-link">
272
- Source:
273
- <a href="javascript:toggleSource('method-c-new_source')" id="l_method-c-new_source">show</a>
274
-
275
- </p>
276
- <div id="method-c-new_source" class="dyn-source">
277
- <pre><span class="ruby-comment"># File lib/nanook/block.rb, line 21</span>
278
- <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span>(<span class="ruby-identifier">rpc</span>, <span class="ruby-identifier">block</span>)
279
- <span class="ruby-ivar">@rpc</span> = <span class="ruby-identifier">rpc</span>
280
- <span class="ruby-ivar">@block</span> = <span class="ruby-identifier">block</span>
281
- <span class="ruby-identifier">block_required!</span> <span class="ruby-comment"># All methods expect a block</span>
282
- <span class="ruby-keyword">end</span></pre>
283
- </div>
284
- </div>
285
-
286
- </div>
287
-
288
-
289
-
290
- <div class="sectiontitle">Instance Public methods</div>
291
-
292
- <div class="method">
293
- <div class="title method-title" id="method-i-account">
294
-
295
- <b>account</b>()
296
-
297
- <a href="../../classes/Nanook/Block.html#method-i-account" name="method-i-account" class="permalink">Link</a>
298
- </div>
299
-
300
-
301
- <div class="description">
302
- <p>Returns a String of the account id of the block.</p>
303
-
304
- <h4 id="method-i-account-label-Example">Example</h4>
305
-
306
- <pre><code>block.account # =&gt; &quot;xrb_3x7c...&quot;
307
- </code></pre>
308
- </div>
309
-
310
-
311
-
312
-
313
-
314
-
315
-
316
-
317
- <div class="sourcecode">
318
-
319
- <p class="source-link">
320
- Source:
321
- <a href="javascript:toggleSource('method-i-account_source')" id="l_method-i-account_source">show</a>
322
-
323
- </p>
324
- <div id="method-i-account_source" class="dyn-source">
325
- <pre><span class="ruby-comment"># File lib/nanook/block.rb, line 32</span>
326
- <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">account</span>
327
- <span class="ruby-identifier">rpc</span>(<span class="ruby-value">:block_account</span>, <span class="ruby-value">:hash</span>)[<span class="ruby-value">:account</span>]
328
- <span class="ruby-keyword">end</span></pre>
329
- </div>
330
- </div>
331
-
332
- </div>
333
-
334
- <div class="method">
335
- <div class="title method-title" id="method-i-cancel_work">
336
-
337
- <b>cancel_work</b>()
338
-
339
- <a href="../../classes/Nanook/Block.html#method-i-cancel_work" name="method-i-cancel_work" class="permalink">Link</a>
340
- </div>
341
-
342
-
343
- <div class="description">
344
- <p>Stop generating work for a block.</p>
345
-
346
- <p>Returns boolean signalling if the action was successful.</p>
347
-
348
- <h4 id="method-i-cancel_work-label-Example">Example</h4>
349
-
350
- <pre><code>block.cancel_work # =&gt; true
351
- </code></pre>
352
- </div>
353
-
354
-
355
-
356
-
357
-
358
-
359
-
360
-
361
- <div class="sourcecode">
362
-
363
- <p class="source-link">
364
- Source:
365
- <a href="javascript:toggleSource('method-i-cancel_work_source')" id="l_method-i-cancel_work_source">show</a>
366
-
367
- </p>
368
- <div id="method-i-cancel_work_source" class="dyn-source">
369
- <pre><span class="ruby-comment"># File lib/nanook/block.rb, line 43</span>
370
- <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">cancel_work</span>
371
- <span class="ruby-identifier">rpc</span>(<span class="ruby-value">:work_cancel</span>, <span class="ruby-value">:hash</span>).<span class="ruby-identifier">empty?</span>
372
- <span class="ruby-keyword">end</span></pre>
373
- </div>
374
- </div>
375
-
376
- </div>
377
-
378
- <div class="method">
379
- <div class="title method-title" id="method-i-chain">
380
-
381
- <b>chain</b>(limit: 1000)
382
-
383
- <a href="../../classes/Nanook/Block.html#method-i-chain" name="method-i-chain" class="permalink">Link</a>
384
- </div>
385
-
386
-
387
- <div class="description">
388
- <p>Returns an Array of block hashes in the account chain starting at this
389
- block.</p>
390
-
391
- <p>See also <a href="Block.html#method-i-successors">successors</a>.</p>
392
-
393
- <h4 id="method-i-chain-label-Arguments">Arguments</h4>
394
- <dl class="rdoc-list label-list"><dt><code>limit:</code>
395
- <dd>
396
- <p>Maximum number of block hashes to return (default is 1000)</p>
397
- </dd></dl>
398
-
399
- <h4 id="method-i-chain-label-Example">Example</h4>
400
-
401
- <pre><code>block.chain(limit: 2)
402
- </code></pre>
403
-
404
- <h4 id="method-i-chain-label-Example+reponse">Example reponse</h4>
405
-
406
- <pre><code>[
407
- &quot;36A0FB717368BA8CF8D255B63DC207771EABC6C6FFC22A7F455EC2209464897E&quot;,
408
- &quot;FBF8B0E6623A31AB528EBD839EEAA91CAFD25C12294C46754E45FD017F7939EB&quot;
409
- ]
410
- </code></pre>
411
- </div>
412
-
413
-
414
-
415
-
416
-
417
-
418
-
419
-
420
- <div class="sourcecode">
421
-
422
- <p class="source-link">
423
- Source:
424
- <a href="javascript:toggleSource('method-i-chain_source')" id="l_method-i-chain_source">show</a>
425
-
426
- </p>
427
- <div id="method-i-chain_source" class="dyn-source">
428
- <pre><span class="ruby-comment"># File lib/nanook/block.rb, line 66</span>
429
- <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">chain</span>(<span class="ruby-value">limit:</span> <span class="ruby-value">1000</span>)
430
- <span class="ruby-identifier">response</span> = <span class="ruby-identifier">rpc</span>(<span class="ruby-value">:chain</span>, <span class="ruby-value">:block</span>, <span class="ruby-value">count:</span> <span class="ruby-identifier">limit</span>)[<span class="ruby-value">:blocks</span>]
431
- <span class="ruby-constant">Nanook</span><span class="ruby-operator">::</span><span class="ruby-constant">Util</span>.<span class="ruby-identifier">coerce_empty_string_to_type</span>(<span class="ruby-identifier">response</span>, <span class="ruby-constant">Array</span>)
432
- <span class="ruby-keyword">end</span></pre>
433
- </div>
434
- </div>
435
-
436
- </div>
437
-
438
- <div class="method">
439
- <div class="title method-title" id="method-i-generate_work">
440
-
441
- <b>generate_work</b>()
442
-
443
- <a href="../../classes/Nanook/Block.html#method-i-generate_work" name="method-i-generate_work" class="permalink">Link</a>
444
- </div>
445
-
446
-
447
- <div class="description">
448
- <p>Generate work for a block.</p>
449
-
450
- <p>Returns the work id of the work completed.</p>
451
-
452
- <pre><code>block.generate_work # =&gt; &quot;2bf29ef00786a6bc&quot;
453
- </code></pre>
454
- </div>
455
-
456
-
457
-
458
-
459
-
460
-
461
-
462
-
463
- <div class="sourcecode">
464
-
465
- <p class="source-link">
466
- Source:
467
- <a href="javascript:toggleSource('method-i-generate_work_source')" id="l_method-i-generate_work_source">show</a>
468
-
469
- </p>
470
- <div id="method-i-generate_work_source" class="dyn-source">
471
- <pre><span class="ruby-comment"># File lib/nanook/block.rb, line 76</span>
472
- <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">generate_work</span>
473
- <span class="ruby-identifier">rpc</span>(<span class="ruby-value">:work_generate</span>, <span class="ruby-value">:hash</span>)[<span class="ruby-value">:work</span>]
474
- <span class="ruby-keyword">end</span></pre>
475
- </div>
476
- </div>
477
-
478
- </div>
479
-
480
- <div class="method">
481
- <div class="title method-title" id="method-i-history">
482
-
483
- <b>history</b>(limit: 1000)
484
-
485
- <a href="../../classes/Nanook/Block.html#method-i-history" name="method-i-history" class="permalink">Link</a>
486
- </div>
487
-
488
-
489
- <div class="description">
490
- <p>Returns Array of Hashes containing information about a chain of
491
- send/receive blocks, starting from this block.</p>
492
-
493
- <h4 id="method-i-history-label-Arguments">Arguments</h4>
494
- <dl class="rdoc-list label-list"><dt><code>limit:</code>
495
- <dd>
496
- <p>Maximum number of send/receive block hashes to return in the chain (default
497
- is 1000)</p>
498
- </dd></dl>
499
-
500
- <h4 id="method-i-history-label-Example">Example</h4>
501
-
502
- <pre><code>block.history(limit: 1)
503
- </code></pre>
504
-
505
- <h4 id="method-i-history-label-Example+response">Example response</h4>
506
-
507
- <pre><code>[
508
- {
509
- :account=&gt;&quot;xrb_3x7cjioqahgs5ppheys6prpqtb4rdknked83chf97bot1unrbdkaux37t31b&quot;,
510
- :amount=&gt;539834279601145558517940224,
511
- :hash=&gt;&quot;36A0FB717368BA8CF8D255B63DC207771EABC6C6FFC22A7F455EC2209464897E&quot;,
512
- :type=&gt;&quot;send&quot;
513
- }
514
- ]
515
- </code></pre>
516
- </div>
517
-
518
-
519
-
520
-
521
-
522
-
523
-
524
-
525
- <div class="sourcecode">
526
-
527
- <p class="source-link">
528
- Source:
529
- <a href="javascript:toggleSource('method-i-history_source')" id="l_method-i-history_source">show</a>
530
-
531
- </p>
532
- <div id="method-i-history_source" class="dyn-source">
533
- <pre><span class="ruby-comment"># File lib/nanook/block.rb, line 102</span>
534
- <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">history</span>(<span class="ruby-value">limit:</span> <span class="ruby-value">1000</span>)
535
- <span class="ruby-identifier">rpc</span>(<span class="ruby-value">:history</span>, <span class="ruby-value">:hash</span>, <span class="ruby-value">count:</span> <span class="ruby-identifier">limit</span>)[<span class="ruby-value">:history</span>]
536
- <span class="ruby-keyword">end</span></pre>
537
- </div>
538
- </div>
539
-
540
- </div>
541
-
542
- <div class="method">
543
- <div class="title method-title" id="method-i-id">
544
-
545
- <b>id</b>()
546
-
547
- <a href="../../classes/Nanook/Block.html#method-i-id" name="method-i-id" class="permalink">Link</a>
548
- </div>
549
-
550
-
551
- <div class="description">
552
- <p>Returns the block hash</p>
553
-
554
- <pre><code>block.id #=&gt; &quot;FBF8B0E...&quot;
555
- </code></pre>
556
- </div>
557
-
558
-
559
-
560
-
561
-
562
-
563
-
564
-
565
- <div class="sourcecode">
566
-
567
- <p class="source-link">
568
- Source:
569
- <a href="javascript:toggleSource('method-i-id_source')" id="l_method-i-id_source">show</a>
570
-
571
- </p>
572
- <div id="method-i-id_source" class="dyn-source">
573
- <pre><span class="ruby-comment"># File lib/nanook/block.rb, line 109</span>
574
- <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">id</span>
575
- <span class="ruby-ivar">@block</span>
576
- <span class="ruby-keyword">end</span></pre>
577
- </div>
578
- </div>
579
-
580
- </div>
581
-
582
- <div class="method">
583
- <div class="title method-title" id="method-i-info">
584
-
585
- <b>info</b>(allow_unchecked: false)
586
-
587
- <a href="../../classes/Nanook/Block.html#method-i-info" name="method-i-info" class="permalink">Link</a>
588
- </div>
589
-
590
-
591
- <div class="description">
592
- <p>Returns a Hash of information about the block.</p>
593
-
594
- <h4 id="method-i-info-label-Arguments">Arguments</h4>
595
- <dl class="rdoc-list label-list"><dt><code>allow_unchecked:</code>
596
- <dd>
597
- <p>Boolean (default is <code>false</code>). If <code>true</code>, information
598
- can be returned about blocks that are unchecked (unverified).</p>
599
- </dd></dl>
600
-
601
- <h4 id="method-i-info-label-Example+response">Example response</h4>
602
-
603
- <pre><code>{
604
- :type=&gt;&quot;send&quot;,
605
- :previous=&gt;&quot;FBF8B0E6623A31AB528EBD839EEAA91CAFD25C12294C46754E45FD017F7939EB&quot;,
606
- :destination=&gt;&quot;xrb_3x7cjioqahgs5ppheys6prpqtb4rdknked83chf97bot1unrbdkaux37t31b&quot;,
607
- :balance=&gt;&quot;00000000000000000000000000000000&quot;,
608
- :work=&gt;&quot;44cc24b60705083a&quot;,
609
- :signature=&gt;&quot;42ADFEFE7C3FFF188AE92A202F8A5734DE91779C454613E446EEC93D001D6C953E9FD16730AF32C891791BA8EDAECEB059A213E2FE1EEB7ADF9D5D0815464D06&quot;
610
- }
611
- </code></pre>
612
- </div>
613
-
614
-
615
-
616
-
617
-
618
-
619
-
620
-
621
- <div class="sourcecode">
622
-
623
- <p class="source-link">
624
- Source:
625
- <a href="javascript:toggleSource('method-i-info_source')" id="l_method-i-info_source">show</a>
626
-
627
- </p>
628
- <div id="method-i-info_source" class="dyn-source">
629
- <pre><span class="ruby-comment"># File lib/nanook/block.rb, line 130</span>
630
- <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">info</span>(<span class="ruby-value">allow_unchecked:</span> <span class="ruby-keyword">false</span>)
631
- <span class="ruby-keyword">if</span> <span class="ruby-identifier">allow_unchecked</span>
632
- <span class="ruby-comment"># TODO not actually sure what this response looks like when it&#39;s not an unchecked block, assuming its blank</span>
633
- <span class="ruby-identifier">response</span> = <span class="ruby-identifier">rpc</span>(<span class="ruby-value">:unchecked_get</span>, <span class="ruby-value">:hash</span>)
634
- <span class="ruby-keyword">if</span> <span class="ruby-identifier">response</span>[<span class="ruby-value">:error</span>] <span class="ruby-operator">!=</span> <span class="ruby-string">&quot;Block not found&quot;</span>
635
- <span class="ruby-keyword">return</span> <span class="ruby-identifier">_parse_info_response</span>(<span class="ruby-identifier">response</span> )
636
- <span class="ruby-keyword">end</span>
637
- <span class="ruby-comment"># Continue on falling backto checked block</span>
638
- <span class="ruby-keyword">end</span>
639
-
640
- <span class="ruby-identifier">response</span> = <span class="ruby-identifier">rpc</span>(<span class="ruby-value">:block</span>, <span class="ruby-value">:hash</span>)
641
- <span class="ruby-identifier">_parse_info_response</span>(<span class="ruby-identifier">response</span>)
642
- <span class="ruby-keyword">end</span></pre>
643
- </div>
644
- </div>
645
-
646
- </div>
647
-
648
- <div class="method">
649
- <div class="title method-title" id="method-i-is_valid_work-3F">
650
-
651
- <b>is_valid_work?</b>(work)
652
-
653
- <a href="../../classes/Nanook/Block.html#method-i-is_valid_work-3F" name="method-i-is_valid_work-3F" class="permalink">Link</a>
654
- </div>
655
-
656
-
657
- <div class="description">
658
- <p>Returns boolean signalling if work is valid for the block.</p>
659
-
660
- <pre><code>block.is_valid_work?(&quot;2bf29ef00786a6bc&quot;) # =&gt; true
661
- </code></pre>
662
- </div>
663
-
664
-
665
-
666
-
667
-
668
-
669
-
670
-
671
- <div class="sourcecode">
672
-
673
- <p class="source-link">
674
- Source:
675
- <a href="javascript:toggleSource('method-i-is_valid_work-3F_source')" id="l_method-i-is_valid_work-3F_source">show</a>
676
-
677
- </p>
678
- <div id="method-i-is_valid_work-3F_source" class="dyn-source">
679
- <pre><span class="ruby-comment"># File lib/nanook/block.rb, line 147</span>
680
- <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">is_valid_work?</span>(<span class="ruby-identifier">work</span>)
681
- <span class="ruby-identifier">response</span> = <span class="ruby-identifier">rpc</span>(<span class="ruby-value">:work_validate</span>, <span class="ruby-value">:hash</span>, <span class="ruby-value">work:</span> <span class="ruby-identifier">work</span>)
682
- <span class="ruby-operator">!</span><span class="ruby-identifier">response</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">response</span>[<span class="ruby-value">:valid</span>] <span class="ruby-operator">==</span> <span class="ruby-value">1</span>
683
- <span class="ruby-keyword">end</span></pre>
684
- </div>
685
- </div>
686
-
687
- </div>
688
-
689
- <div class="method">
690
- <div class="title method-title" id="method-i-pending-3F">
691
-
692
- <b>pending?</b>()
693
-
694
- <a href="../../classes/Nanook/Block.html#method-i-pending-3F" name="method-i-pending-3F" class="permalink">Link</a>
695
- </div>
696
-
697
-
698
- <div class="description">
699
- <p>Returns boolean <code>true</code> if the block is a pending block.</p>
700
-
701
- <pre><code>block.pending? #=&gt; false
702
- </code></pre>
703
- </div>
704
-
705
-
706
-
707
-
708
-
709
-
710
-
711
-
712
- <div class="sourcecode">
713
-
714
- <p class="source-link">
715
- Source:
716
- <a href="javascript:toggleSource('method-i-pending-3F_source')" id="l_method-i-pending-3F_source">show</a>
717
-
718
- </p>
719
- <div id="method-i-pending-3F_source" class="dyn-source">
720
- <pre><span class="ruby-comment"># File lib/nanook/block.rb, line 180</span>
721
- <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">pending?</span>
722
- <span class="ruby-identifier">response</span> = <span class="ruby-identifier">rpc</span>(<span class="ruby-value">:pending_exists</span>, <span class="ruby-value">:hash</span>)
723
- <span class="ruby-operator">!</span><span class="ruby-identifier">response</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">response</span>[<span class="ruby-value">:exists</span>] <span class="ruby-operator">==</span> <span class="ruby-value">1</span>
724
- <span class="ruby-keyword">end</span></pre>
725
- </div>
726
- </div>
727
-
728
- </div>
729
-
730
- <div class="method">
731
- <div class="title method-title" id="method-i-process">
732
-
733
- <b>process</b>()
734
-
735
- <a href="../../classes/Nanook/Block.html#method-i-process" name="method-i-process" class="permalink">Link</a>
736
- </div>
737
-
738
-
739
- <div class="description">
740
-
741
- </div>
742
-
743
-
744
-
745
-
746
-
747
- <div class="aka">
748
- Alias for: <a href="Block.html#method-i-publish">publish</a>
749
- </div>
750
-
751
-
752
-
753
- </div>
754
-
755
- <div class="method">
756
- <div class="title method-title" id="method-i-publish">
757
-
758
- <b>publish</b>()
759
-
760
- <a href="../../classes/Nanook/Block.html#method-i-publish" name="method-i-publish" class="permalink">Link</a>
761
- </div>
762
-
763
-
764
- <div class="description">
765
- <p>Publish the block to the nano network.</p>
766
-
767
- <p>Note, if block has previously been published, use <a
768
- href="Block.html#method-i-republish">republish</a> instead.</p>
769
-
770
- <p>Returns the block hash, or false.</p>
771
-
772
- <pre><code>block.publish # =&gt; &quot;FBF8B0E...&quot;
773
- </code></pre>
774
- </div>
775
-
776
-
777
-
778
- <div class="aka">
779
- Also aliased as: <a href="Block.html#method-i-process">process</a>
780
- </div>
781
-
782
-
783
-
784
-
785
-
786
-
787
- <div class="sourcecode">
788
-
789
- <p class="source-link">
790
- Source:
791
- <a href="javascript:toggleSource('method-i-publish_source')" id="l_method-i-publish_source">show</a>
792
-
793
- </p>
794
- <div id="method-i-publish_source" class="dyn-source">
795
- <pre><span class="ruby-comment"># File lib/nanook/block.rb, line 192</span>
796
- <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">publish</span>
797
- <span class="ruby-comment"># TODO I think this can return false or error or something?</span>
798
- <span class="ruby-identifier">rpc</span>(<span class="ruby-value">:process</span>, <span class="ruby-value">:block</span>)[<span class="ruby-value">:hash</span>]
799
- <span class="ruby-keyword">end</span></pre>
800
- </div>
801
- </div>
802
-
803
- </div>
804
-
805
- <div class="method">
806
- <div class="title method-title" id="method-i-republish">
807
-
808
- <b>republish</b>(destinations:nil, sources:nil)
809
-
810
- <a href="../../classes/Nanook/Block.html#method-i-republish" name="method-i-republish" class="permalink">Link</a>
811
- </div>
812
-
813
-
814
- <div class="description">
815
- <p>Republish blocks starting at this block up the account chain back to the
816
- nano network.</p>
817
-
818
- <p>Returns an Array of block hashes that were republished.</p>
819
-
820
- <h4 id="method-i-republish-label-Example">Example</h4>
821
-
822
- <pre><code>block.republish
823
- </code></pre>
824
-
825
- <h4 id="method-i-republish-label-Example+response">Example response</h4>
826
-
827
- <pre><code>[&quot;36A0FB717368BA8CF8D255B63DC207771EABC6C6FFC22A7F455EC2209464897E&quot;]
828
- </code></pre>
829
- </div>
830
-
831
-
832
-
833
-
834
-
835
-
836
-
837
-
838
- <div class="sourcecode">
839
-
840
- <p class="source-link">
841
- Source:
842
- <a href="javascript:toggleSource('method-i-republish_source')" id="l_method-i-republish_source">show</a>
843
-
844
- </p>
845
- <div id="method-i-republish_source" class="dyn-source">
846
- <pre><span class="ruby-comment"># File lib/nanook/block.rb, line 163</span>
847
- <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">republish</span>(<span class="ruby-value">destinations:</span><span class="ruby-keyword">nil</span>, <span class="ruby-value">sources:</span><span class="ruby-keyword">nil</span>)
848
- <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">destinations</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-identifier">sources</span>.<span class="ruby-identifier">nil?</span>
849
- <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">&quot;You must provide either destinations or sources but not both&quot;</span>)
850
- <span class="ruby-keyword">end</span>
851
-
852
- <span class="ruby-comment"># Add in optional arguments</span>
853
- <span class="ruby-identifier">params</span> = {}
854
- <span class="ruby-identifier">params</span>[<span class="ruby-value">:destinations</span>] = <span class="ruby-identifier">destinations</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">destinations</span>.<span class="ruby-identifier">nil?</span>
855
- <span class="ruby-identifier">params</span>[<span class="ruby-value">:sources</span>] = <span class="ruby-identifier">sources</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">sources</span>.<span class="ruby-identifier">nil?</span>
856
- <span class="ruby-identifier">params</span>[<span class="ruby-value">:count</span>] = <span class="ruby-value">1</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">params</span>.<span class="ruby-identifier">empty?</span>
857
-
858
- <span class="ruby-identifier">rpc</span>(<span class="ruby-value">:republish</span>, <span class="ruby-value">:hash</span>, <span class="ruby-identifier">params</span>)[<span class="ruby-value">:blocks</span>]
859
- <span class="ruby-keyword">end</span></pre>
860
- </div>
861
- </div>
862
-
863
- </div>
864
-
865
- <div class="method">
866
- <div class="title method-title" id="method-i-successors">
867
-
868
- <b>successors</b>(limit: 1000)
869
-
870
- <a href="../../classes/Nanook/Block.html#method-i-successors" name="method-i-successors" class="permalink">Link</a>
871
- </div>
872
-
873
-
874
- <div class="description">
875
- <p>Returns an Array of block hashes in the account chain ending at this block.</p>
876
-
877
- <p>See also <a href="Block.html#method-i-chain">chain</a>.</p>
878
-
879
- <h4 id="method-i-successors-label-Arguments">Arguments</h4>
880
- <dl class="rdoc-list label-list"><dt><code>limit:</code>
881
- <dd>
882
- <p>Maximum number of send/receive block hashes to return in the chain (default
883
- is 1000)</p>
884
- </dd></dl>
885
-
886
- <h4 id="method-i-successors-label-Example">Example</h4>
887
-
888
- <pre><code>block.successors
889
- </code></pre>
890
-
891
- <h4 id="method-i-successors-label-Example+response">Example response</h4>
892
-
893
- <pre><code>[&quot;36A0FB717368BA8CF8D255B63DC207771EABC6C6FFC22A7F455EC2209464897E&quot;]
894
- </code></pre>
895
- </div>
896
-
897
-
898
-
899
-
900
-
901
-
902
-
903
-
904
- <div class="sourcecode">
905
-
906
- <p class="source-link">
907
- Source:
908
- <a href="javascript:toggleSource('method-i-successors_source')" id="l_method-i-successors_source">show</a>
909
-
910
- </p>
911
- <div id="method-i-successors_source" class="dyn-source">
912
- <pre><span class="ruby-comment"># File lib/nanook/block.rb, line 215</span>
913
- <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">successors</span>(<span class="ruby-value">limit:</span> <span class="ruby-value">1000</span>)
914
- <span class="ruby-identifier">response</span> = <span class="ruby-identifier">rpc</span>(<span class="ruby-value">:successors</span>, <span class="ruby-value">:block</span>, <span class="ruby-value">count:</span> <span class="ruby-identifier">limit</span>)[<span class="ruby-value">:blocks</span>]
915
- <span class="ruby-constant">Nanook</span><span class="ruby-operator">::</span><span class="ruby-constant">Util</span>.<span class="ruby-identifier">coerce_empty_string_to_type</span>(<span class="ruby-identifier">response</span>, <span class="ruby-constant">Array</span>)
916
- <span class="ruby-keyword">end</span></pre>
917
- </div>
918
- </div>
919
-
920
- </div>
921
-
922
-
923
-
924
-
925
- </div>
926
-
927
- </div>
928
- </body>
929
- </html>