zold 0.16.26 → 0.16.27

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4e27027c73393b86b4d34b683fdccef9504e49ef78e885fe9b5426b5f2155c83
4
- data.tar.gz: cb7e4b37ab24560b199fc5dbaab99bba37de254b40b24823135b05539e78063e
3
+ metadata.gz: 6099001404773f73201ba9d4120098b1e096a14132874aaee47ffea89d0bb4d4
4
+ data.tar.gz: 004e0c2475ba063f08f8a685e6f9b592769a593fb4b17d765e9316f487481506
5
5
  SHA512:
6
- metadata.gz: b4432ecaaec9ab8e7367d494bd775fb021fda95ca0dd91d5fc705240adce5822bd033a26e9c589f92d6bef5bf34140f3619583f91fe44260deee3e415d8594a3
7
- data.tar.gz: 9916d9050bef1e51c6fb07d125d49bc8c54b9a03509c6f82252fc5b5cdfea1c49196d4276fc822ca6641fce5541eadfd6286f86f54948a2fc9737b3d4e4ddb4d
6
+ metadata.gz: cc98c08e0f2c2c6c3e5f0a94b434d05a5a0301c213fb2ad45401e1f4b733fe3e7f0806ac060e2f414a937a935effaaad5f39c8a7d07c26b2fc2251c42d16d536
7
+ data.tar.gz: 486ba67e95ad7c4d2f92a9e1dd8d8fe854f701a39737b3664de943482370bba1859052fcd09372e2905e484b3f5a857e55abde9e8d89b8bea0114fda28bf6e57
data/INSTALL.md CHANGED
@@ -20,7 +20,7 @@ It is recommended to have at least 2 CPUs and 2 Gb RAM.
20
20
 
21
21
  ```bash
22
22
  $ sudo apt update -y
23
- $ sudo apt install -y ruby-dev rubygems zlib1g-dev libssl-dev make build-essential
23
+ $ sudo apt install -y ruby-dev rubygems zlib1g-dev libssl-dev make build-essential libcurl4-openssl-dev
24
24
  $ gem install --no-ri --no-rdoc zold
25
25
  ```
26
26
 
@@ -28,7 +28,7 @@ $ gem install --no-ri --no-rdoc zold
28
28
 
29
29
  ```bash
30
30
  $ sudo apt-get update -y
31
- $ sudo apt-get install -y ruby-dev rubygems zlib1g-dev libssl-dev build-essential
31
+ $ sudo apt-get install -y ruby-dev rubygems zlib1g-dev libssl-dev build-essential libcurl4-openssl-dev
32
32
  $ gem install --no-ri --no-rdoc zold
33
33
  ```
34
34
 
@@ -60,7 +60,7 @@ Install [Zold gem](https://rubygems.org/gems/zold) `gem install --no-ri --no-rdo
60
60
  As a `root` user:
61
61
 
62
62
  ```bash
63
- $ sudo yum install zlib-devel gcc gcc-c++ ruby-devel rubygems ruby
63
+ $ sudo yum install zlib-devel gcc gcc-c++ ruby-devel rubygems ruby curl-devel
64
64
  $ gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
65
65
  $ curl -sSL https://get.rvm.io | bash -s stable
66
66
  $ source /etc/profile.d/rvm.sh
@@ -71,7 +71,7 @@ $ gem install --no-ri --no-rdoc zold
71
71
  ## Amazon Linux (AWS EC2 default image)
72
72
 
73
73
  ```
74
- $ sudo yum install zlib-devel gcc gcc-c++ ruby-devel rubygems ruby
74
+ $ sudo yum install zlib-devel gcc gcc-c++ ruby-devel rubygems ruby libcurl4-openssl-dev
75
75
  $ gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
76
76
  $ curl -sSL https://get.rvm.io | bash -s stable
77
77
  $ source $HOME/.rvm/scripts/rvm
@@ -274,14 +274,26 @@ in #{Age.new(@start, limit: 1)}")
274
274
  fetch { |w| w.age.to_s }
275
275
  end
276
276
 
277
- get %r{/wallet/(?<id>[A-Fa-f0-9]{16})/mnemo} do
278
- fetch(&:mnemo)
277
+ get %r{/wallet/(?<id>[A-Fa-f0-9]{16})/age} do
278
+ fetch { |w| w.age.to_s }
279
+ end
280
+
281
+ get %r{/wallet/(?<id>[A-Fa-f0-9]{16})/txns} do
282
+ fetch { |w| w.txns.count.to_s }
283
+ end
284
+
285
+ get %r{/wallet/(?<id>[A-Fa-f0-9]{16})/debt} do
286
+ fetch { |w| Tax.new(w).debt.to_i.to_s }
279
287
  end
280
288
 
281
289
  get %r{/wallet/(?<id>[A-Fa-f0-9]{16})/digest} do
282
290
  fetch(&:digest)
283
291
  end
284
292
 
293
+ get %r{/wallet/(?<id>[A-Fa-f0-9]{16})/mnemo} do
294
+ fetch(&:mnemo)
295
+ end
296
+
285
297
  get %r{/wallet/(?<id>[A-Fa-f0-9]{16})\.txt} do
286
298
  fetch do |wallet|
287
299
  [
@@ -443,10 +455,7 @@ in #{Age.new(@start, limit: 1)}")
443
455
  end
444
456
 
445
457
  def pretty(json)
446
- json.to_json
447
- # There seems to be some issue with memory leakage at this line, that's
448
- # why it's disabled for now:
449
- # JSON.pretty_generate(json)
458
+ JSON.pretty_generate(json)
450
459
  end
451
460
 
452
461
  def score
@@ -460,15 +469,9 @@ in #{Age.new(@start, limit: 1)}")
460
469
  def fetch(type = 'text/plain')
461
470
  error(404, 'FETCH is disabled with --disable-fetch') if settings.opts['disable-fetch']
462
471
  id = Id.new(params[:id])
463
- copy_of(id) do |wallet|
464
- content_type(type)
465
- yield wallet
466
- end
467
- end
468
-
469
- def copy_of(id)
470
472
  settings.wallets.acq(id) do |wallet|
471
473
  error(404, "Wallet ##{id} doesn't exist on the node") unless wallet.exists?
474
+ content_type(type)
472
475
  yield wallet
473
476
  end
474
477
  end
@@ -51,7 +51,7 @@ module Zold
51
51
  def acq(id, exclusive: false)
52
52
  raise 'The flag can\'t be nil' if exclusive.nil?
53
53
  @wallets.acq(id) do |wallet|
54
- Futex.new(wallet.path, log: @log).open do
54
+ Futex.new(wallet.path, log: @log).open(exclusive) do
55
55
  yield wallet
56
56
  end
57
57
  end
data/lib/zold/version.rb CHANGED
@@ -25,6 +25,6 @@
25
25
  # Copyright:: Copyright (c) 2018 Yegor Bugayenko
26
26
  # License:: MIT
27
27
  module Zold
28
- VERSION = '0.16.26'
28
+ VERSION = '0.16.27'
29
29
  PROTOCOL = 2
30
30
  end
@@ -159,6 +159,8 @@ class FrontTest < Zold::Test
159
159
  "/wallet/#{wallet.id}/size",
160
160
  "/wallet/#{wallet.id}/age",
161
161
  "/wallet/#{wallet.id}/mnemo",
162
+ "/wallet/#{wallet.id}/debt",
163
+ "/wallet/#{wallet.id}/txns",
162
164
  "/wallet/#{wallet.id}.bin",
163
165
  "/wallet/#{wallet.id}/copies"
164
166
  ].each do |u|
@@ -256,15 +258,9 @@ class FrontTest < Zold::Test
256
258
 
257
259
  def test_gzip
258
260
  FakeNode.new(log: test_log).run(['--ignore-score-weakness']) do |port|
259
- response = Zold::Http.new(uri: URI("http://localhost:#{port}/")).get
260
- assert_equal(
261
- 200, response.status,
262
- "Expected HTTP 200 OK: Found #{response.status}"
263
- )
264
- assert_operator(
265
- 750, :>, response.body.length.to_i,
266
- 'Expected the content to be smaller than 600 bytes for gzip'
267
- )
261
+ response = Zold::Http.new(uri: URI("http://localhost:#{port}/version")).get
262
+ assert_equal(200, response.status, response)
263
+ assert_operator(300, :>, response.body.length.to_i, 'Expected the content to be small')
268
264
  end
269
265
  end
270
266
 
data/zold.gemspec CHANGED
@@ -50,10 +50,11 @@ and suggests a different architecture for digital wallet maintenance.'
50
50
  s.email = 'yegor256@gmail.com'
51
51
  s.homepage = 'http://github.com/zold-io/zold'
52
52
  s.post_install_message = "Thanks for installing Zold #{Zold::VERSION}!
53
- Study our White Paper: https://papers.zold.io/wp.pdf
54
- Read our blog posts: https://blog.zold.io
55
- Stay in touch with the dev community: https://t.me/zold_io
56
- Follow us on Twitter: https://twitter.com/0crat"
53
+ Study our White Paper: https://papers.zold.io/wp.pdf
54
+ Read our blog posts: https://blog.zold.io
55
+ Try online wallet at: https://wts.zold.io
56
+ Stay in touch with the community: https://t.me/zold_io
57
+ Follow us on Twitter: https://twitter.com/0crat"
57
58
  s.files = `git ls-files`.split($RS)
58
59
  s.executables = s.files.grep(%r{^bin/}) { |f| File.basename(f) }
59
60
  s.test_files = s.files.grep(%r{^(test|features)/})
@@ -63,7 +64,7 @@ Follow us on Twitter: https://twitter.com/0crat"
63
64
  s.add_runtime_dependency 'concurrent-ruby', '1.1.2'
64
65
  s.add_runtime_dependency 'cucumber', '3.1.2' # has to stay here for Heroku
65
66
  s.add_runtime_dependency 'diffy', '3.2.1'
66
- s.add_runtime_dependency 'futex', '0.3.1'
67
+ s.add_runtime_dependency 'futex', '0.4.0'
67
68
  s.add_runtime_dependency 'get_process_mem', '0.2.3'
68
69
  s.add_runtime_dependency 'json', '2.1.0'
69
70
  s.add_runtime_dependency 'memory_profiler', '0.9.12'
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.16.26
4
+ version: 0.16.27
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko
@@ -72,14 +72,14 @@ dependencies:
72
72
  requirements:
73
73
  - - '='
74
74
  - !ruby/object:Gem::Version
75
- version: 0.3.1
75
+ version: 0.4.0
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - '='
81
81
  - !ruby/object:Gem::Version
82
- version: 0.3.1
82
+ version: 0.4.0
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: get_process_mem
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -695,11 +695,12 @@ licenses:
695
695
  - MIT
696
696
  metadata: {}
697
697
  post_install_message: |-
698
- Thanks for installing Zold 0.16.26!
699
- Study our White Paper: https://papers.zold.io/wp.pdf
700
- Read our blog posts: https://blog.zold.io
701
- Stay in touch with the dev community: https://t.me/zold_io
702
- Follow us on Twitter: https://twitter.com/0crat
698
+ Thanks for installing Zold 0.16.27!
699
+ Study our White Paper: https://papers.zold.io/wp.pdf
700
+ Read our blog posts: https://blog.zold.io
701
+ Try online wallet at: https://wts.zold.io
702
+ Stay in touch with the community: https://t.me/zold_io
703
+ Follow us on Twitter: https://twitter.com/0crat
703
704
  rdoc_options:
704
705
  - "--charset=UTF-8"
705
706
  require_paths: