zold 0.11.17 → 0.11.18

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
  SHA1:
3
- metadata.gz: c756ab9df322c31f1b31c030d2f6f56971d2ef36
4
- data.tar.gz: c03dc1d19510c459ed571a40e60d1e47d3ececd9
3
+ metadata.gz: 169a0ce80fa0bdabfba606230c2b12f918688457
4
+ data.tar.gz: 582eac190a1f5d87daf92195379c6c755d83dded
5
5
  SHA512:
6
- metadata.gz: a2f402cb7258a1f85966d2f9a46e15b4a12d44eccc1150259208221a98141553511b23fbec78d93a780af64a59fe94f3c58a36ab8862e442bd1b76313406eac7
7
- data.tar.gz: 682b3ad6c5bdec21e0eb95d94c7bac6dd04ad0776027cb96716bfef916bdbb4f4ec935e84f9832b26bc05fe684cb9b7968cd0c7ddfcd3203aabd1909a3061747
6
+ metadata.gz: f9313dd0f6b72d3745a3cf4768fd8617c4d098beb5eeb075b9873ac08ba118dfc0154d20daf00dd6d22a8050361e7ada151b1d2d46f645f53efca5d0b5866eee
7
+ data.tar.gz: cb64a87a705868388b46a8ca0c9636cb9cc4510b6f0750df388bc693bdb0f08c9145b09335f4cfd30932c2a76f6c88913cd514259e5c2373a774abcf373653a1
data/bin/zold-nohup CHANGED
@@ -27,9 +27,26 @@ require 'tempfile'
27
27
  require 'open3'
28
28
 
29
29
  $opts = Slop.parse(ARGV, strict: false, suppress_errors: true) do |o|
30
- o.string '--log-file', 'The file to save logs into', default: 'zold-node.log'
31
- o.bool '--skip-install', 'Don\'t re-install Zold gem', default: false
32
- o.bool '--sudo-install', 'Install Zold gem via sudo', default: false
30
+ o.banner = "Usage: zold-nohup [options] ...
31
+ Run 'zold --help' for the full list of options and commands"
32
+ o.bool '-h', '--help', 'Show these instructions'
33
+ o.string '--log-file',
34
+ 'The file to save logs into (default: ./zold-nohup.log)',
35
+ default: './zold-nohup.log'
36
+ o.bool '--skip-log-trim',
37
+ 'Don\'t trim the log file before start (default: false)',
38
+ default: false
39
+ o.bool '--skip-install',
40
+ 'Don\'t re-install Zold gem (default: false)',
41
+ default: false
42
+ o.bool '--sudo-install',
43
+ 'Install Zold gem via sudo (default: false)',
44
+ default: false
45
+ end
46
+
47
+ if $opts.help?
48
+ puts($opts.to_s)
49
+ exit(0)
33
50
  end
34
51
 
35
52
  def log(line)
@@ -51,6 +68,8 @@ def exec(cmd)
51
68
  end
52
69
  end
53
70
 
71
+ File.delete($opts['log-file']) if File.exist?($opts['log-file']) && !$opts['skip-log-trim']
72
+
54
73
  $pid = fork do
55
74
  Signal.trap('HUP') do
56
75
  print('Received HUP, ignoring...')
data/deploy.sh CHANGED
@@ -1,11 +1,14 @@
1
1
  #!/bin/bash
2
2
  set -e
3
+ set -x
3
4
 
4
5
  cd $(dirname $0)
5
6
  bundle update
6
- rake
7
- trap 'git reset HEAD~1 && git checkout -- .gitignore' EXIT
7
+ # rake
8
+ trap 'git reset HEAD~1 && rm bonus.key && git checkout -- .gitignore' EXIT
9
+ cp /code/home/assets/zold/bonus.key .
8
10
  sed -i -s 's|Gemfile.lock||g' .gitignore
11
+ git add bonus.key
9
12
  git add Gemfile.lock
10
13
  git add .gitignore
11
14
  git commit -m 'configs for heroku'
@@ -0,0 +1,8 @@
1
+ #!/bin/bash
2
+ set -x
3
+ set -e
4
+ shopt -s expand_aliases
5
+
6
+ alias zold="$1-nohup"
7
+
8
+ zold --help
data/heroku.yml CHANGED
@@ -1,9 +1,10 @@
1
1
  build:
2
2
  languages:
3
3
  - ruby
4
+ config:
5
+ LC_ALL: UTF-8
4
6
  run:
5
- web: |
6
- LC_ALL=UTF-8 ./bin/zold node --no-colors --verbose --trace \
7
- --bind-port=$PORT --port=80 --host=b1.zold.io --threads=0 \
8
- --invoice=JKFq17yipfjLtX@0000000000000000 --never-reboot \
9
- --bonus-wallet=81c9c25789b03876 --private-key=bonus.key --bonus-amount=1
7
+ web: "./bin/zold node --no-colors --verbose --trace
8
+ --bind-port=$PORT --port=80 --host=b1.zold.io --threads=0
9
+ --invoice=JKFq17yipfjLtX@0000000000000000 --never-reboot
10
+ --bonus-wallet=81c9c25789b03876 --private-key=bonus.key --bonus-amount=1"
@@ -146,7 +146,9 @@ module Zold
146
146
  require_relative 'remote'
147
147
  Remote.new(remotes: remotes, log: @log, farm: farm).run(%w[remote add b1.zold.io 80 --force])
148
148
  Remote.new(remotes: remotes, log: @log, farm: farm).run(%w[remote trim])
149
- Remote.new(remotes: remotes, log: @log, farm: farm).run(%w[remote update --reboot])
149
+ Remote.new(remotes: remotes, log: @log, farm: farm).run(
150
+ %w[remote update] + (opts['never-reboot'] ? [] : ['--reboot'])
151
+ )
150
152
  end
151
153
  if opts['bonus-wallet']
152
154
  routines.add do
@@ -23,6 +23,7 @@ STDOUT.sync = true
23
23
  require 'json'
24
24
  require 'sinatra/base'
25
25
  require 'webrick'
26
+ require 'diffy'
26
27
  require 'concurrent'
27
28
  require_relative '../version'
28
29
  require_relative '../wallet'
@@ -154,6 +155,12 @@ module Zold
154
155
  status 304
155
156
  return
156
157
  end
158
+ if before != after && before.length == after.length
159
+ settings.log.debug(
160
+ "Weird... the wallet #{id} is of the same length #{after.length}, but the content is different:\n" +
161
+ Diffy::Diff.new(before, after, context: 0).to_s
162
+ )
163
+ end
157
164
  settings.log.info("Wallet #{id} is new: #{before.length}b != #{after.length}b")
158
165
  settings.entrance.push(id, after, sync: !params[:sync].nil?)
159
166
  JSON.pretty_generate(
data/lib/zold/version.rb CHANGED
@@ -23,5 +23,5 @@
23
23
  # Copyright:: Copyright (c) 2018 Yegor Bugayenko
24
24
  # License:: MIT
25
25
  module Zold
26
- VERSION = '0.11.17'.freeze
26
+ VERSION = '0.11.18'.freeze
27
27
  end
@@ -55,7 +55,6 @@ class TestNode < Minitest::Test
55
55
  copies = Zold::Copies.new(File.join(dir, "copies/#{id}"))
56
56
  assert_equal(1, copies.all.count)
57
57
  assert_equal('1', copies.all[0][:name])
58
- assert_equal(0, copies.all[0][:score])
59
58
  end
60
59
  end
61
60
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zold
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.17
4
+ version: 0.11.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-06-09 00:00:00.000000000 Z
11
+ date: 2018-06-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby
@@ -317,6 +317,7 @@ files:
317
317
  - fixtures/scripts/calculate-scores.sh
318
318
  - fixtures/scripts/print-helps.sh
319
319
  - fixtures/scripts/push-and-pull.sh
320
+ - fixtures/scripts/with-nohup.sh
320
321
  - heroku.yml
321
322
  - lib/zold.rb
322
323
  - lib/zold/amount.rb