zold 0.31.9 → 0.32.0

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.
Files changed (222) hide show
  1. checksums.yaml +4 -4
  2. data/.0pdd.yml +2 -19
  3. data/.github/typos.toml +11 -0
  4. data/.github/workflows/actionlint.yml +5 -21
  5. data/.github/workflows/bashate.yml +25 -0
  6. data/.github/workflows/codecov.yml +11 -24
  7. data/.github/workflows/copyrights.yml +6 -21
  8. data/.github/workflows/hadolint.yml +14 -0
  9. data/.github/workflows/markdown-lint.yml +19 -0
  10. data/.github/workflows/pdd.yml +5 -20
  11. data/.github/workflows/rake.yml +8 -22
  12. data/.github/workflows/reuse.yml +19 -0
  13. data/.github/workflows/shellcheck.yml +19 -0
  14. data/.github/workflows/typos.yml +21 -0
  15. data/.github/workflows/xcop.yml +5 -20
  16. data/.github/workflows/yamllint.yml +5 -20
  17. data/.gitignore +9 -6
  18. data/.rubocop.yml +16 -20
  19. data/.ruby-version +1 -1
  20. data/.rultor.yml +6 -22
  21. data/Dockerfile +11 -27
  22. data/Gemfile +21 -33
  23. data/Gemfile.lock +185 -130
  24. data/Guardfile +0 -0
  25. data/INSTALL.md +80 -59
  26. data/LICENSE.txt +1 -1
  27. data/LICENSES/MIT.txt +21 -0
  28. data/README.md +183 -154
  29. data/REUSE.toml +40 -0
  30. data/Rakefile +4 -38
  31. data/bin/zold +7 -37
  32. data/cucumber.yml +2 -19
  33. data/deploy.sh +4 -22
  34. data/features/cli.feature +2 -0
  35. data/features/gem_package.feature +2 -0
  36. data/features/step_definitions/steps.rb +2 -19
  37. data/features/support/env.rb +2 -19
  38. data/fixtures/merge/asserts.rb +3 -19
  39. data/fixtures/merge/into_no_wallet/assert.rb +2 -19
  40. data/fixtures/merge/legacy_negatives_stay/assert.rb +2 -19
  41. data/fixtures/merge/legacy_negatives_stay/copies/0123456789abcdef/scores.zc +1 -1
  42. data/fixtures/merge/missed_wallets/0123456789abcdef.z +0 -2
  43. data/fixtures/merge/missed_wallets/assert.rb +2 -19
  44. data/fixtures/merge/missed_wallets/copies/0123456789abcdef/scores.zc +1 -1
  45. data/fixtures/merge/negative_overwriting/assert.rb +2 -19
  46. data/fixtures/merge/negatives_in_between/0123456789abcdef.z +0 -1
  47. data/fixtures/merge/negatives_in_between/assert.rb +2 -19
  48. data/fixtures/merge/negatives_in_between/copies/0123456789abcdef/2.zc +0 -1
  49. data/fixtures/merge/negatives_in_between/opts +1 -1
  50. data/fixtures/merge/random_expenses/assert.rb +2 -19
  51. data/fixtures/merge/random_expenses/opts +1 -1
  52. data/fixtures/merge/simple_case/assert.rb +2 -19
  53. data/fixtures/merge/simple_case/opts +1 -1
  54. data/fixtures/merge/unconfirmed_income/assert.rb +2 -19
  55. data/fixtures/scripts/_head.sh +16 -33
  56. data/fixtures/scripts/calculate-scores.sh +3 -20
  57. data/fixtures/scripts/distribute-wallet.sh +26 -43
  58. data/fixtures/scripts/print-helps.sh +5 -23
  59. data/fixtures/scripts/pull-on-start.sh +12 -29
  60. data/fixtures/scripts/push-and-pull.sh +10 -27
  61. data/fixtures/scripts/redeploy-on-upgrade.sh +18 -34
  62. data/fixtures/scripts/spread-wallets.sh +24 -40
  63. data/lib/zold/age.rb +3 -20
  64. data/lib/zold/amount.rb +3 -20
  65. data/lib/zold/cached_wallets.rb +3 -20
  66. data/lib/zold/commands/alias.rb +4 -21
  67. data/lib/zold/commands/args.rb +4 -21
  68. data/lib/zold/commands/calculate.rb +5 -22
  69. data/lib/zold/commands/clean.rb +6 -23
  70. data/lib/zold/commands/create.rb +5 -22
  71. data/lib/zold/commands/diff.rb +5 -22
  72. data/lib/zold/commands/fetch.rb +6 -23
  73. data/lib/zold/commands/invoice.rb +5 -22
  74. data/lib/zold/commands/list.rb +5 -22
  75. data/lib/zold/commands/merge.rb +7 -24
  76. data/lib/zold/commands/next.rb +5 -22
  77. data/lib/zold/commands/node.rb +4 -21
  78. data/lib/zold/commands/pay.rb +6 -23
  79. data/lib/zold/commands/propagate.rb +5 -22
  80. data/lib/zold/commands/pull.rb +5 -22
  81. data/lib/zold/commands/push.rb +5 -22
  82. data/lib/zold/commands/remote.rb +7 -24
  83. data/lib/zold/commands/remove.rb +5 -22
  84. data/lib/zold/commands/routines/audit.rb +4 -21
  85. data/lib/zold/commands/routines/gc.rb +6 -23
  86. data/lib/zold/commands/routines/reconcile.rb +5 -22
  87. data/lib/zold/commands/routines/reconnect.rb +4 -21
  88. data/lib/zold/commands/routines/retire.rb +4 -21
  89. data/lib/zold/commands/routines/spread.rb +5 -22
  90. data/lib/zold/commands/routines.rb +3 -20
  91. data/lib/zold/commands/show.rb +5 -22
  92. data/lib/zold/commands/taxes.rb +5 -22
  93. data/lib/zold/commands/thread_badge.rb +3 -20
  94. data/lib/zold/copies.rb +6 -25
  95. data/lib/zold/dir_items.rb +3 -20
  96. data/lib/zold/endless.rb +5 -22
  97. data/lib/zold/gem.rb +3 -20
  98. data/lib/zold/hands.rb +6 -23
  99. data/lib/zold/head.rb +4 -21
  100. data/lib/zold/hexnum.rb +3 -20
  101. data/lib/zold/http.rb +3 -20
  102. data/lib/zold/hungry_wallets.rb +6 -23
  103. data/lib/zold/id.rb +3 -20
  104. data/lib/zold/json_page.rb +5 -22
  105. data/lib/zold/key.rb +3 -20
  106. data/lib/zold/metronome.rb +5 -22
  107. data/lib/zold/node/async_entrance.rb +6 -23
  108. data/lib/zold/node/entrance.rb +7 -24
  109. data/lib/zold/node/farm.rb +5 -22
  110. data/lib/zold/node/farmers.rb +15 -32
  111. data/lib/zold/node/front.rb +6 -23
  112. data/lib/zold/node/journaled_pipeline.rb +8 -25
  113. data/lib/zold/node/nodup_entrance.rb +6 -23
  114. data/lib/zold/node/nospam_entrance.rb +6 -23
  115. data/lib/zold/node/pipeline.rb +6 -23
  116. data/lib/zold/node/safe_entrance.rb +4 -22
  117. data/lib/zold/node/soft_error.rb +3 -20
  118. data/lib/zold/node/spread_entrance.rb +5 -22
  119. data/lib/zold/node/sync_entrance.rb +5 -22
  120. data/lib/zold/node/trace.rb +3 -20
  121. data/lib/zold/patch.rb +6 -23
  122. data/lib/zold/prefixes.rb +3 -20
  123. data/lib/zold/remotes.rb +5 -22
  124. data/lib/zold/signature.rb +3 -20
  125. data/lib/zold/size.rb +3 -20
  126. data/lib/zold/sync_wallets.rb +5 -22
  127. data/lib/zold/tax.rb +4 -21
  128. data/lib/zold/thread_pool.rb +4 -21
  129. data/lib/zold/tree_wallets.rb +3 -20
  130. data/lib/zold/txn.rb +4 -21
  131. data/lib/zold/txns.rb +4 -21
  132. data/lib/zold/upgrades.rb +4 -21
  133. data/lib/zold/verbose_thread.rb +5 -22
  134. data/lib/zold/version.rb +4 -21
  135. data/lib/zold/version_file.rb +4 -21
  136. data/lib/zold/wallet.rb +6 -23
  137. data/lib/zold/wallets.rb +5 -23
  138. data/lib/zold.rb +3 -21
  139. data/resources/banned-wallets.log +6 -6
  140. data/test/commands/routines/test_audit.rb +3 -21
  141. data/test/commands/routines/test_gc.rb +3 -21
  142. data/test/commands/routines/test_reconcile.rb +3 -21
  143. data/test/commands/routines/test_reconnect.rb +3 -21
  144. data/test/commands/routines/test_retire.rb +3 -21
  145. data/test/commands/test_alias.rb +2 -20
  146. data/test/commands/test_calculate.rb +5 -23
  147. data/test/commands/test_clean.rb +5 -23
  148. data/test/commands/test_create.rb +6 -24
  149. data/test/commands/test_diff.rb +4 -22
  150. data/test/commands/test_fetch.rb +3 -21
  151. data/test/commands/test_invoice.rb +3 -21
  152. data/test/commands/test_list.rb +3 -21
  153. data/test/commands/test_merge.rb +12 -35
  154. data/test/commands/test_node.rb +3 -21
  155. data/test/commands/test_pay.rb +5 -23
  156. data/test/commands/test_propagate.rb +6 -24
  157. data/test/commands/test_pull.rb +4 -22
  158. data/test/commands/test_push.rb +3 -21
  159. data/test/commands/test_remote.rb +10 -28
  160. data/test/commands/test_remove.rb +7 -25
  161. data/test/commands/test_show.rb +3 -21
  162. data/test/commands/test_taxes.rb +5 -23
  163. data/test/fake_home.rb +5 -22
  164. data/test/node/fake_entrance.rb +3 -20
  165. data/test/node/fake_node.rb +5 -22
  166. data/test/node/test_async_entrance.rb +3 -21
  167. data/test/node/test_entrance.rb +7 -25
  168. data/test/node/test_farm.rb +15 -33
  169. data/test/node/test_farmers.rb +3 -21
  170. data/test/node/test_front.rb +22 -42
  171. data/test/node/test_nodup_entrance.rb +4 -22
  172. data/test/node/test_nospam_entrance.rb +6 -24
  173. data/test/node/test_safe_entrance.rb +3 -21
  174. data/test/node/test_spread_entrance.rb +4 -22
  175. data/test/node/test_sync_entrance.rb +4 -22
  176. data/test/node/test_trace.rb +4 -22
  177. data/test/test__helper.rb +32 -31
  178. data/test/test_age.rb +5 -23
  179. data/test/test_amount.rb +15 -34
  180. data/test/test_cached_wallets.rb +3 -21
  181. data/test/test_copies.rb +10 -28
  182. data/test/test_dir_items.rb +4 -22
  183. data/test/test_gem.rb +3 -21
  184. data/test/test_hands.rb +3 -21
  185. data/test/test_hexnum.rb +3 -21
  186. data/test/test_http.rb +9 -27
  187. data/test/test_hungry_wallets.rb +6 -24
  188. data/test/test_id.rb +10 -28
  189. data/test/test_json_page.rb +3 -21
  190. data/test/test_key.rb +5 -23
  191. data/test/test_metronome.rb +6 -24
  192. data/test/test_patch.rb +10 -28
  193. data/test/test_prefixes.rb +3 -21
  194. data/test/test_remotes.rb +17 -35
  195. data/test/test_signature.rb +3 -21
  196. data/test/test_size.rb +3 -21
  197. data/test/test_sync_wallets.rb +3 -21
  198. data/test/test_tax.rb +6 -24
  199. data/test/test_thread_pool.rb +6 -24
  200. data/test/test_tree_wallets.rb +4 -22
  201. data/test/test_txn.rb +3 -21
  202. data/test/test_upgrades.rb +3 -21
  203. data/test/test_verbose_thread.rb +6 -24
  204. data/test/test_version.rb +2 -20
  205. data/test/test_wallet.rb +15 -33
  206. data/test/test_wallets.rb +4 -22
  207. data/test/test_zold.rb +7 -25
  208. data/test/upgrades/test_delete_banned_wallets.rb +4 -22
  209. data/test/upgrades/test_protocol_up.rb +3 -21
  210. data/upgrades/2.rb +3 -20
  211. data/upgrades/delete_banned_wallets.rb +3 -20
  212. data/upgrades/move_wallets_into_tree.rb +3 -20
  213. data/upgrades/protocol_up.rb +3 -20
  214. data/upgrades/rename_foreign_wallets.rb +3 -20
  215. data/views/journal.haml +25 -0
  216. data/views/layout.haml +25 -0
  217. data/views/wallet.haml +25 -0
  218. data/zold.gemspec +5 -21
  219. metadata +33 -15
  220. data/.simplecov +0 -36
  221. data/lib/zold/log.rb +0 -139
  222. data/test/test_log.rb +0 -49
data/README.md CHANGED
@@ -1,63 +1,61 @@
1
- <img src="http://www.zold.io/logo.svg" width="92px" height="92px"/>
1
+ # Non-Blockchain Cryptocurrency
2
2
 
3
3
  [![EO principles respected here](https://www.elegantobjects.org/badge.svg)](https://www.elegantobjects.org)
4
- [![DevOps By Rultor.com](http://www.rultor.com/b/yegor256/zold)](http://www.rultor.com/p/yegor256/zold)
4
+ [![DevOps By Rultor.com](https://www.rultor.com/b/yegor256/zold)](https://www.rultor.com/p/yegor256/zold)
5
5
  [![We recommend RubyMine](https://www.elegantobjects.org/rubymine.svg)](https://www.jetbrains.com/ruby/)
6
6
 
7
- [![PDD status](http://www.0pdd.com/svg?name=zold-io/zold)](http://www.0pdd.com/p?name=zold-io/zold)
8
- [![Gem Version](https://badge.fury.io/rb/zold.svg)](http://badge.fury.io/rb/zold)
7
+ [![PDD status](https://www.0pdd.com/svg?name=zold-io/zold)](https://www.0pdd.com/p?name=zold-io/zold)
8
+ [![Gem Version](https://badge.fury.io/rb/zold.svg)](https://badge.fury.io/rb/zold)
9
9
  [![Test Coverage](https://img.shields.io/codecov/c/github/zold-io/zold.svg)](https://codecov.io/github/zold-io/zold?branch=master)
10
- [![Yard Docs](http://img.shields.io/badge/yard-docs-blue.svg)](http://rubydoc.info/github/zold-io/zold/master/frames)
10
+ [![Yard Docs](https://img.shields.io/badge/yard-docs-blue.svg)](https://rubydoc.info/github/zold-io/zold/master/frames)
11
11
  [![Maintainability](https://api.codeclimate.com/v1/badges/2861728929db934eb376/maintainability)](https://codeclimate.com/github/zold-io/zold/maintainability)
12
12
  [![License](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/yegor256/takes/blob/master/LICENSE.txt)
13
13
  [![Hits-of-Code](https://hitsofcode.com/github/zold-io/zold)](https://hitsofcode.com/github/zold-io/zold)
14
14
 
15
- To understand what Zold cryptocurrency is about you may want
16
- to watch [this video](https://youtu.be/5A9uBwMow0M) first. Then, you may
17
- want to read [this blog](https://blog.zold.io/2018/07/08/mission.html) post.
18
- Then, you have to read the [Green Paper](https://papers.zold.io/green-paper.pdf)
15
+ To understand what Zold cryptocurrency is about, you may want
16
+ to watch [this video][video] first. Then, you may
17
+ want to read [this blog][blog] post.
18
+ Then, you have to read the [Green Paper][green-paper]
19
19
  (just four pages). In a nutshell, Zold is a cryptocurrency with the following
20
20
  features:
21
21
 
22
- * No Blockchain
23
- * No General Ledger
24
- * Very fast, because de-centralized
25
- * 100 times cheaper than Bitcoin
26
- * Proof-of-work
27
- * Unique consensus protocol
28
- * Pre-mined with total capacity of 2 billion ZLD
29
- * Anonymous
30
- * Written in Ruby
22
+ * No Blockchain
23
+ * No General Ledger
24
+ * Very fast, because decentralized
25
+ * 100 times cheaper than Bitcoin
26
+ * Proof-of-work
27
+ * Unique consensus protocol
28
+ * Pre-mined with a total capacity of 2 billion ZLD
29
+ * Anonymous
30
+ * Written in Ruby
31
31
 
32
- More details you can find in the [White Paper](https://papers.zold.io/wp.pdf).
32
+ You can find more details in the [White Paper][white-paper].
33
33
 
34
- You can also find us at the [Bitcointalk](https://bitcointalk.org/index.php?topic=5095078) forum.
34
+ You can also find us at the [Bitcointalk][bitcointalk] forum.
35
35
 
36
- Join our [Telegram group](https://t.me/zold_io) to discuss it all live.
36
+ Join our [Telegram group][telegram] to discuss it all live.
37
37
 
38
38
  ## How to Use
39
39
 
40
- You can try the web wallet [here](https://wts.zold.io), but the best way
40
+ You can try the [web wallet][wts], but the best way
41
41
  to use Zold is through the command line tool, which has all the features
42
- and should remind you Git, if you are a programmer.
42
+ and should remind you of Git, if you are a programmer.
43
43
 
44
- First, install [Ruby 2.3+](https://www.ruby-lang.org/en/documentation/installation/),
45
- [Rubygems](https://rubygems.org/pages/download), and
46
- the [gem](https://rubygems.org/gems/zold).
47
- Here is [how](https://github.com/zold-io/zold/blob/master/INSTALL.md).
44
+ First, install [Ruby 2.3+][ruby], [Rubygems][rubygems], and the [gem][zold-gem].
45
+ Here is [how][install].
48
46
 
49
47
  To make sure it's installed, try:
50
48
 
51
49
  ```bash
52
- $ zold --help
50
+ zold --help
53
51
  ```
54
52
 
55
53
  You will need RSA private and public keys in `~/.ssh`.
56
54
  If you don't have them yet, run this in order to generate a new pair
57
- (just hit <kbd>Enter</kbd> when it asks you for a password):
55
+ (just hit `Enter` when it asks you for a password):
58
56
 
59
57
  ```bash
60
- $ ssh-keygen -t rsa -b 4096
58
+ ssh-keygen -t rsa -b 4096
61
59
  ```
62
60
 
63
61
  Then, create a new wallet (instead of `5f96e731e48ae21f` there will be your
@@ -71,7 +69,7 @@ $ zold create
71
69
  Then, push it to the network:
72
70
 
73
71
  ```bash
74
- $ zold push 5f96e731e48ae21f
72
+ zold push 5f96e731e48ae21f
75
73
  ```
76
74
 
77
75
  Then, give this ID to your friend, who is going to pay you.
@@ -97,28 +95,27 @@ Finally, you have to push your wallet to the network so that your friend
97
95
  knows about the payment:
98
96
 
99
97
  ```bash
100
- $ zold push 5f96e731e48ae21f
98
+ zold push 5f96e731e48ae21f
101
99
  ```
102
100
 
103
101
  That's it.
104
102
 
105
103
  ## How to Start a Node
106
104
 
107
- You also can contribute to Zold by running a node on your server.
108
- In order to do that just run (with your own wallet ID, of course):
105
+ You can also contribute to Zold by running a node on your server.
106
+ In order to do that, just run (with your own wallet ID, of course):
109
107
 
110
108
  ```bash
111
- $ zold node --invoice=5f96e731e48ae21f
109
+ zold node --invoice=5f96e731e48ae21f
112
110
  ```
113
111
 
114
112
  Then, open the page `localhost:4096` in your browser
115
- (you may need to open the inbound port at your
116
- [IP firewall](https://www.howtogeek.com/177621/the-beginners-guide-to-iptables-the-linux-firewall/)).
113
+ (you may need to open the inbound port in your [IP firewall]).
117
114
  If you see a simple JSON document, everything is fine.
118
- Next, hit <kbd>Ctrl</kbd>+<kbd>c</kbd> and run it again, but with `--nohup`:
115
+ Next, hit `Ctrl`+`c` and run it again, but with `--nohup`:
119
116
 
120
117
  ```bash
121
- $ zold node --nohup --invoice=5f96e731e48ae21f
118
+ zold node --nohup --invoice=5f96e731e48ae21f
122
119
  ```
123
120
 
124
121
  Now you can close the console;
@@ -128,7 +125,7 @@ The software will never stop, even if it crashes internally with any error.
128
125
  In order to terminate it forcefully, do:
129
126
 
130
127
  ```bash
131
- $ killall -9 zold
128
+ killall -9 zold
132
129
  ```
133
130
 
134
131
  Grateful users of the system will pay "taxes" to your wallet
@@ -138,52 +135,58 @@ send you bonuses for keeping the node online (approximately 1 ZLD per day).
138
135
  If you are lost, run this:
139
136
 
140
137
  ```bash
141
- $ zold node --help
138
+ zold node --help
142
139
  ```
143
140
 
144
- You can run a node in a docker container also, using [yegor256/zold](https://hub.docker.com/r/yegor256/zold)
145
- built from this [Dockerfile](https://github.com/zold-io/zold/blob/master/Dockerfile).
141
+ You can also run a node in a Docker container, using [yegor256/zold][docker]
142
+ built from this [Dockerfile][dockerfile].
146
143
 
147
144
  ```bash
148
145
  docker run -d -p 4096:4096 yegor256/zold /node.sh --host=<your host IP> --invoice=5f96e731e48ae21f
149
146
  ```
150
147
 
151
- To store zold data between container restarts create a volume or bind a directory from host:
148
+ To store Zold data between container restarts, create a volume or bind
149
+ a directory from the host:
152
150
 
153
151
  ```bash
154
152
  docker volume create zold
155
- docker run -d -p 4096:4096 -v zold:/zold yegor256/zold /node.sh --host=<your host IP> --invoice=5f96e731e48ae21f
153
+ docker run -d -p 4096:4096 -v zold:/zold yegor256/zold \
154
+ /node.sh --host=<your host IP> --invoice=5f96e731e48ae21f
156
155
  ```
157
156
 
158
- You may find this blog post useful:
159
- [How to Run Zold Node?](https://blog.zold.io/2019/01/10/how-to-run-node.html)
157
+ You may find this blog post useful: [How to Run Zold Node?][node-blog]
160
158
 
161
159
  ## If Your File System is on Fire (or How to Reduce Your Hard Disk Usage)
162
160
 
163
- At the moment, the file system is utilised too aggressively and if you
164
- like to calm this process down and have a bit of spare memory, you may
161
+ At the moment, the file system is utilized too aggressively and if you
162
+ would like to calm this process down and have a bit of spare memory, you may
165
163
  find the following approach handy (directly applicable to FreeBSD OS).
166
164
 
167
- The application data can be moved to [a memory-backed memory disk](https://www.freebsd.org/doc/handbook/disks-virtual.html)
168
- with a periodical syncing of `farm`, `zold.log` and `.zolddata` to the
165
+ The application data can be moved to [a memory-backed memory disk][freebsd-disk]
166
+ with periodic syncing of `farm`, `zold.log` and `.zolddata` to the
169
167
  hard disk.
170
168
 
171
169
  The `/etc/fstab` entry:
172
- ```
170
+
171
+ ```text
173
172
  md /usr/home/zold/app-in-mem mfs rw,-M,-n,-s512m,-wzold:zold,-p0755 2 0
174
173
  ```
175
174
 
176
175
  The `/etc/crontab` entry:
177
- ```
178
- */10 * * * * zold /usr/local/bin/rsync -aubv /usr/home/zold/app-in-mem/farm /usr/home/zold/app-in-mem/zold.log /usr/home/zold/app-in-mem/.zoldata /usr/home/zold/app/
176
+
177
+ ```text
178
+ */10 * * * * zold /usr/local/bin/rsync -aubv \
179
+ /usr/home/zold/app-in-mem/farm /usr/home/zold/app-in-mem/zold.log \
180
+ /usr/home/zold/app-in-mem/.zoldata /usr/home/zold/app/
179
181
  ```
180
182
 
181
183
  ## Frequently Asked Questions
182
184
 
183
185
  > Is there a configuration file?
184
186
 
185
- Any command line flag can also be put in the `~/.zold` file, one per line, e.g.:
186
- ```
187
+ Any command line flag can also be put in the `~/.zold` file, one per line:
188
+
189
+ ```text
187
190
  --home=~/.zold_home
188
191
  --verbose
189
192
  ```
@@ -197,9 +200,9 @@ But the private key is your personal asset.
197
200
  Anyone can use your wallet if they have the private key.
198
201
  Keep it safe and secure!
199
202
 
200
- > How to use my RSA private key from https://wts.zold.io?
203
+ > How do I use my RSA private key from <https://wts.zold.io>?
201
204
 
202
- Retrieve the key via https://wts.zold.io/key. It can then be used with
205
+ Retrieve the key via <https://wts.zold.io/key>. It can then be used with
203
206
  the command line flag `--private-key` (e.g., for the `pay`, `node` and
204
207
  `taxes` commands).
205
208
 
@@ -211,11 +214,12 @@ with the command line flag `--public-key` (e.g., for the `create` command).
211
214
 
212
215
  You just do `zold pull <Wallet_ID>` and the rewards (taxes) will be visible there.
213
216
 
214
- > Can I setup multiple nodes with one wallet address?
217
+ > Can I set up multiple nodes with one wallet address?
215
218
 
216
219
  Yes, you can run many nodes with the same wallet ID.
217
220
 
218
- > Is there a way to increase the number of threads in order to maximize computing power of multiple core machines?
221
+ > Is there a way to increase the number of threads in order to maximize
222
+ > computing power of multi-core machines?
219
223
 
220
224
  Yes, you can use `--threads` command line argument for your node
221
225
  and the number of threads will be as big as you wish.
@@ -226,48 +230,48 @@ When you open up the front web page of your node, you will see a JSON document
226
230
  with a lot of technical details. Here is the explanation of the majority of them:
227
231
 
228
232
  `version` is the current version of the running software.
229
- The node is supposed to update update itself automatically (if you run it via `zold-nohup`)
233
+ The node is supposed to update itself automatically (if you run it via `zold-nohup`)
230
234
  every time it discovers another node with a higher version.
231
235
 
232
236
  `network` is the name of the network the node belongs to.
233
237
  The production network's name is `zold`.
234
- For testing purposes you can start a node in a test network, using `--network=test`.
238
+ For testing purposes, you can start a node in a test network, using `--network=test`.
235
239
 
236
240
  `score` is the current score your node is exposing to the network now.
237
241
  All other nodes are using this information in order to decide how much
238
- they can trust your node with the information it provides, about wallets.
242
+ they can trust your node with the information it provides about wallets.
239
243
  The higher the score, the better.
240
244
 
241
- * `value` is the amount of suffixes the score contains; this is the
242
- number all other nodes rely on.
245
+ * `value` is the number of suffixes the score contains; this is the
246
+ number all other nodes rely on.
243
247
 
244
- * `host` is the host name of the node, it must be equal to the public
245
- IP or domain name of the node; it is provided in `--host` command line
246
- option of `zold-nohup`.
248
+ * `host` is the host name of the node, it must be equal to the public
249
+ IP or domain name of the node; it is provided in `--host` command line
250
+ option of `zold-nohup`.
247
251
 
248
- * `port` is the TCP port number, which usually is equal to 4096;
249
- it is provided in `--port` command line option.
252
+ * `port` is the TCP port number, which usually is equal to 4096;
253
+ it is provided in `--port` command line option.
250
254
 
251
- * `invoice` is the address of your wallet, where the system
252
- will send you rewards for keeping the node online and some
253
- users will pay taxes; it is provided in `--invoice` command line option.
255
+ * `invoice` is the address of your wallet, where the system
256
+ will send you rewards for keeping the node online and some
257
+ users will pay taxes; it is provided in `--invoice` command line option.
254
258
 
255
- * `time` is the ISO-8601 UTC date and time of when your node
256
- started to calculate the score.
259
+ * `time` is the ISO-8601 UTC date and time of when your node
260
+ started to calculate the score.
257
261
 
258
- * `strength` is the amount of tailing zeros the hash contains.
262
+ * `strength` is the number of trailing zeros the hash contains.
259
263
 
260
- * `hash` is the SHA-256 hash of the score text.
264
+ * `hash` is the SHA-256 hash of the score text.
261
265
 
262
- * `minutes` is the age of the score, in minutes since the moment
263
- it was created.
266
+ * `minutes` is the age of the score, in minutes since the moment
267
+ it was created.
264
268
 
265
269
  `pid` is the Unix process ID of the running software.
266
270
 
267
- `cpus` is the amount of CPUs detected on the server.
271
+ `cpus` is the number of CPUs detected on the server.
268
272
 
269
- `threads` is the amount of running threads vs. the total amount of
270
- threads in the Ruby process. If the second number is over 100 there
273
+ `threads` is the number of running threads vs. the total number of
274
+ threads in the Ruby process. If the second number is over 100, there
271
275
  is definitely something wrong with the software.
272
276
 
273
277
  `wallets` is the total number of wallets managed by the server.
@@ -281,17 +285,18 @@ network. You can see the full list of nodes at `/remotes` URL of your node.
281
285
 
282
286
  `farm` is the score calculating software.
283
287
 
284
- * `threads` is the amount of threads this software module is using.
285
- This number is configured via the `--threads` command line option.
286
- The bigger the number, the more intensively the software will use
287
- your CPUs. It is recommended to make this number equal to the
288
- number of CPUs available.
288
+ * `threads` is the number of threads this software module is using.
289
+ This number is configured via the `--threads` command line option.
290
+ The bigger the number, the more intensively the software will use
291
+ your CPUs. It is recommended to make this number equal to the
292
+ number of CPUs available.
289
293
 
290
- * `pipeline` is ... something not important to you.
294
+ * `pipeline` is ... something not important to you.
291
295
 
292
- * `best` is the list of scores known to the farm at the moment (with their ages in minutes).
296
+ * `best` is the list of scores known to the farm at the moment
297
+ (with their ages in minutes).
293
298
 
294
- `entrance` is the place where all new wallets arive and get merged and pushed
299
+ `entrance` is the place where all new wallets arrive and get merged and pushed
295
300
  further. The health of this point is critical to the entire node. Some
296
301
  numbers it includes must be watched carefully.
297
302
 
@@ -299,7 +304,7 @@ To be continued...
299
304
 
300
305
  `date` is the current date and time on the server.
301
306
 
302
- `hours_alive` is the time in hours your server is alive without a reboot.
307
+ `hours_alive` is the time in hours your server has been alive without a reboot.
303
308
 
304
309
  ## HTTP RESTful API
305
310
 
@@ -308,92 +313,94 @@ set of HTTP entry points, which you can use to retrieve information
308
313
  about wallets, node status, log details, and some other things. Here
309
314
  is a more or less complete list of them:
310
315
 
311
- * `GET /`: returns the JSON explained above
316
+ * `GET /`: returns the JSON explained above
312
317
 
313
- * `GET /score`: returns the text presentation of the current Score
318
+ * `GET /score`: returns the text presentation of the current Score
314
319
 
315
- * `GET /version`: returns the version of the software
320
+ * `GET /version`: returns the version of the software
316
321
 
317
- * `GET /protocol`: returns the protocol ID
322
+ * `GET /protocol`: returns the protocol ID
318
323
 
319
- * `GET /wallet/ID`: returns the JSON with wallet details
324
+ * `GET /wallet/ID`: returns the JSON with wallet details
320
325
 
321
- * `GET /wallet/ID/balance`: returns wallet balance in zents (text/plain)
326
+ * `GET /wallet/ID/balance`: returns wallet balance in zents (text/plain)
322
327
 
323
- * `GET /wallet/ID/key`: returns wallet public RSA key
328
+ * `GET /wallet/ID/key`: returns wallet public RSA key
324
329
 
325
- * `GET /wallet/ID/mtime`: returns ISO-8601 time of wallet file modification
330
+ * `GET /wallet/ID/mtime`: returns ISO-8601 time of wallet file modification
326
331
 
327
- * `GET /wallet/ID/size`: returns the size of the wallet file in bytes
332
+ * `GET /wallet/ID/size`: returns the size of the wallet file in bytes
328
333
 
329
- * `GET /wallet/ID/age`: returns the age of the wallet, in seconds
334
+ * `GET /wallet/ID/age`: returns the age of the wallet, in seconds
330
335
 
331
- * `GET /wallet/ID/txns`: returns the amount of transactions in the wallet
336
+ * `GET /wallet/ID/txns`: returns the number of transactions in the wallet
332
337
 
333
- * `GET /wallet/ID/debt`: returns the tax debt of the wallet in zents
338
+ * `GET /wallet/ID/debt`: returns the tax debt of the wallet in zents
334
339
 
335
- * `GET /wallet/ID/digest`: returns SHA-256 digest of the wallet file
340
+ * `GET /wallet/ID/digest`: returns SHA-256 digest of the wallet file
336
341
 
337
- * `GET /wallet/ID/mnemo`: returns the mnemo short string of the wallet
342
+ * `GET /wallet/ID/mnemo`: returns the mnemo short string of the wallet
338
343
 
339
- * `GET /wallet/ID/txns.json`: returns the full list of transactions in the wallet in JSON document
344
+ * `GET /wallet/ID/txns.json`: returns the full list of transactions
345
+ in the wallet as a JSON document
340
346
 
341
- * `GET /wallet/ID.txt`: returns the text presentation of the wallet
347
+ * `GET /wallet/ID.txt`: returns the text presentation of the wallet
342
348
 
343
- * `GET /wallet/ID.html`: returns the HTML presentation of the wallet
349
+ * `GET /wallet/ID.html`: returns the HTML presentation of the wallet
344
350
 
345
- * `GET /wallet/ID.bin`: returns the entire wallet file
351
+ * `GET /wallet/ID.bin`: returns the entire wallet file
346
352
 
347
- * `GET /wallet/ID/copies`: returns the list of copies of the wallet
353
+ * `GET /wallet/ID/copies`: returns the list of copies of the wallet
348
354
 
349
- * `GET /wallet/ID/copy/NAME`: returns the entire content of a single copy of the wallet
355
+ * `GET /wallet/ID/copy/NAME`: returns the entire content of a single copy
356
+ of the wallet
350
357
 
351
- * `PUT /wallet/ID`: accepts a new content of the wallet, in order to
352
- modify the one stored on the server (PUSH operation)
358
+ * `PUT /wallet/ID`: accepts new content for the wallet, in order to
359
+ modify the one stored on the server (PUSH operation)
353
360
 
354
- * `GET /wallets`: returns the list of all wallets maintained by the node,
355
- in plain text, separated by EOL
361
+ * `GET /wallets`: returns the list of all wallets maintained by the node,
362
+ in plain text, separated by EOL
356
363
 
357
- * `GET /remotes`: returns the list of remote nodes in JSON
364
+ * `GET /remotes`: returns the list of remote nodes in JSON
358
365
 
359
- * `GET /ledger`: returns the list of recently visible transactions
366
+ * `GET /ledger`: returns the list of recently visible transactions
360
367
 
361
- * `GET /ledger.json`: returns the list of recently visible transactions, in JSON
368
+ * `GET /ledger.json`: returns the list of recently visible transactions, in JSON
362
369
 
363
- There are a few other entry points, which exist most for debugging purposes,
370
+ There are a few other entry points, which exist mostly for debugging purposes;
364
371
  they may not be supported by alternative implementations of the node software:
365
372
 
366
- * `GET /pid`: returns the process ID of the software
373
+ * `GET /pid`: returns the process ID of the software
367
374
 
368
- * `GET /trace`: returns the entire log of the node
375
+ * `GET /trace`: returns the entire log of the node
369
376
 
370
- * `GET /farm`: returns the statistics of the Farm
377
+ * `GET /farm`: returns the statistics of the Farm
371
378
 
372
- * `GET /metronome`: returns the statistics of the Metronome
379
+ * `GET /metronome`: returns the statistics of the Metronome
373
380
 
374
- * `GET /threads`: returns the statistics of all Ruby threads
381
+ * `GET /threads`: returns the statistics of all Ruby threads
375
382
 
376
- * `GET /ps`: returns the statistics of all currently running Unix processes
383
+ * `GET /ps`: returns the statistics of all currently running Unix processes
377
384
 
378
- * `GET /queue`: returns the statistics of the node queue
385
+ * `GET /queue`: returns the statistics of the node queue
379
386
 
380
- * `GET /journal`: returns the journal, in HTML
387
+ * `GET /journal`: returns the journal, in HTML
381
388
 
382
- * `GET /journal/item?id=ID`: returns the content of a single journal entry
389
+ * `GET /journal/item?id=ID`: returns the content of a single journal entry
383
390
 
384
- There could be other entry points, not documented here.
391
+ There may be other entry points not documented here.
385
392
 
386
393
  ## SDK
387
394
 
388
395
  Here is how you use Zold SDK from your Ruby app. First, you should
389
- add `zold` [gem](https://rubygems.org/gems/zold)
390
- to your [`Gemfile`](https://bundler.io/gemfile.html) or just:
396
+ add `zold` [gem][zold-gem] to your [`Gemfile`][gemfile] or just:
391
397
 
392
398
  ```bash
393
- $ gem install zold
399
+ gem install zold
394
400
  ```
395
401
 
396
- Then, you will need a directory where wallets and other supplementary data will be kept.
402
+ Then, you will need a directory where wallets and other supplementary data
403
+ will be kept.
397
404
  This can be any directory, including a temporary one. If it doesn't exist,
398
405
  it will automatically be created:
399
406
 
@@ -436,7 +443,9 @@ You can also pull a wallet from the network:
436
443
 
437
444
  ```ruby
438
445
  require 'zold/commands/pull'
439
- Zold::Pull.new(wallets: wallets, remotes: remotes, copies: copies).run(['pull', '00000000000ff1ce'])
446
+ Zold::Pull.new(wallets: wallets, remotes: remotes, copies: copies).run(
447
+ ['pull', '00000000000ff1ce']
448
+ )
440
449
  ```
441
450
 
442
451
  Then, you can make a payment:
@@ -448,8 +457,8 @@ Zold::Pay.new(wallets: wallets).run(
448
457
  )
449
458
  ```
450
459
 
451
- Here `--private-key=/tmp/id_rsa` points to the absolute location of the private RSA key of
452
- the paying wallet.
460
+ Here `--private-key=/tmp/id_rsa` points to the
461
+ absolute location of the private RSA key of the paying wallet.
453
462
 
454
463
  Finally, you can push a wallet to the network:
455
464
 
@@ -459,12 +468,14 @@ Zold::Push.new(wallets: wallets, remotes: remotes).run(%w[push 17737fee5b825835]
459
468
  ```
460
469
 
461
470
  By default, all commands will work quietly, reporting absolutely nothing
462
- to the console. To change that, you can use `log` argument of their constructors.
463
- For example, `Zold::Log::Verbose` will print a lot of information to the console:
471
+ to the console.
472
+ To change that, you can use the `log` argument of their constructors.
473
+ For example, `Loog::VERBOSE` will print a lot of information to the console:
464
474
 
465
475
  ```ruby
466
476
  require 'zold/commands/push'
467
- Zold::Push.new(wallets: wallets, remotes: remotes, log: Zold::Log::VERBOSE).run(['push'])
477
+ require 'loog'
478
+ Zold::Push.new(wallets: wallets, remotes: remotes, log: Loog::VERBOSE).run(['push'])
468
479
  ```
469
480
 
470
481
  Also, all commands by default assume that you are working in a `test` network.
@@ -474,42 +485,60 @@ give them `--network=zold` argument, for example:
474
485
 
475
486
  ```ruby
476
487
  require 'zold/commands/push'
477
- Zold::Push.new(wallets: wallets, remotes: remotes).run(%w[push 17737fee5b825835 --network=zold])
488
+ Zold::Push.new(wallets: wallets, remotes: remotes).run(
489
+ %w[push 17737fee5b825835 --network=zold]
490
+ )
478
491
  ```
479
492
 
480
493
  If anything doesn't work as explained above, please
481
- [submit at ticket](https://github.com/zold-io/zold/issues) or join our
482
- [Telegram group](https://t.me/zold_io) and complain there.
494
+ [submit a ticket][issues] or join our [Telegram group][telegram] and complain there.
483
495
 
484
496
  ## How to Contribute
485
497
 
486
498
  It is a Ruby command line gem. First, install
487
- [Ruby 2.3+](https://www.ruby-lang.org/en/documentation/installation/),
488
- [Rubygems](https://rubygems.org/pages/download),
489
- and
490
- [Bundler](https://bundler.io/).
491
- Then:
499
+ [Ruby 2.3+][ruby], [Rubygems][rubygems], and [Bundler][bundler]. Then:
492
500
 
493
501
  ```bash
494
- $ bundle update
495
- $ bundle exec rake
502
+ bundle update
503
+ bundle exec rake
496
504
  ```
497
505
 
498
- The build has to be clean. If it's not, [submit an issue](https://github.com/zold-io/zold/issues).
506
+ The build has to be clean. If it's not, [submit an issue][issues].
499
507
 
500
508
  Then, make your changes, make sure the build is still clean,
501
- and [submit a pull request](https://www.yegor256.com/2014/04/15/github-guidelines.html).
509
+ and [submit a pull request][pr-guide].
502
510
 
503
511
  If some test fails and you need to run it individually,
504
512
  check the logging configuration inside `test__helper.rb` and make
505
513
  sure the `Verbose` log is assigned to `$log`. Then, run, for example:
506
514
 
507
515
  ```bash
508
- $ ruby test/commands/test_node.rb
516
+ ruby test/commands/test_node.rb
509
517
  ```
510
518
 
511
519
  If you need to run a single test method, do this:
512
520
 
513
521
  ```bash
514
- $ ruby test/test_wallet.rb -n test_adds_transaction
515
- ```
522
+ ruby test/test_wallet.rb -n test_adds_transaction
523
+ ```
524
+
525
+ [video]: https://youtu.be/5A9uBwMow0M
526
+ [blog]: https://blog.zold.io/2018/07/08/mission.html
527
+ [green-paper]: https://papers.zold.io/green-paper.pdf
528
+ [white-paper]: https://papers.zold.io/wp.pdf
529
+ [bitcointalk]: https://bitcointalk.org/index.php?topic=5095078
530
+ [telegram]: https://t.me/zold_io
531
+ [wts]: https://wts.zold.io
532
+ [ruby]: https://www.ruby-lang.org/en/documentation/installation/
533
+ [rubygems]: https://rubygems.org/pages/download
534
+ [zold-gem]: https://rubygems.org/gems/zold
535
+ [install]: https://github.com/zold-io/zold/blob/master/INSTALL.md
536
+ [IP firewall]: https://www.howtogeek.com/177621/the-beginners-guide-to-iptables-the-linux-firewall/
537
+ [docker]: https://hub.docker.com/r/yegor256/zold
538
+ [dockerfile]: https://github.com/zold-io/zold/blob/master/Dockerfile
539
+ [node-blog]: https://blog.zold.io/2019/01/10/how-to-run-node.html
540
+ [freebsd-disk]: https://www.freebsd.org/doc/handbook/disks-virtual.html
541
+ [gemfile]: https://bundler.io/gemfile.html
542
+ [issues]: https://github.com/zold-io/zold/issues
543
+ [bundler]: https://bundler.io/
544
+ [pr-guide]: https://www.yegor256.com/2014/04/15/github-guidelines.html
data/REUSE.toml ADDED
@@ -0,0 +1,40 @@
1
+ # SPDX-FileCopyrightText: Copyright (c) 2025 Yegor Bugayenko
2
+ # SPDX-License-Identifier: MIT
3
+
4
+ version = 1
5
+ [[annotations]]
6
+ path = [
7
+ ".ruby-version",
8
+ "**/*.zc",
9
+ "fixtures/**",
10
+ "Guardfile",
11
+ "resources/**",
12
+ ".DS_Store",
13
+ ".gitattributes",
14
+ ".gitignore",
15
+ ".pdd",
16
+ "**.csv",
17
+ "**.json",
18
+ "**.md",
19
+ "**.txt",
20
+ "**/.DS_Store",
21
+ "**/.gitignore",
22
+ "**/.pdd",
23
+ "**/*.csv",
24
+ "**/*.jpg",
25
+ "**/*.json",
26
+ "**/*.md",
27
+ "**/*.pdf",
28
+ "**/*.png",
29
+ "**/*.svg",
30
+ "**/*.txt",
31
+ "**/*.vm",
32
+ "**/CNAME",
33
+ "**/Gemfile.lock",
34
+ "Gemfile.lock",
35
+ "README.md",
36
+ "renovate.json",
37
+ ]
38
+ precedence = "override"
39
+ SPDX-FileCopyrightText = "Copyright (c) 2025 Yegor Bugayenko"
40
+ SPDX-License-Identifier = "MIT"