nanook 0.7.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (202) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +2 -1
  3. data/CHANGELOG.md +26 -0
  4. data/Gemfile.lock +2 -2
  5. data/README.md +18 -7
  6. data/Rakefile +18 -0
  7. data/docs/0.7.0/apple-touch-icon.png +0 -0
  8. data/docs/0.7.0/classes/Nanook.html +572 -0
  9. data/docs/0.7.0/classes/Nanook/Account.html +909 -0
  10. data/docs/0.7.0/classes/Nanook/Block.html +717 -0
  11. data/docs/0.7.0/classes/Nanook/Error.html +84 -0
  12. data/docs/0.7.0/classes/Nanook/Key.html +253 -0
  13. data/docs/0.7.0/classes/Nanook/Node.html +657 -0
  14. data/docs/0.7.0/classes/Nanook/Rpc.html +247 -0
  15. data/docs/0.7.0/classes/Nanook/Util.html +197 -0
  16. data/docs/0.7.0/classes/Nanook/Wallet.html +986 -0
  17. data/docs/0.7.0/classes/Nanook/WalletAccount.html +446 -0
  18. data/docs/0.7.0/classes/Nanook/WorkPeer.html +294 -0
  19. data/docs/0.7.0/created.rid +14 -0
  20. data/docs/0.7.0/css/github.css +123 -0
  21. data/docs/0.7.0/css/main.css +374 -0
  22. data/docs/0.7.0/css/panel.css +360 -0
  23. data/docs/0.7.0/css/reset.css +48 -0
  24. data/docs/0.7.0/favicon.ico +0 -0
  25. data/docs/0.7.0/files/README_md.html +418 -0
  26. data/docs/0.7.0/files/lib/nanook/account_rb.html +89 -0
  27. data/docs/0.7.0/files/lib/nanook/block_rb.html +89 -0
  28. data/docs/0.7.0/files/lib/nanook/error_rb.html +89 -0
  29. data/docs/0.7.0/files/lib/nanook/key_rb.html +89 -0
  30. data/docs/0.7.0/files/lib/nanook/node_rb.html +89 -0
  31. data/docs/0.7.0/files/lib/nanook/rpc_rb.html +99 -0
  32. data/docs/0.7.0/files/lib/nanook/util_rb.html +89 -0
  33. data/docs/0.7.0/files/lib/nanook/version_rb.html +84 -0
  34. data/docs/0.7.0/files/lib/nanook/wallet_account_rb.html +89 -0
  35. data/docs/0.7.0/files/lib/nanook/wallet_rb.html +89 -0
  36. data/docs/0.7.0/files/lib/nanook/work_peer_rb.html +89 -0
  37. data/docs/0.7.0/files/lib/nanook_rb.html +94 -0
  38. data/docs/0.7.0/i/arrow-down.svg +8 -0
  39. data/docs/0.7.0/i/arrow-right.svg +8 -0
  40. data/docs/0.7.0/i/search.svg +12 -0
  41. data/docs/0.7.0/i/tree_bg.svg +8 -0
  42. data/docs/0.7.0/index.html +11 -0
  43. data/docs/0.7.0/js/highlight.pack.js +1 -0
  44. data/docs/0.7.0/js/jquery-1.3.2.min.js +19 -0
  45. data/docs/0.7.0/js/main.js +25 -0
  46. data/docs/0.7.0/js/navigation.js +142 -0
  47. data/docs/0.7.0/js/search_index.js +1 -0
  48. data/docs/0.7.0/js/searchdoc.js +465 -0
  49. data/docs/0.7.0/js/searcher.js +229 -0
  50. data/docs/0.7.0/panel/index.html +47 -0
  51. data/docs/0.7.0/panel/links.html +32 -0
  52. data/docs/0.7.0/panel/tree.js +1 -0
  53. data/docs/0.8.0/apple-touch-icon.png +0 -0
  54. data/docs/0.8.0/classes/Nanook.html +621 -0
  55. data/docs/0.8.0/classes/Nanook/Account.html +971 -0
  56. data/docs/0.8.0/classes/Nanook/Block.html +759 -0
  57. data/docs/0.8.0/classes/Nanook/Error.html +84 -0
  58. data/docs/0.8.0/classes/Nanook/Key.html +295 -0
  59. data/docs/0.8.0/classes/Nanook/Node.html +657 -0
  60. data/docs/0.8.0/classes/Nanook/Rpc.html +247 -0
  61. data/docs/0.8.0/classes/Nanook/Util.html +264 -0
  62. data/docs/0.8.0/classes/Nanook/Wallet.html +1056 -0
  63. data/docs/0.8.0/classes/Nanook/WalletAccount.html +582 -0
  64. data/docs/0.8.0/classes/Nanook/WorkPeer.html +294 -0
  65. data/docs/0.8.0/created.rid +14 -0
  66. data/docs/0.8.0/css/github.css +123 -0
  67. data/docs/0.8.0/css/main.css +374 -0
  68. data/docs/0.8.0/css/panel.css +360 -0
  69. data/docs/0.8.0/css/reset.css +48 -0
  70. data/docs/0.8.0/favicon.ico +0 -0
  71. data/docs/0.8.0/files/README_md.html +423 -0
  72. data/docs/0.8.0/files/lib/nanook/account_rb.html +89 -0
  73. data/docs/0.8.0/files/lib/nanook/block_rb.html +89 -0
  74. data/docs/0.8.0/files/lib/nanook/error_rb.html +89 -0
  75. data/docs/0.8.0/files/lib/nanook/key_rb.html +89 -0
  76. data/docs/0.8.0/files/lib/nanook/node_rb.html +89 -0
  77. data/docs/0.8.0/files/lib/nanook/rpc_rb.html +99 -0
  78. data/docs/0.8.0/files/lib/nanook/util_rb.html +97 -0
  79. data/docs/0.8.0/files/lib/nanook/version_rb.html +84 -0
  80. data/docs/0.8.0/files/lib/nanook/wallet_account_rb.html +89 -0
  81. data/docs/0.8.0/files/lib/nanook/wallet_rb.html +89 -0
  82. data/docs/0.8.0/files/lib/nanook/work_peer_rb.html +89 -0
  83. data/docs/0.8.0/files/lib/nanook_rb.html +94 -0
  84. data/docs/0.8.0/i/arrow-down.svg +8 -0
  85. data/docs/0.8.0/i/arrow-right.svg +8 -0
  86. data/docs/0.8.0/i/search.svg +12 -0
  87. data/docs/0.8.0/i/tree_bg.svg +8 -0
  88. data/docs/0.8.0/index.html +11 -0
  89. data/docs/0.8.0/js/highlight.pack.js +1 -0
  90. data/docs/0.8.0/js/jquery-1.3.2.min.js +19 -0
  91. data/docs/0.8.0/js/main.js +25 -0
  92. data/docs/0.8.0/js/navigation.js +142 -0
  93. data/docs/0.8.0/js/search_index.js +1 -0
  94. data/docs/0.8.0/js/searchdoc.js +465 -0
  95. data/docs/0.8.0/js/searcher.js +229 -0
  96. data/docs/0.8.0/panel/index.html +47 -0
  97. data/docs/0.8.0/panel/links.html +32 -0
  98. data/docs/0.8.0/panel/tree.js +1 -0
  99. data/docs/1.0.0/apple-touch-icon.png +0 -0
  100. data/docs/1.0.0/classes/Nanook.html +621 -0
  101. data/docs/1.0.0/classes/Nanook/Account.html +971 -0
  102. data/docs/1.0.0/classes/Nanook/Block.html +759 -0
  103. data/docs/1.0.0/classes/Nanook/Error.html +84 -0
  104. data/docs/1.0.0/classes/Nanook/Key.html +295 -0
  105. data/docs/1.0.0/classes/Nanook/Node.html +657 -0
  106. data/docs/1.0.0/classes/Nanook/Rpc.html +247 -0
  107. data/docs/1.0.0/classes/Nanook/Util.html +264 -0
  108. data/docs/1.0.0/classes/Nanook/Wallet.html +1056 -0
  109. data/docs/1.0.0/classes/Nanook/WalletAccount.html +582 -0
  110. data/docs/1.0.0/classes/Nanook/WorkPeer.html +294 -0
  111. data/docs/1.0.0/created.rid +14 -0
  112. data/docs/1.0.0/css/github.css +123 -0
  113. data/docs/1.0.0/css/main.css +374 -0
  114. data/docs/1.0.0/css/panel.css +360 -0
  115. data/docs/1.0.0/css/reset.css +48 -0
  116. data/docs/1.0.0/favicon.ico +0 -0
  117. data/docs/1.0.0/files/README_md.html +423 -0
  118. data/docs/1.0.0/files/lib/nanook/account_rb.html +89 -0
  119. data/docs/1.0.0/files/lib/nanook/block_rb.html +89 -0
  120. data/docs/1.0.0/files/lib/nanook/error_rb.html +89 -0
  121. data/docs/1.0.0/files/lib/nanook/key_rb.html +89 -0
  122. data/docs/1.0.0/files/lib/nanook/node_rb.html +89 -0
  123. data/docs/1.0.0/files/lib/nanook/rpc_rb.html +99 -0
  124. data/docs/1.0.0/files/lib/nanook/util_rb.html +97 -0
  125. data/docs/1.0.0/files/lib/nanook/version_rb.html +84 -0
  126. data/docs/1.0.0/files/lib/nanook/wallet_account_rb.html +89 -0
  127. data/docs/1.0.0/files/lib/nanook/wallet_rb.html +89 -0
  128. data/docs/1.0.0/files/lib/nanook/work_peer_rb.html +89 -0
  129. data/docs/1.0.0/files/lib/nanook_rb.html +94 -0
  130. data/docs/1.0.0/i/arrow-down.svg +8 -0
  131. data/docs/1.0.0/i/arrow-right.svg +8 -0
  132. data/docs/1.0.0/i/search.svg +12 -0
  133. data/docs/1.0.0/i/tree_bg.svg +8 -0
  134. data/docs/1.0.0/index.html +11 -0
  135. data/docs/1.0.0/js/highlight.pack.js +1 -0
  136. data/docs/1.0.0/js/jquery-1.3.2.min.js +19 -0
  137. data/docs/1.0.0/js/main.js +25 -0
  138. data/docs/1.0.0/js/navigation.js +142 -0
  139. data/docs/1.0.0/js/search_index.js +1 -0
  140. data/docs/1.0.0/js/searchdoc.js +465 -0
  141. data/docs/1.0.0/js/searcher.js +229 -0
  142. data/docs/1.0.0/panel/index.html +47 -0
  143. data/docs/1.0.0/panel/links.html +32 -0
  144. data/docs/1.0.0/panel/tree.js +1 -0
  145. data/docs/apple-touch-icon.png +0 -0
  146. data/docs/classes/Nanook.html +572 -0
  147. data/docs/classes/Nanook/Account.html +907 -0
  148. data/docs/classes/Nanook/Block.html +717 -0
  149. data/docs/classes/Nanook/Error.html +84 -0
  150. data/docs/classes/Nanook/Key.html +253 -0
  151. data/docs/classes/Nanook/Node.html +657 -0
  152. data/docs/classes/Nanook/Rpc.html +247 -0
  153. data/docs/classes/Nanook/Util.html +197 -0
  154. data/docs/classes/Nanook/Wallet.html +778 -0
  155. data/docs/classes/Nanook/WalletAccount.html +447 -0
  156. data/docs/classes/Nanook/WorkPeer.html +294 -0
  157. data/docs/created.rid +14 -0
  158. data/docs/css/github.css +123 -0
  159. data/docs/css/main.css +374 -0
  160. data/docs/css/panel.css +360 -0
  161. data/docs/css/reset.css +48 -0
  162. data/docs/favicon.ico +0 -0
  163. data/docs/files/README_md.html +408 -0
  164. data/docs/files/lib/nanook/account_rb.html +89 -0
  165. data/docs/files/lib/nanook/block_rb.html +89 -0
  166. data/docs/files/lib/nanook/error_rb.html +89 -0
  167. data/docs/files/lib/nanook/key_rb.html +89 -0
  168. data/docs/files/lib/nanook/node_rb.html +89 -0
  169. data/docs/files/lib/nanook/rpc_rb.html +99 -0
  170. data/docs/files/lib/nanook/util_rb.html +89 -0
  171. data/docs/files/lib/nanook/version_rb.html +84 -0
  172. data/docs/files/lib/nanook/wallet_account_rb.html +89 -0
  173. data/docs/files/lib/nanook/wallet_rb.html +89 -0
  174. data/docs/files/lib/nanook/work_peer_rb.html +89 -0
  175. data/docs/files/lib/nanook_rb.html +94 -0
  176. data/docs/i/arrow-down.svg +8 -0
  177. data/docs/i/arrow-right.svg +8 -0
  178. data/docs/i/search.svg +12 -0
  179. data/docs/i/tree_bg.svg +8 -0
  180. data/docs/index.html +11 -0
  181. data/docs/js/highlight.pack.js +1 -0
  182. data/docs/js/jquery-1.3.2.min.js +19 -0
  183. data/docs/js/main.js +25 -0
  184. data/docs/js/navigation.js +142 -0
  185. data/docs/js/search_index.js +1 -0
  186. data/docs/js/searchdoc.js +465 -0
  187. data/docs/js/searcher.js +229 -0
  188. data/docs/panel/index.html +47 -0
  189. data/docs/panel/links.html +32 -0
  190. data/docs/panel/tree.js +1 -0
  191. data/lib/nanook.rb +40 -4
  192. data/lib/nanook/account.rb +250 -8
  193. data/lib/nanook/block.rb +25 -2
  194. data/lib/nanook/key.rb +10 -2
  195. data/lib/nanook/node.rb +4 -0
  196. data/lib/nanook/rpc.rb +5 -1
  197. data/lib/nanook/util.rb +9 -1
  198. data/lib/nanook/version.rb +1 -1
  199. data/lib/nanook/wallet.rb +275 -14
  200. data/lib/nanook/wallet_account.rb +63 -11
  201. data/lib/nanook/work_peer.rb +4 -0
  202. metadata +188 -3
@@ -0,0 +1,360 @@
1
+ /* Panel (begin) */
2
+ .panel
3
+ {
4
+ position: absolute;
5
+ width: 100%;
6
+ height: 100%;
7
+ top: 0;
8
+ left: 0;
9
+ background: #FFF;
10
+ z-index: 2;
11
+ font-family: "Helvetica Neue", "Arial", sans-serif;
12
+ overflow-x: hidden;
13
+ }
14
+
15
+ .panel_tree .results,
16
+ .panel_results .tree
17
+ {
18
+ display: none;
19
+ }
20
+
21
+ /* Header with search box (begin) */
22
+ .panel .header
23
+ {
24
+ background: white url(../i/search.svg) no-repeat;
25
+ background-position: 5px;
26
+ box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
27
+ height: 40px;
28
+ width: 100%;
29
+ position: absolute;
30
+ left: 0; top: 0;
31
+ z-index: 300;
32
+ }
33
+
34
+ .panel .header input
35
+ {
36
+ border: 0;
37
+ box-sizing: border-box;
38
+ display: inline-block;
39
+ font-size: 14px;
40
+ height: 40px;
41
+ width: 100%;
42
+ padding: 0 5px;
43
+ margin: 0;
44
+ margin-left: 25px;
45
+ outline: none;
46
+ }
47
+
48
+ /* Header with search box (end) */
49
+
50
+
51
+ /* Results (begin) */
52
+ .panel .result
53
+ {
54
+ position: absolute;
55
+ top: 40px;
56
+ bottom: 0;
57
+ left: 0;
58
+ width: 100%;
59
+ overflow-y: scroll;
60
+ overflow-x: hidden;
61
+ z-index: 2;
62
+ }
63
+
64
+ .panel .result ul
65
+ {
66
+ font-size: 0.8em;
67
+ width: 100%;
68
+ }
69
+
70
+ .panel .result ul li
71
+ {
72
+ height: 46px;
73
+ overflow: hidden;
74
+ padding: 4px 10px 0 10px;
75
+ cursor: pointer;
76
+ }
77
+
78
+ .panel .result ul li:nth-child(2n) {
79
+ background: #F0EFEF;
80
+ }
81
+
82
+ .panel .result ul li h1
83
+ {
84
+ font-size: 13px;
85
+ font-weight: normal;
86
+ color: #333;
87
+ margin-bottom: 2px;
88
+ white-space: nowrap;
89
+ }
90
+
91
+ .panel .result ul li p
92
+ {
93
+ font-size: 11px;
94
+ color: #333;
95
+ margin-bottom: 2px;
96
+ white-space: nowrap;
97
+ }
98
+
99
+ .panel .result ul li h1 i,
100
+ .panel .result ul li p.snippet
101
+ {
102
+ color: #777;
103
+ }
104
+
105
+ .panel .result ul li b
106
+ {
107
+ color: #000;
108
+ }
109
+
110
+ .panel .result ul li.current
111
+ {
112
+ background: #B61D1D;
113
+ }
114
+
115
+ .panel .result ul li.current h1,
116
+ .panel .result ul li.current p
117
+ {
118
+ color: #D9D9D9;
119
+ }
120
+
121
+ .panel .result ul li.current h1 i,
122
+ .panel .result ul li.current p.snippet
123
+ {
124
+ color: #ACACAC;
125
+ }
126
+
127
+ .panel .result ul li.current b
128
+ {
129
+ color: #FFF;
130
+ }
131
+
132
+
133
+ .panel .result ul li:hover,
134
+ .panel .result ul li.selected
135
+ {
136
+ background: #d0d0d0;
137
+ }
138
+
139
+ .panel .result ul li.current:hover
140
+ {
141
+ background: #B61D1D;
142
+ }
143
+
144
+ .panel .result ul li .badge
145
+ {
146
+ margin-right: 0.4em;
147
+ margin-left: -0.2em;
148
+ padding: 0 0.2em;
149
+ color: #000;
150
+ border-radius: 3px;
151
+ }
152
+
153
+ .panel .result ul li .badge_1
154
+ {
155
+ background: #ACDBF4;
156
+ }
157
+
158
+ .panel .result ul li.current .badge_1
159
+ {
160
+ background: #97BFD7;
161
+ }
162
+
163
+ .panel .result ul li .badge_2
164
+ {
165
+ background: #ACF3C3;
166
+ }
167
+
168
+ .panel .result ul li.current .badge_2
169
+ {
170
+ background: #98D7AC;
171
+ }
172
+
173
+ .panel .result ul li .badge_3
174
+ {
175
+ background: #E0F3AC;
176
+ }
177
+
178
+ .panel .result ul li.current .badge_3
179
+ {
180
+ background: #C4D798;
181
+ }
182
+
183
+ .panel .result ul li .badge_4
184
+ {
185
+ background: #D7CA98;
186
+ }
187
+
188
+ .panel .result ul li.current .badge_4
189
+ {
190
+ background: #A6B0AC;
191
+ }
192
+
193
+ .panel .result ul li .badge_5
194
+ {
195
+ background: #F3C8AC;
196
+ }
197
+
198
+ .panel .result ul li.current .badge_5
199
+ {
200
+ background: #D7B198;
201
+ }
202
+
203
+ .panel .result ul li .badge_6
204
+ {
205
+ background: #F3ACC3;
206
+ }
207
+
208
+ .panel .result ul li.current .badge_6
209
+ {
210
+ background: #D798AB;
211
+ }
212
+
213
+ /* Results (end) */
214
+
215
+ /* Tree (begin) */ /**/
216
+ .panel .tree
217
+ {
218
+ background: white;
219
+ position: absolute;
220
+ top: 40px;
221
+ bottom: 0;
222
+ left: 0;
223
+ width: 100%;
224
+ overflow-y: scroll;
225
+ overflow-x: hidden;
226
+ z-index: 30;
227
+ }
228
+
229
+ .panel .tree ul:first-child
230
+ {
231
+ background: url(../i/tree_bg.svg);
232
+ background-size: 1px 60px;
233
+ }
234
+
235
+ .panel .tree li
236
+ {
237
+ cursor: pointer;
238
+ overflow: hidden;
239
+ height: 30px;
240
+ line-height: 100%;
241
+ }
242
+
243
+
244
+ .panel .tree li .content
245
+ {
246
+ padding-left: 18px;
247
+ padding-top: 5px;
248
+ height: 18px;
249
+ overflow: hidden;
250
+ position: relative;
251
+ }
252
+
253
+ .panel .tree li .icon
254
+ {
255
+ width: 10px;
256
+ height: 9px;
257
+ background: url(../i/arrow-down.svg);
258
+ background-size: 10px;
259
+ position: absolute;
260
+ left: 1px;
261
+ top: 8px;
262
+ cursor: default;
263
+ }
264
+
265
+ .panel .tree li.closed .icon
266
+ {
267
+ background: url(../i/arrow-right.svg);
268
+ background-size: 10px;
269
+ }
270
+
271
+ .panel .tree ul li h1
272
+ {
273
+ font-size: 13px;
274
+ font-weight: normal;
275
+ color: #000;
276
+ margin-bottom: 2px;
277
+ white-space: nowrap;
278
+ }
279
+
280
+ .panel .tree ul li p
281
+ {
282
+ font-size: 11px;
283
+ color: #666;
284
+ margin-bottom: 2px;
285
+ white-space: nowrap;
286
+ }
287
+
288
+ .panel .tree ul li h1 i
289
+ {
290
+ color: #999;
291
+ font-style: normal;
292
+ }
293
+
294
+ .panel .tree ul li.current h1 i
295
+ {
296
+ color: #CCC;
297
+ }
298
+
299
+ .panel .tree ul li.empty
300
+ {
301
+ cursor: text;
302
+ }
303
+
304
+ .panel .tree ul li.empty h1,
305
+ .panel .tree ul li.empty p
306
+ {
307
+ color: #666;
308
+ font-style: italic;
309
+ }
310
+
311
+ .panel .tree ul li.current
312
+ {
313
+ background: #B61D1D;
314
+ }
315
+
316
+ .panel .tree ul li.current .icon
317
+ {
318
+ background: url(../i/arrow-right.svg);
319
+ background-size: 10px;
320
+ }
321
+
322
+ .panel .tree ul li.current.closed .icon
323
+ {
324
+ background: url(../i/arrow-down.svg);
325
+ background-size: 10px;
326
+ }
327
+
328
+ .panel .tree ul li.current h1
329
+ {
330
+ color: #FFF;
331
+ }
332
+
333
+ .panel .tree ul li.current p
334
+ {
335
+ color: #CCC;
336
+ }
337
+
338
+ .panel .tree ul li.current.empty h1,
339
+ .panel .tree ul li.current.empty p
340
+ {
341
+ color: #999;
342
+ }
343
+
344
+ .panel .tree ul li:hover
345
+ {
346
+ background: #d0d0d0;
347
+ }
348
+
349
+ .panel .tree ul li.current:hover
350
+ {
351
+ background: #B61D1D;
352
+ }
353
+
354
+ .panel .tree .stopper
355
+ {
356
+ display: none;
357
+ }
358
+ /* Tree (end) */ /**/
359
+
360
+ /* Panel (end) */
@@ -0,0 +1,48 @@
1
+ /* http://meyerweb.com/eric/tools/css/reset/ */
2
+ /* v1.0 | 20080212 */
3
+
4
+ html, body, div, span, applet, object, iframe,
5
+ h1, h2, h3, h4, h5, h6, p, blockquote, pre,
6
+ a, abbr, acronym, address, big, cite, code,
7
+ del, dfn, em, font, img, ins, kbd, q, s, samp,
8
+ small, strike, strong, sub, sup, tt, var,
9
+ b, u, i, center,
10
+ dl, dt, dd, ol, ul, li,
11
+ fieldset, form, label, legend,
12
+ table, caption, tbody, tfoot, thead, tr, th, td {
13
+ margin: 0;
14
+ padding: 0;
15
+ border: 0;
16
+ outline: 0;
17
+ font-size: 100%;
18
+ vertical-align: baseline;
19
+ background: transparent;
20
+ }
21
+ body {
22
+ line-height: 1;
23
+ }
24
+ ol, ul {
25
+ list-style: none;
26
+ }
27
+ blockquote, q {
28
+ quotes: none;
29
+ }
30
+ blockquote:before, blockquote:after,
31
+ q:before, q:after {
32
+ content: '';
33
+ content: none;
34
+ }
35
+
36
+ /* remember to highlight inserts somehow! */
37
+ ins {
38
+ text-decoration: none;
39
+ }
40
+ del {
41
+ text-decoration: line-through;
42
+ }
43
+
44
+ /* tables still need 'cellspacing="0"' in the markup */
45
+ table {
46
+ border-collapse: collapse;
47
+ border-spacing: 0;
48
+ }
Binary file
@@ -0,0 +1,423 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <title>README.md</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
+ </head>
14
+
15
+ <body>
16
+ <div class="banner">
17
+
18
+ <h1>
19
+ README.md
20
+ </h1>
21
+ <ul class="files">
22
+
23
+ <li>
24
+ README.md
25
+
26
+ </li>
27
+ <li>Last modified: 2018-03-15 09:08:34 +1300</li>
28
+ </ul>
29
+ </div>
30
+
31
+ <div id="bodyContent">
32
+ <div id="content">
33
+
34
+ <div class="description">
35
+
36
+ <h1 id="label-Nanook"><a href="../classes/Nanook.html">Nanook</a></h1>
37
+
38
+ <p>This is a Ruby library for managing a <a href="https://nano.org/">nano
39
+ currency</a> node, including making and receiving payments, using the <a
40
+ href="https://github.com/nanocurrency/raiblocks/wiki/RPC-protocol">nano RPC
41
+ protocol</a>. Nano is a fee-less, fast, environmentally-friendly
42
+ cryptocurrency. It&#39;s awesome. See <a
43
+ href="https://nano.org/">nano.org</a>.</p>
44
+
45
+ <p><a href="https://badge.fury.io/rb/nanook"><img
46
+ src="https://badge.fury.io/rb/nanook.svg"></a> <a
47
+ href="https://circleci.com/gh/lukes/nanook/tree/master"><img
48
+ src="https://circleci.com/gh/lukes/nanook/tree/master.svg?style=shield"></a></p>
49
+
50
+ <h2 id="label-Installation">Installation</h2>
51
+
52
+ <p>Add this line to your application&#39;s Gemfile:</p>
53
+
54
+ <pre><code>gem &#39;nanook&#39;, &quot;~&gt; 0.7&quot;
55
+ </code></pre>
56
+
57
+ <p>And then execute:</p>
58
+
59
+ <pre><code>$ bundle
60
+ </code></pre>
61
+
62
+ <p>Or install it yourself as:</p>
63
+
64
+ <pre><code>$ gem install nanook
65
+ </code></pre>
66
+
67
+ <h1 id="label-Getting+Started">Getting Started</h1>
68
+
69
+ <h2 id="label-Initializing">Initializing</h2>
70
+
71
+ <p><a href="../classes/Nanook.html">Nanook</a> will by default connect to
72
+ <code>http://localhost:7076</code>.</p>
73
+
74
+ <pre><code>nanook = Nanook.new
75
+ </code></pre>
76
+
77
+ <p>To connect to another host instead:</p>
78
+
79
+ <pre><code>nanook = Nanook.new(&quot;http://ip6-localhost:7076&quot;)
80
+ </code></pre>
81
+
82
+ <h2 id="label-Basics">Basics</h2>
83
+
84
+ <h3 id="label-Working+with+wallets+and+accounts">Working with wallets and accounts</h3>
85
+
86
+ <p>Create a wallet:</p>
87
+
88
+ <pre><code>Nanook.new.wallet.create
89
+ </code></pre>
90
+
91
+ <p>Create an account within a wallet:</p>
92
+
93
+ <pre><code>Nanook.new.wallet(wallet_id).account.create
94
+ </code></pre>
95
+
96
+ <p>List accounts within a wallet:</p>
97
+
98
+ <pre><code>Nanook.new.wallet(wallet_id).accounts
99
+ </code></pre>
100
+
101
+ <h3 id="label-Sending+a+payment">Sending a payment</h3>
102
+
103
+ <p>You can send a payment from an account in a wallet:</p>
104
+
105
+ <pre><code>account = Nanook.new.wallet(wallet_id).account(account_id)
106
+ account.pay(to: recipient_account_id, amount: 0.2, id: unique_id)
107
+ </code></pre>
108
+
109
+ <p>Or, a wallet:</p>
110
+
111
+ <pre><code>wallet = Nanook.new.wallet(wallet_id)
112
+ wallet.pay(from: your_account_id, to: recipient_account_id, amount: 0.2, id: unique_id)
113
+ </code></pre>
114
+
115
+ <p>The <code>id</code> can be any string and needs to be unique per payment.
116
+ It serves an important purpose; it allows you to make this call multiple
117
+ times with the same <code>id</code> and be reassured that you will only
118
+ ever send that nano payment once. From the <a
119
+ href="https://github.com/nanocurrency/raiblocks/wiki/RPC-protocol#account-create">Nano
120
+ RPC</a>:</p>
121
+
122
+ <blockquote>
123
+ <p>You can (and should) specify a unique id for each spend to provide
124
+ idempotency. That means that if you [make the payment call] two times with
125
+ the same id, the second request won&#39;t send any additional Nano.</p>
126
+ </blockquote>
127
+
128
+ <p>The unit of the <code>amount</code> is NANO (which is currently technically
129
+ 1Mnano — see <a href="https://nano.org/en/faq#what-are-nano-units-">What
130
+ are Nano’s Units</a>).</p>
131
+
132
+ <p>Note, there may be a delay in receiving a response due to Proof of Work
133
+ being done. From the <a
134
+ href="https://github.com/nanocurrency/raiblocks/wiki/RPC-protocol#account-create">Nano
135
+ RPC</a>:</p>
136
+
137
+ <blockquote>
138
+ <p>Proof of Work is precomputed for one transaction in the background. If it
139
+ has been a while since your last transaction it will send instantly, the
140
+ next one will need to wait for Proof of Work to be generated.</p>
141
+ </blockquote>
142
+
143
+ <h3 id="label-Receiving+a+payment">Receiving a payment</h3>
144
+
145
+ <p>The simplest way to receive a payment is:</p>
146
+
147
+ <pre><code>account = Nanook.new.wallet(wallet_id).account(account_id)
148
+ account.receive
149
+
150
+ # or:
151
+
152
+ wallet = Nanook.new.wallet(wallet_id)
153
+ wallet.receive(into: account_id)
154
+ </code></pre>
155
+
156
+ <p>The <code>receive</code> method when called as above will receive the
157
+ latest pending payment for an account in a wallet. It will either return a
158
+ block hash if a payment was received, or <code>false</code> if there were
159
+ no pending payments to receive.</p>
160
+
161
+ <p>You can also receive a specific pending block if you know it (you may have
162
+ discovered it through calling <code>account.pending</code> for example):</p>
163
+
164
+ <pre><code>account = Nanook.new.wallet(wallet_id).account(account_id)
165
+ account.receive(block_id)
166
+
167
+ # or:
168
+
169
+ wallet = Nanook.new.wallet(wallet_id)
170
+ wallet.receive(block_id, into: account_id)
171
+ </code></pre>
172
+
173
+ <h2 id="label-All+commands">All commands</h2>
174
+
175
+ <h3 id="label-Wallets">Wallets</h3>
176
+
177
+ <p>See the <a
178
+ href="https://lukes.github.io/nanook/0.7.0/classes/Nanook/Wallet.html">full
179
+ documentation for Nanook::Wallet</a> for a detailed description of each
180
+ method and example responses.</p>
181
+
182
+ <h4 id="label-Create+wallet-3A">Create wallet:</h4>
183
+
184
+ <pre><code>Nanook.new.wallet.create
185
+ </code></pre>
186
+
187
+ <h4 id="label-Working+with+a+single+wallet-3A">Working with a single wallet:</h4>
188
+
189
+ <pre><code>wallet = Nanook.new.wallet(wallet_id)
190
+
191
+ wallet.export
192
+ wallet.locked?
193
+ wallet.unlock(password)
194
+ wallet.change_password(password)
195
+
196
+ wallet.balance
197
+ wallet.balance(account_break_down: true)
198
+ wallet.balance(unit: :raw)
199
+ wallet.pay(from: your_account_id, to: recipient_account_id, amount: 2, id: unique_id)
200
+ wallet.pay(from: your_account_id, to: recipient_account_id, amount: 2, unit: :raw, id: unique_id)
201
+ wallet.receive(into: account_id)
202
+ wallet.receive(pending_block_id, into: account_id)
203
+
204
+ wallet.account.create
205
+ wallet.accounts
206
+ wallet.contains?(account_id)
207
+
208
+ wallet.destroy
209
+ </code></pre>
210
+
211
+ <h3 id="label-Accounts">Accounts</h3>
212
+
213
+ <h4 id="label-Create+account-3A">Create account:</h4>
214
+
215
+ <pre><code>Nanook.new.wallet(wallet_id).account.create
216
+ </code></pre>
217
+
218
+ <h4 id="label-Working+with+a+single+account-3A">Working with a single account:</h4>
219
+
220
+ <pre><code>account = Nanook.new.wallet(wallet_id).account(account_id)
221
+
222
+ account.exists?
223
+ account.info
224
+ account.info(detailed: true)
225
+ account.ledger
226
+ account.ledger(limit: 10)
227
+ account.history
228
+ account.history(limit: 1)
229
+ account.public_key
230
+ account.delegators
231
+ account.representative
232
+ account.weight
233
+
234
+ account.balance
235
+ account.balance(unit: :raw)
236
+ account.pay(to: recipient_account_id, amount: 2, id: unique_id)
237
+ account.pay(to: recipient_account_id, amount: 2, unit: :raw, id: unique_id)
238
+ account.pending
239
+ account.pending(limit: 1)
240
+ account.receive
241
+ account.receive(pending_block_id)
242
+
243
+ account.destroy
244
+ </code></pre>
245
+
246
+ <h4 id="label-Working+with+any+account+-28not+necessarily+in+your+wallet-29-3A">Working with any account (not necessarily in your wallet):</h4>
247
+
248
+ <p>See the <a
249
+ href="https://lukes.github.io/nanook/0.7.0/classes/Nanook/Account.html">full
250
+ documentation for Nanook::Account</a> for a detailed description of each
251
+ method and example responses.</p>
252
+
253
+ <pre><code>account = Nanook.new.account(account_id)
254
+
255
+ account.exists?
256
+ account.info
257
+ account.info(detailed: true)
258
+ account.ledger
259
+ account.ledger(limit: 10)
260
+ account.history
261
+ account.history(limit: 1)
262
+ account.public_key
263
+ account.delegators
264
+ account.representative
265
+ account.weight
266
+
267
+ account.balance
268
+ account.balance(unit: :raw)
269
+ account.pending
270
+ account.pending(limit: 1)
271
+ </code></pre>
272
+
273
+ <h3 id="label-Blocks">Blocks</h3>
274
+
275
+ <pre><code>block = Nanook.new.block(block_id)
276
+
277
+ block.info # Verified blocks in the ledger
278
+ block.info(allow_unchecked: true) # Verified blocks AND unchecked synchronizing blocks
279
+ block.account
280
+ block.chain
281
+ block.chain(limit: 10)
282
+ block.history
283
+ block.history(limit: 10)
284
+ block.republish
285
+ block.republish(sources: 2)
286
+ block.republish(destinations: 2)
287
+ block.pending?
288
+ block.process
289
+ block.successors
290
+ block.successors(limit: 10)
291
+
292
+ block.generate_work
293
+ block.cancel_work
294
+ block.is_valid_work?(work_id)
295
+ </code></pre>
296
+
297
+ <h3 id="label-Managing+your+nano+node">Managing your nano node</h3>
298
+
299
+ <pre><code>node = Nanook.new.node
300
+
301
+ node.block_count
302
+ node.block_count_type
303
+ node.bootstrap_any
304
+ node.bootstrap(address: &quot;::ffff:138.201.94.249&quot;, port: 7075)
305
+ node.frontier_count
306
+ node.peers
307
+ node.representatives
308
+ node.representatives
309
+ node.sync_progress
310
+ node.synced?
311
+ node.version
312
+
313
+ node.stop
314
+ </code></pre>
315
+
316
+ <h3 id="label-Work+peers">Work peers</h3>
317
+
318
+ <pre><code>work_peers = Nanook.new.work_peers
319
+
320
+ work_peers.add(address: &quot;::ffff:172.17.0.1:7076&quot;, port: 7076)
321
+ work_peers.clear
322
+ work_peers.list
323
+ </code></pre>
324
+
325
+ <h3 id="label-Keys">Keys</h3>
326
+
327
+ <h4 id="label-Create+private+public+key+pair-3A">Create private public key pair:</h4>
328
+
329
+ <pre><code>Nanook.new.key.generate
330
+ Nanook.new.key.generate(seed: seed, index: 0)
331
+ </code></pre>
332
+
333
+ <h4 id="label-Working+with+a+single+key">Working with a single key</h4>
334
+
335
+ <pre><code>key = Nanook.new.key(private_key)
336
+
337
+ key.info
338
+ </code></pre>
339
+
340
+ <h2 id="label-Nanook+Metal"><a href="../classes/Nanook.html">Nanook</a> Metal</h2>
341
+
342
+ <p>You can do any call listed in the <a
343
+ href="https://github.com/nanocurrency/raiblocks/wiki/RPC-protocol">Nano
344
+ RPC</a> directly through the <code>rpc</code> method. The first argument
345
+ should match the <code>action</code> of the RPC call, and then all
346
+ remaining parameters are passed in as arguments.</p>
347
+
348
+ <p>E.g., the <a
349
+ href="https://github.com/nanocurrency/raiblocks/wiki/RPC-protocol#accounts-create">accounts_create
350
+ command</a> can be called like this:</p>
351
+
352
+ <pre><code>Nano.new.rpc(:accounts_create, wallet: wallet_id, count: 2)
353
+ </code></pre>
354
+
355
+ <h2 id="label-Contributing">Contributing</h2>
356
+
357
+ <p>Bug reports and pull requests are welcome. Pull requests with passing tests
358
+ are even better.</p>
359
+
360
+ <p>To run the test suite:</p>
361
+
362
+ <pre><code>bundle exec rspec spec
363
+ </code></pre>
364
+
365
+ <h2 id="label-License">License</h2>
366
+
367
+ <p>The gem is available as open source under the terms of the <a
368
+ href="https://opensource.org/licenses/MIT">MIT License</a>.</p>
369
+
370
+ <h2 id="label-Buy+me+a+nano+coffee">Buy me a nano coffee</h2>
371
+
372
+ <p>This library is totally free to use, but feel free to send some nano <a
373
+ href="https://www.nanode.co/account/xrb_3c3ek3k8135f6e8qtfy8eruk9q3yzmpebes7btzncccdest8ymzhjmnr196j">my
374
+ way</a> if you&#39;d like to!</p>
375
+
376
+ <pre><code>xrb_3c3ek3k8135f6e8qtfy8eruk9q3yzmpebes7btzncccdest8ymzhjmnr196j
377
+ </code></pre>
378
+
379
+ <p><img
380
+ src="https://raw.githubusercontent.com/lukes/nanook/master/img/qr.png"></p>
381
+
382
+ </div>
383
+
384
+
385
+
386
+
387
+
388
+
389
+
390
+
391
+
392
+
393
+
394
+
395
+
396
+
397
+
398
+
399
+
400
+
401
+
402
+
403
+
404
+
405
+
406
+
407
+
408
+
409
+
410
+
411
+
412
+
413
+
414
+ <!-- Methods -->
415
+
416
+
417
+
418
+
419
+ </div>
420
+
421
+ </div>
422
+ </body>
423
+ </html>