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.
- checksums.yaml +4 -4
- data/.0pdd.yml +2 -19
- data/.github/typos.toml +11 -0
- data/.github/workflows/actionlint.yml +5 -21
- data/.github/workflows/bashate.yml +25 -0
- data/.github/workflows/codecov.yml +11 -24
- data/.github/workflows/copyrights.yml +6 -21
- data/.github/workflows/hadolint.yml +14 -0
- data/.github/workflows/markdown-lint.yml +19 -0
- data/.github/workflows/pdd.yml +5 -20
- data/.github/workflows/rake.yml +8 -22
- data/.github/workflows/reuse.yml +19 -0
- data/.github/workflows/shellcheck.yml +19 -0
- data/.github/workflows/typos.yml +21 -0
- data/.github/workflows/xcop.yml +5 -20
- data/.github/workflows/yamllint.yml +5 -20
- data/.gitignore +9 -6
- data/.rubocop.yml +16 -20
- data/.ruby-version +1 -1
- data/.rultor.yml +6 -22
- data/Dockerfile +11 -27
- data/Gemfile +21 -33
- data/Gemfile.lock +185 -130
- data/Guardfile +0 -0
- data/INSTALL.md +80 -59
- data/LICENSE.txt +1 -1
- data/LICENSES/MIT.txt +21 -0
- data/README.md +183 -154
- data/REUSE.toml +40 -0
- data/Rakefile +4 -38
- data/bin/zold +7 -37
- data/cucumber.yml +2 -19
- data/deploy.sh +4 -22
- data/features/cli.feature +2 -0
- data/features/gem_package.feature +2 -0
- data/features/step_definitions/steps.rb +2 -19
- data/features/support/env.rb +2 -19
- data/fixtures/merge/asserts.rb +3 -19
- data/fixtures/merge/into_no_wallet/assert.rb +2 -19
- data/fixtures/merge/legacy_negatives_stay/assert.rb +2 -19
- data/fixtures/merge/legacy_negatives_stay/copies/0123456789abcdef/scores.zc +1 -1
- data/fixtures/merge/missed_wallets/0123456789abcdef.z +0 -2
- data/fixtures/merge/missed_wallets/assert.rb +2 -19
- data/fixtures/merge/missed_wallets/copies/0123456789abcdef/scores.zc +1 -1
- data/fixtures/merge/negative_overwriting/assert.rb +2 -19
- data/fixtures/merge/negatives_in_between/0123456789abcdef.z +0 -1
- data/fixtures/merge/negatives_in_between/assert.rb +2 -19
- data/fixtures/merge/negatives_in_between/copies/0123456789abcdef/2.zc +0 -1
- data/fixtures/merge/negatives_in_between/opts +1 -1
- data/fixtures/merge/random_expenses/assert.rb +2 -19
- data/fixtures/merge/random_expenses/opts +1 -1
- data/fixtures/merge/simple_case/assert.rb +2 -19
- data/fixtures/merge/simple_case/opts +1 -1
- data/fixtures/merge/unconfirmed_income/assert.rb +2 -19
- data/fixtures/scripts/_head.sh +16 -33
- data/fixtures/scripts/calculate-scores.sh +3 -20
- data/fixtures/scripts/distribute-wallet.sh +26 -43
- data/fixtures/scripts/print-helps.sh +5 -23
- data/fixtures/scripts/pull-on-start.sh +12 -29
- data/fixtures/scripts/push-and-pull.sh +10 -27
- data/fixtures/scripts/redeploy-on-upgrade.sh +18 -34
- data/fixtures/scripts/spread-wallets.sh +24 -40
- data/lib/zold/age.rb +3 -20
- data/lib/zold/amount.rb +3 -20
- data/lib/zold/cached_wallets.rb +3 -20
- data/lib/zold/commands/alias.rb +4 -21
- data/lib/zold/commands/args.rb +4 -21
- data/lib/zold/commands/calculate.rb +5 -22
- data/lib/zold/commands/clean.rb +6 -23
- data/lib/zold/commands/create.rb +5 -22
- data/lib/zold/commands/diff.rb +5 -22
- data/lib/zold/commands/fetch.rb +6 -23
- data/lib/zold/commands/invoice.rb +5 -22
- data/lib/zold/commands/list.rb +5 -22
- data/lib/zold/commands/merge.rb +7 -24
- data/lib/zold/commands/next.rb +5 -22
- data/lib/zold/commands/node.rb +4 -21
- data/lib/zold/commands/pay.rb +6 -23
- data/lib/zold/commands/propagate.rb +5 -22
- data/lib/zold/commands/pull.rb +5 -22
- data/lib/zold/commands/push.rb +5 -22
- data/lib/zold/commands/remote.rb +7 -24
- data/lib/zold/commands/remove.rb +5 -22
- data/lib/zold/commands/routines/audit.rb +4 -21
- data/lib/zold/commands/routines/gc.rb +6 -23
- data/lib/zold/commands/routines/reconcile.rb +5 -22
- data/lib/zold/commands/routines/reconnect.rb +4 -21
- data/lib/zold/commands/routines/retire.rb +4 -21
- data/lib/zold/commands/routines/spread.rb +5 -22
- data/lib/zold/commands/routines.rb +3 -20
- data/lib/zold/commands/show.rb +5 -22
- data/lib/zold/commands/taxes.rb +5 -22
- data/lib/zold/commands/thread_badge.rb +3 -20
- data/lib/zold/copies.rb +6 -25
- data/lib/zold/dir_items.rb +3 -20
- data/lib/zold/endless.rb +5 -22
- data/lib/zold/gem.rb +3 -20
- data/lib/zold/hands.rb +6 -23
- data/lib/zold/head.rb +4 -21
- data/lib/zold/hexnum.rb +3 -20
- data/lib/zold/http.rb +3 -20
- data/lib/zold/hungry_wallets.rb +6 -23
- data/lib/zold/id.rb +3 -20
- data/lib/zold/json_page.rb +5 -22
- data/lib/zold/key.rb +3 -20
- data/lib/zold/metronome.rb +5 -22
- data/lib/zold/node/async_entrance.rb +6 -23
- data/lib/zold/node/entrance.rb +7 -24
- data/lib/zold/node/farm.rb +5 -22
- data/lib/zold/node/farmers.rb +15 -32
- data/lib/zold/node/front.rb +6 -23
- data/lib/zold/node/journaled_pipeline.rb +8 -25
- data/lib/zold/node/nodup_entrance.rb +6 -23
- data/lib/zold/node/nospam_entrance.rb +6 -23
- data/lib/zold/node/pipeline.rb +6 -23
- data/lib/zold/node/safe_entrance.rb +4 -22
- data/lib/zold/node/soft_error.rb +3 -20
- data/lib/zold/node/spread_entrance.rb +5 -22
- data/lib/zold/node/sync_entrance.rb +5 -22
- data/lib/zold/node/trace.rb +3 -20
- data/lib/zold/patch.rb +6 -23
- data/lib/zold/prefixes.rb +3 -20
- data/lib/zold/remotes.rb +5 -22
- data/lib/zold/signature.rb +3 -20
- data/lib/zold/size.rb +3 -20
- data/lib/zold/sync_wallets.rb +5 -22
- data/lib/zold/tax.rb +4 -21
- data/lib/zold/thread_pool.rb +4 -21
- data/lib/zold/tree_wallets.rb +3 -20
- data/lib/zold/txn.rb +4 -21
- data/lib/zold/txns.rb +4 -21
- data/lib/zold/upgrades.rb +4 -21
- data/lib/zold/verbose_thread.rb +5 -22
- data/lib/zold/version.rb +4 -21
- data/lib/zold/version_file.rb +4 -21
- data/lib/zold/wallet.rb +6 -23
- data/lib/zold/wallets.rb +5 -23
- data/lib/zold.rb +3 -21
- data/resources/banned-wallets.log +6 -6
- data/test/commands/routines/test_audit.rb +3 -21
- data/test/commands/routines/test_gc.rb +3 -21
- data/test/commands/routines/test_reconcile.rb +3 -21
- data/test/commands/routines/test_reconnect.rb +3 -21
- data/test/commands/routines/test_retire.rb +3 -21
- data/test/commands/test_alias.rb +2 -20
- data/test/commands/test_calculate.rb +5 -23
- data/test/commands/test_clean.rb +5 -23
- data/test/commands/test_create.rb +6 -24
- data/test/commands/test_diff.rb +4 -22
- data/test/commands/test_fetch.rb +3 -21
- data/test/commands/test_invoice.rb +3 -21
- data/test/commands/test_list.rb +3 -21
- data/test/commands/test_merge.rb +12 -35
- data/test/commands/test_node.rb +3 -21
- data/test/commands/test_pay.rb +5 -23
- data/test/commands/test_propagate.rb +6 -24
- data/test/commands/test_pull.rb +4 -22
- data/test/commands/test_push.rb +3 -21
- data/test/commands/test_remote.rb +10 -28
- data/test/commands/test_remove.rb +7 -25
- data/test/commands/test_show.rb +3 -21
- data/test/commands/test_taxes.rb +5 -23
- data/test/fake_home.rb +5 -22
- data/test/node/fake_entrance.rb +3 -20
- data/test/node/fake_node.rb +5 -22
- data/test/node/test_async_entrance.rb +3 -21
- data/test/node/test_entrance.rb +7 -25
- data/test/node/test_farm.rb +15 -33
- data/test/node/test_farmers.rb +3 -21
- data/test/node/test_front.rb +22 -42
- data/test/node/test_nodup_entrance.rb +4 -22
- data/test/node/test_nospam_entrance.rb +6 -24
- data/test/node/test_safe_entrance.rb +3 -21
- data/test/node/test_spread_entrance.rb +4 -22
- data/test/node/test_sync_entrance.rb +4 -22
- data/test/node/test_trace.rb +4 -22
- data/test/test__helper.rb +32 -31
- data/test/test_age.rb +5 -23
- data/test/test_amount.rb +15 -34
- data/test/test_cached_wallets.rb +3 -21
- data/test/test_copies.rb +10 -28
- data/test/test_dir_items.rb +4 -22
- data/test/test_gem.rb +3 -21
- data/test/test_hands.rb +3 -21
- data/test/test_hexnum.rb +3 -21
- data/test/test_http.rb +9 -27
- data/test/test_hungry_wallets.rb +6 -24
- data/test/test_id.rb +10 -28
- data/test/test_json_page.rb +3 -21
- data/test/test_key.rb +5 -23
- data/test/test_metronome.rb +6 -24
- data/test/test_patch.rb +10 -28
- data/test/test_prefixes.rb +3 -21
- data/test/test_remotes.rb +17 -35
- data/test/test_signature.rb +3 -21
- data/test/test_size.rb +3 -21
- data/test/test_sync_wallets.rb +3 -21
- data/test/test_tax.rb +6 -24
- data/test/test_thread_pool.rb +6 -24
- data/test/test_tree_wallets.rb +4 -22
- data/test/test_txn.rb +3 -21
- data/test/test_upgrades.rb +3 -21
- data/test/test_verbose_thread.rb +6 -24
- data/test/test_version.rb +2 -20
- data/test/test_wallet.rb +15 -33
- data/test/test_wallets.rb +4 -22
- data/test/test_zold.rb +7 -25
- data/test/upgrades/test_delete_banned_wallets.rb +4 -22
- data/test/upgrades/test_protocol_up.rb +3 -21
- data/upgrades/2.rb +3 -20
- data/upgrades/delete_banned_wallets.rb +3 -20
- data/upgrades/move_wallets_into_tree.rb +3 -20
- data/upgrades/protocol_up.rb +3 -20
- data/upgrades/rename_foreign_wallets.rb +3 -20
- data/views/journal.haml +25 -0
- data/views/layout.haml +25 -0
- data/views/wallet.haml +25 -0
- data/zold.gemspec +5 -21
- metadata +33 -15
- data/.simplecov +0 -36
- data/lib/zold/log.rb +0 -139
- data/test/test_log.rb +0 -49
data/README.md
CHANGED
|
@@ -1,63 +1,61 @@
|
|
|
1
|
-
|
|
1
|
+
# Non-Blockchain Cryptocurrency
|
|
2
2
|
|
|
3
3
|
[](https://www.elegantobjects.org)
|
|
4
|
-
[](https://www.rultor.com/p/yegor256/zold)
|
|
5
5
|
[](https://www.jetbrains.com/ruby/)
|
|
6
6
|
|
|
7
|
-
[](
|
|
7
|
+
[](https://www.0pdd.com/p?name=zold-io/zold)
|
|
8
|
+
[](https://badge.fury.io/rb/zold)
|
|
9
9
|
[](https://codecov.io/github/zold-io/zold?branch=master)
|
|
10
|
-
[](https://rubydoc.info/github/zold-io/zold/master/frames)
|
|
11
11
|
[](https://codeclimate.com/github/zold-io/zold/maintainability)
|
|
12
12
|
[](https://github.com/yegor256/takes/blob/master/LICENSE.txt)
|
|
13
13
|
[](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]
|
|
17
|
-
want to read [this blog]
|
|
18
|
-
Then, you have to read the [Green Paper]
|
|
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
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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
|
-
|
|
32
|
+
You can find more details in the [White Paper][white-paper].
|
|
33
33
|
|
|
34
|
-
You can also find us at the [Bitcointalk]
|
|
34
|
+
You can also find us at the [Bitcointalk][bitcointalk] forum.
|
|
35
35
|
|
|
36
|
-
Join our [Telegram group]
|
|
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
|
|
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+]
|
|
45
|
-
[
|
|
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
|
-
|
|
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
|
|
55
|
+
(just hit `Enter` when it asks you for a password):
|
|
58
56
|
|
|
59
57
|
```bash
|
|
60
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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
|
|
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
|
|
115
|
+
Next, hit `Ctrl`+`c` and run it again, but with `--nohup`:
|
|
119
116
|
|
|
120
117
|
```bash
|
|
121
|
-
|
|
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
|
-
|
|
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
|
-
|
|
138
|
+
zold node --help
|
|
142
139
|
```
|
|
143
140
|
|
|
144
|
-
You can run a node in a
|
|
145
|
-
built from this [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
|
|
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
|
|
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
|
|
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]
|
|
168
|
-
with
|
|
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
|
-
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
242
|
+
they can trust your node with the information it provides about wallets.
|
|
239
243
|
The higher the score, the better.
|
|
240
244
|
|
|
241
|
-
|
|
242
|
-
|
|
245
|
+
* `value` is the number of suffixes the score contains; this is the
|
|
246
|
+
number all other nodes rely on.
|
|
243
247
|
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
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
|
-
|
|
249
|
-
|
|
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
|
-
|
|
252
|
-
|
|
253
|
-
|
|
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
|
-
|
|
256
|
-
|
|
259
|
+
* `time` is the ISO-8601 UTC date and time of when your node
|
|
260
|
+
started to calculate the score.
|
|
257
261
|
|
|
258
|
-
|
|
262
|
+
* `strength` is the number of trailing zeros the hash contains.
|
|
259
263
|
|
|
260
|
-
|
|
264
|
+
* `hash` is the SHA-256 hash of the score text.
|
|
261
265
|
|
|
262
|
-
|
|
263
|
-
|
|
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
|
|
271
|
+
`cpus` is the number of CPUs detected on the server.
|
|
268
272
|
|
|
269
|
-
`threads` is the
|
|
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
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
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
|
-
|
|
294
|
+
* `pipeline` is ... something not important to you.
|
|
291
295
|
|
|
292
|
-
|
|
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
|
|
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
|
|
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
|
-
|
|
316
|
+
* `GET /`: returns the JSON explained above
|
|
312
317
|
|
|
313
|
-
|
|
318
|
+
* `GET /score`: returns the text presentation of the current Score
|
|
314
319
|
|
|
315
|
-
|
|
320
|
+
* `GET /version`: returns the version of the software
|
|
316
321
|
|
|
317
|
-
|
|
322
|
+
* `GET /protocol`: returns the protocol ID
|
|
318
323
|
|
|
319
|
-
|
|
324
|
+
* `GET /wallet/ID`: returns the JSON with wallet details
|
|
320
325
|
|
|
321
|
-
|
|
326
|
+
* `GET /wallet/ID/balance`: returns wallet balance in zents (text/plain)
|
|
322
327
|
|
|
323
|
-
|
|
328
|
+
* `GET /wallet/ID/key`: returns wallet public RSA key
|
|
324
329
|
|
|
325
|
-
|
|
330
|
+
* `GET /wallet/ID/mtime`: returns ISO-8601 time of wallet file modification
|
|
326
331
|
|
|
327
|
-
|
|
332
|
+
* `GET /wallet/ID/size`: returns the size of the wallet file in bytes
|
|
328
333
|
|
|
329
|
-
|
|
334
|
+
* `GET /wallet/ID/age`: returns the age of the wallet, in seconds
|
|
330
335
|
|
|
331
|
-
|
|
336
|
+
* `GET /wallet/ID/txns`: returns the number of transactions in the wallet
|
|
332
337
|
|
|
333
|
-
|
|
338
|
+
* `GET /wallet/ID/debt`: returns the tax debt of the wallet in zents
|
|
334
339
|
|
|
335
|
-
|
|
340
|
+
* `GET /wallet/ID/digest`: returns SHA-256 digest of the wallet file
|
|
336
341
|
|
|
337
|
-
|
|
342
|
+
* `GET /wallet/ID/mnemo`: returns the mnemo short string of the wallet
|
|
338
343
|
|
|
339
|
-
|
|
344
|
+
* `GET /wallet/ID/txns.json`: returns the full list of transactions
|
|
345
|
+
in the wallet as a JSON document
|
|
340
346
|
|
|
341
|
-
|
|
347
|
+
* `GET /wallet/ID.txt`: returns the text presentation of the wallet
|
|
342
348
|
|
|
343
|
-
|
|
349
|
+
* `GET /wallet/ID.html`: returns the HTML presentation of the wallet
|
|
344
350
|
|
|
345
|
-
|
|
351
|
+
* `GET /wallet/ID.bin`: returns the entire wallet file
|
|
346
352
|
|
|
347
|
-
|
|
353
|
+
* `GET /wallet/ID/copies`: returns the list of copies of the wallet
|
|
348
354
|
|
|
349
|
-
|
|
355
|
+
* `GET /wallet/ID/copy/NAME`: returns the entire content of a single copy
|
|
356
|
+
of the wallet
|
|
350
357
|
|
|
351
|
-
|
|
352
|
-
|
|
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
|
-
|
|
355
|
-
|
|
361
|
+
* `GET /wallets`: returns the list of all wallets maintained by the node,
|
|
362
|
+
in plain text, separated by EOL
|
|
356
363
|
|
|
357
|
-
|
|
364
|
+
* `GET /remotes`: returns the list of remote nodes in JSON
|
|
358
365
|
|
|
359
|
-
|
|
366
|
+
* `GET /ledger`: returns the list of recently visible transactions
|
|
360
367
|
|
|
361
|
-
|
|
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
|
|
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
|
-
|
|
373
|
+
* `GET /pid`: returns the process ID of the software
|
|
367
374
|
|
|
368
|
-
|
|
375
|
+
* `GET /trace`: returns the entire log of the node
|
|
369
376
|
|
|
370
|
-
|
|
377
|
+
* `GET /farm`: returns the statistics of the Farm
|
|
371
378
|
|
|
372
|
-
|
|
379
|
+
* `GET /metronome`: returns the statistics of the Metronome
|
|
373
380
|
|
|
374
|
-
|
|
381
|
+
* `GET /threads`: returns the statistics of all Ruby threads
|
|
375
382
|
|
|
376
|
-
|
|
383
|
+
* `GET /ps`: returns the statistics of all currently running Unix processes
|
|
377
384
|
|
|
378
|
-
|
|
385
|
+
* `GET /queue`: returns the statistics of the node queue
|
|
379
386
|
|
|
380
|
-
|
|
387
|
+
* `GET /journal`: returns the journal, in HTML
|
|
381
388
|
|
|
382
|
-
|
|
389
|
+
* `GET /journal/item?id=ID`: returns the content of a single journal entry
|
|
383
390
|
|
|
384
|
-
There
|
|
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]
|
|
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
|
-
|
|
399
|
+
gem install zold
|
|
394
400
|
```
|
|
395
401
|
|
|
396
|
-
Then, you will need a directory where wallets and other supplementary data
|
|
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(
|
|
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
|
|
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.
|
|
463
|
-
|
|
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
|
-
|
|
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(
|
|
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
|
|
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+]
|
|
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
|
-
|
|
495
|
-
|
|
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]
|
|
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]
|
|
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
|
-
|
|
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
|
-
|
|
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"
|