zold 0.23.9 → 0.23.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/INSTALL.md +8 -2
- data/lib/zold/commands/remote.rb +10 -10
- data/lib/zold/remotes.rb +0 -2
- data/lib/zold/version.rb +1 -1
- data/test/commands/test_remote.rb +2 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f5719b8dfeb390eb155df8e38deaa12243ae7223f31c51a86dbc1a56abd1174d
|
4
|
+
data.tar.gz: 2c83351b136b14629b2640897d1eecf8bc7a7d3907e1b7b21b3c8ddaa4d9c44d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 85ede5d5163fb9dcb2f14796258ab4efcfd3f1017f1c82f226c695ca66ae74ea6bb9b13aa7f91ef85c05ec225579a3345ead7d2876a6120424e04efe46bb3f31
|
7
|
+
data.tar.gz: e2b44d53856b92af6503e1c505e044aa76329137bd016b1be2eaabfdbeb2ae514e8dc0bdbf0e4d1e70f75899bd50d73666f7c564ff5d5d61b189418034d75a1a
|
data/INSTALL.md
CHANGED
@@ -63,9 +63,15 @@ Without homebrew:
|
|
63
63
|
## Windows
|
64
64
|
|
65
65
|
Download and install [RubyInstaller (with Devkit)](https://rubyinstaller.org/downloads/).
|
66
|
-
If Windows Defender (or antivirus software) throws an error, ignore it and allow the file.
|
66
|
+
If Windows Defender (or antivirus software) throws an error, ignore it and allow the file.
|
67
|
+
This file is known to trigger [false positives](https://groups.google.com/forum/#!topic/rubyinstaller/LCR-CbBoGOI).
|
67
68
|
Download and install [RubyGems](https://rubygems.org/pages/download). Manual install `ruby setup.rb` works.
|
68
|
-
|
69
|
+
|
70
|
+
Install [Zold gem](https://rubygems.org/gems/zold):
|
71
|
+
|
72
|
+
```
|
73
|
+
gem install zold
|
74
|
+
```
|
69
75
|
|
70
76
|
## CentOS 7.5
|
71
77
|
|
data/lib/zold/commands/remote.rb
CHANGED
@@ -74,7 +74,7 @@ Available commands:
|
|
74
74
|
#{Rainbow('remote trim').green}
|
75
75
|
Remove the least reliable nodes
|
76
76
|
#{Rainbow('remote select [options]').green}
|
77
|
-
Select the
|
77
|
+
Select the most reliable N nodes.
|
78
78
|
#{Rainbow('remote update').green}
|
79
79
|
Check each registered remote node for availability
|
80
80
|
Available options:"
|
@@ -211,16 +211,16 @@ Available options:"
|
|
211
211
|
end
|
212
212
|
return unless ping(host, port, opts)
|
213
213
|
if @remotes.exists?(host, port)
|
214
|
-
@log.
|
214
|
+
@log.debug("#{host}:#{port} already exists among #{@remotes.all.count} others")
|
215
215
|
else
|
216
216
|
@remotes.add(host, port)
|
217
|
-
@log.
|
217
|
+
@log.debug("#{host}:#{port} added to the list, #{@remotes.all.count} total")
|
218
218
|
end
|
219
219
|
end
|
220
220
|
|
221
221
|
def remove(host, port, _)
|
222
222
|
@remotes.remove(host, port)
|
223
|
-
@log.
|
223
|
+
@log.debug("#{host}:#{port} removed from the list, #{@remotes.all.count} total")
|
224
224
|
end
|
225
225
|
|
226
226
|
# Returns an array of Zold::Score
|
@@ -256,9 +256,9 @@ Available options:"
|
|
256
256
|
all.each do |r|
|
257
257
|
next if r[:errors] <= opts['tolerate']
|
258
258
|
@remotes.remove(r[:host], r[:port]) if !opts['masters-too'] || !r[:master]
|
259
|
-
@log.
|
259
|
+
@log.debug("#{r[:host]}:#{r[:port]} removed because of #{r[:errors]} errors (over #{opts['tolerate']})")
|
260
260
|
end
|
261
|
-
@log.info("The list of #{all.count} remotes trimmed
|
261
|
+
@log.info("The list of #{all.count} remotes trimmed down to #{@remotes.all.count} nodes")
|
262
262
|
end
|
263
263
|
|
264
264
|
def update(opts)
|
@@ -284,7 +284,7 @@ Available options:"
|
|
284
284
|
add(s['host'], s['port'], opts)
|
285
285
|
end
|
286
286
|
capacity << { host: score.host, port: score.port, count: json['all'].count }
|
287
|
-
@log.
|
287
|
+
@log.debug("#{r}: the score is #{Rainbow(score.value).green} (#{json['version']}) in #{Age.new(start)}")
|
288
288
|
end
|
289
289
|
end
|
290
290
|
end
|
@@ -345,13 +345,13 @@ it's recommended to reboot, but I don't do it because of --never-reboot")
|
|
345
345
|
end
|
346
346
|
|
347
347
|
def select(opts)
|
348
|
-
@remotes.all.sort_by { |r| r[:
|
348
|
+
@remotes.all.sort_by { |r| r[:errors] }.reverse.each_with_index do |r, idx|
|
349
349
|
next if idx < opts['max-nodes']
|
350
350
|
next if r[:master] && !opts['masters-too']
|
351
351
|
@remotes.remove(r[:host], r[:port])
|
352
|
-
@log.
|
352
|
+
@log.debug("Remote #{r[:host]}:#{r[:port]}/#{r[:score]}/#{r[:errors]}e removed from the list")
|
353
353
|
end
|
354
|
-
@log.info("#{@remotes.all.count} remote nodes
|
354
|
+
@log.info("#{@remotes.all.count} remote nodes were selected to stay in the list")
|
355
355
|
end
|
356
356
|
|
357
357
|
def terminate
|
data/lib/zold/remotes.rb
CHANGED
@@ -189,7 +189,6 @@ module Zold
|
|
189
189
|
modify do |list|
|
190
190
|
list.reject { |r| r[:host] == host.downcase && r[:port] == port }
|
191
191
|
end
|
192
|
-
unerror(host, port)
|
193
192
|
end
|
194
193
|
|
195
194
|
# Go through the list of remotes and call a provided block for each
|
@@ -230,7 +229,6 @@ module Zold
|
|
230
229
|
|
231
230
|
def unerror(host, port = PORT)
|
232
231
|
assert_host_info(host, port)
|
233
|
-
|
234
232
|
if_present(host, port) do |remote|
|
235
233
|
remote[:errors] -= 1 if (remote[:errors]).positive?
|
236
234
|
end
|
data/lib/zold/version.rb
CHANGED
@@ -183,11 +183,12 @@ class TestRemote < Zold::Test
|
|
183
183
|
(1..11).each do |i|
|
184
184
|
cmd.run(%W[remote add localhost #{i} --skip-ping])
|
185
185
|
remotes.rescore('localhost', i, i)
|
186
|
+
i.times { remotes.error('localhost', i) }
|
186
187
|
end
|
187
188
|
cmd.run(%w[remote select --max-nodes=5])
|
188
189
|
assert_equal(5, remotes.all.count)
|
189
190
|
scores = remotes.all.map { |r| r[:score] }
|
190
|
-
assert_equal([
|
191
|
+
assert_equal([7, 8, 9, 10, 11], scores.sort)
|
191
192
|
end
|
192
193
|
end
|
193
194
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zold
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.23.
|
4
|
+
version: 0.23.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yegor Bugayenko
|
@@ -753,7 +753,7 @@ licenses:
|
|
753
753
|
- MIT
|
754
754
|
metadata: {}
|
755
755
|
post_install_message: |-
|
756
|
-
Thanks for installing Zold 0.23.
|
756
|
+
Thanks for installing Zold 0.23.10!
|
757
757
|
Study our White Paper: https://papers.zold.io/wp.pdf
|
758
758
|
Read our blog posts: https://blog.zold.io
|
759
759
|
Try ZLD online wallet at: https://wts.zold.io
|