zold 0.9.9 → 0.9.10

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7c40986afca66ce8e25fa3d5f541d08f86f1a8d7
4
- data.tar.gz: f298fd1349836b966c67737f0be441d64d9f2d1f
3
+ metadata.gz: eb875c3b804c4d045fc34d2e00ad415d2d29a370
4
+ data.tar.gz: 9562b642f01203ff7560dcd43d72c7edab08cb2d
5
5
  SHA512:
6
- metadata.gz: 5dccd8983578baaa765f8dcb05ec8db7bb6ea5682c05061a8f5419599494383a9ed8b83aa6097c433e0bcff01ca6bdd17d7d01e3c7c5190696849728510c8c5e
7
- data.tar.gz: f42970b98d36f24bd10b3d249830f8b08b718b96e6a63ab4192b47ca08b299677f6095efce74df6efa61f98db1392dd085e55869f556e3c81bdd6b233e43c7b6
6
+ metadata.gz: ac0fc271a65b8fd7284398dba3e67ab515f7d06942e12a10d27e654433907191ab1abeabb9767384296bb5259ff3387cb4ecf3a59b917d6f9c6b1a09a4ea698b
7
+ data.tar.gz: 5be7344fecc4fc4d9376b16c45c43a5a25ca6a451386b4ecca734a73358c3257c91e8e5a1a98fd73323c683c4c81be854b8497548ea0529ae4c81e6e9ed24edc
data/.rubocop.yml CHANGED
@@ -27,7 +27,12 @@ Metrics/PerceivedComplexity:
27
27
  Max: 25
28
28
  Metrics/LineLength:
29
29
  Max: 120
30
+ Layout/MultilineOperationIndentation:
31
+ Enabled: false
30
32
 
31
- # Get rid of this:
33
+ # @todo #64:30min Let's get rid of this and find a way to pass that
34
+ # $log global variable to all tests. Now it's defined inside test__helper.rb,
35
+ # but there should be a better solution. I posted a question about it:
36
+ # https://stackoverflow.com/questions/50418822
32
37
  Style/GlobalVars:
33
38
  Enabled: false
data/Procfile CHANGED
@@ -1 +1 @@
1
- web: LC_ALL=UTF-8 ./bin/zold node --no-colors --verbose --trace --bind-port=$PORT --port=80 --host=b1.zold.io --threads=0 --standalone --invoice=JKFq17yipfjLtX@0000000000000000
1
+ web: LC_ALL=UTF-8 ./bin/zold node --no-colors --verbose --trace --bind-port=$PORT --port=80 --host=b1.zold.io --threads=0 --standalone --invoice=JKFq17yipfjLtX@0000000000000000 --never-reboot
data/README.md CHANGED
@@ -1,15 +1,15 @@
1
- <img src="http://www.zold.io/logo.svg" width="64px" height="64px"/>
1
+ <img src="http://www.zold.io/logo.svg" width="92px" height="92px"/>
2
2
 
3
3
  [![EO principles respected here](http://www.elegantobjects.org/badge.svg)](http://www.elegantobjects.org)
4
4
  [![Managed by Zerocracy](https://www.0crat.com/badge/C91QJT4CF.svg)](https://www.0crat.com/p/C91QJT4CF)
5
5
  [![DevOps By Rultor.com](http://www.rultor.com/b/yegor256/Zold)](http://www.rultor.com/p/yegor256/Zold)
6
6
  [![We recommend RubyMine](http://www.elegantobjects.org/rubymine.svg)](https://www.jetbrains.com/ruby/)
7
7
 
8
- [![Build Status](https://travis-ci.org/zerocracy/zold.svg)](https://travis-ci.org/zerocracy/zold)
8
+ [![Build Status](https://travis-ci.org/yegor256/zold.svg)](https://travis-ci.org/yegor256/zold)
9
9
  [![Build status](https://ci.appveyor.com/api/projects/status/ypctxm5ohrtp2kr4?svg=true)](https://ci.appveyor.com/project/yegor256/zold)
10
10
  [![PDD status](http://www.0pdd.com/svg?name=yegor256/zold)](http://www.0pdd.com/p?name=yegor256/zold)
11
11
  [![Gem Version](https://badge.fury.io/rb/zold.svg)](http://badge.fury.io/rb/zold)
12
- [![Test Coverage](https://img.shields.io/codecov/c/github/zerocracy/zold.svg)](https://codecov.io/github/zerocracy/zold?branch=master)
12
+ [![Test Coverage](https://img.shields.io/codecov/c/github/yegor256/zold.svg)](https://codecov.io/github/yegor256/zold?branch=master)
13
13
 
14
14
  [![Dependency Status](https://gemnasium.com/yegor256/zold.svg)](https://gemnasium.com/yegor256/zold)
15
15
  [![Maintainability](https://api.codeclimate.com/v1/badges/7489c1d2bacde40ffc09/maintainability)](https://codeclimate.com/github/yegor256/zold/maintainability)
@@ -23,35 +23,39 @@ The license is [MIT](https://github.com/yegor256/zold/blob/master/LICENSE.txt).
23
23
 
24
24
  ## How to Use
25
25
 
26
- Install Ruby 2.2+, [Rubygems](https://rubygems.org/pages/download), and then run:
26
+ First, install [Ruby 2.3+](https://www.ruby-lang.org/en/documentation/installation/),
27
+ [Rubygems](https://rubygems.org/pages/download), and
28
+ the [gem](https://rubygems.org/gems/zold):
27
29
 
28
30
  ```bash
29
31
  $ sudo apt-get install ruby-dev rubygems zlib1g-dev
30
32
  $ gem install zold
31
33
  ```
32
34
 
33
- For more options and commands you can always use this:
35
+ To make sure it's installed, try:
34
36
 
35
37
  ```bash
36
38
  $ zold --help
37
39
  ```
38
40
 
39
- You will need PGP keys in `~/.ssh`. To generate them (if you don't have them yet):
41
+ You will need PGP private and public keys in `~/.ssh`.
42
+ If you don't have them yet, run this in order to generate a new pair
43
+ (just hit <kbd>Enter</kbd> when it asks you for a password):
40
44
 
41
45
  ```bash
42
46
  $ ssh-keygen -t rsa -b 4096
43
47
  ```
44
48
 
45
- First, create a wallet (instead of `5f96e731e48ae21f` there will be your
46
- person wallet number, use it everywhere below):
49
+ Then, create a new wallet (instead of `5f96e731e48ae21f` there will be your
50
+ personal wallet ID, use it everywhere below):
47
51
 
48
52
  ```bash
49
53
  $ zold create
50
54
  5f96e731e48ae21f
51
55
  ```
52
56
 
53
- Then, give its number to your friend, who is going to pay you.
54
- When the payment is sent, ask him or her for the number of the wallet
57
+ Then, give this ID to your friend, who is going to pay you.
58
+ When the payment is sent, ask him or her for the ID of the wallet
55
59
  the payment has been sent from and then fetch that wallet
56
60
  (let's say it is `5555444433332222`):
57
61
 
@@ -79,10 +83,21 @@ $ zold push 5f96e731e48ae21f
79
83
  That's it.
80
84
 
81
85
  You also can contribute to Zold by running a node on your server.
82
- In order to do that just run:
86
+ In order to do that just run (with your own wallet ID, of course,
87
+ and your own public IP address instead of `4.4.4.4`):
83
88
 
84
89
  ```bash
85
- $ zold node --invoice=5f96e731e48ae21f
90
+ $ zold node --trace --verbose --invoice=5f96e731e48ae21f --host=4.4.4.4
91
+ ```
92
+
93
+ Then, open the page `4.4.4.4:4096` in your browser.
94
+ If you see a simple JSON document, everything is fine.
95
+ Next, hit <kbd>Ctrl</kbd>+<kbd>c</kbd> and run this line, in order
96
+ to start the node and make sure it will be online even when you log off
97
+ (replace `CMD` with the command you just executed before):
98
+
99
+ ```bash
100
+ $ nohup bash -c 'while CMD; do gem install zold; done' &
86
101
  ```
87
102
 
88
103
  Grateful users of the system will pay "taxes" to your wallet
@@ -91,7 +106,7 @@ for the maintenance of their wallets.
91
106
  ## How to Contribute
92
107
 
93
108
  It is a Ruby command line gem. First, install
94
- [Ruby](https://www.ruby-lang.org/en/documentation/installation/) 2.3+,
109
+ [Ruby 2.3+](https://www.ruby-lang.org/en/documentation/installation/),
95
110
  [Rubygems](https://rubygems.org/pages/download),
96
111
  and
97
112
  [Bundler](https://bundler.io/).
@@ -9,7 +9,7 @@ port=`python -c 'import socket; s=socket.socket(); s.bind(("", 0)); print(s.gets
9
9
 
10
10
  mkdir server
11
11
  cd server
12
- zold --trace node --invoice=NOPREFIX@ffffffffffffffff \
12
+ zold node --trace --invoice=NOPREFIX@ffffffffffffffff \
13
13
  --host=localhost --port=${port} --bind-port=${port} \
14
14
  --threads=0 --standalone &
15
15
  pid=$!
@@ -72,7 +72,7 @@ Available options:"
72
72
  @remotes.error(r[:host], r[:port])
73
73
  end
74
74
  end
75
- @log.debug("#{total} copies fetched, there are #{cps.all.count} available locally")
75
+ @log.debug("#{total} copies of #{id} fetched, there are #{cps.all.count} available locally")
76
76
  end
77
77
 
78
78
  def fetch_one(id, r, cps, opts)
@@ -84,7 +84,7 @@ Available options:"
84
84
  uri = URI("#{r[:home]}wallet/#{id}")
85
85
  res = Http.new(uri).get
86
86
  if res.code == '404'
87
- @log.info("#{address} wallet #{Rainbow('not found').red}")
87
+ @log.info("#{address} wallet #{id} #{Rainbow('not found').red}")
88
88
  return false
89
89
  end
90
90
  unless res.code == '200'
@@ -71,7 +71,7 @@ Available options:"
71
71
  if modified
72
72
  @log.debug("#{cps.count} copies merged successfully into #{wallet.path}")
73
73
  else
74
- @log.debug("Nothing changed in #{wallet.path} after merge of #{cps.count} copies")
74
+ @log.debug("Nothing changed in #{wallet.id} after merge of #{cps.count} copies")
75
75
  end
76
76
  modified
77
77
  end
@@ -61,6 +61,9 @@ module Zold
61
61
  o.bool '--standalone',
62
62
  'Never communicate with other nodes (mostly for testing)',
63
63
  default: false
64
+ o.bool '--never-reboot',
65
+ 'Don\'t reboot when a new version shows up in the network',
66
+ default: false
64
67
  o.bool '--help', 'Print instructions'
65
68
  end
66
69
  if opts.help?
@@ -94,6 +97,7 @@ module Zold
94
97
  :entrance, Entrance.new(wallets, remotes, copies, address, log: @log)
95
98
  )
96
99
  Zold::Front.set(:port, opts['bind-port'])
100
+ Zold::Front.set(:reboot, !opts['never-rebootw'])
97
101
  invoice = opts[:invoice]
98
102
  unless invoice.include?('@')
99
103
  require_relative 'pull'
@@ -59,8 +59,9 @@ Available options:"
59
59
  end
60
60
  mine = Args.new(opts, @log).take || return
61
61
  raise 'Payer wallet ID is required as the first argument' if mine[0].nil?
62
- from = @wallets.find(Id.new(mine[0]))
63
- raise 'Wallet doesn\'t exist, do \'fetch\' first' unless from.exists?
62
+ id = Id.new(mine[0])
63
+ from = @wallets.find(id)
64
+ raise "Wallet #{id} doesn't exist, do 'pull' first" unless from.exists?
64
65
  raise 'Recepient\'s invoice or wallet ID is required as the second argument' if mine[1].nil?
65
66
  invoice = mine[1]
66
67
  unless invoice.include?('@')
@@ -89,6 +90,7 @@ Available options:"
89
90
  key = Zold::Key.new(file: opts['private-key'])
90
91
  txn = from.sub(amount, invoice, key, details)
91
92
  @log.debug("#{amount} sent from #{from} to #{txn.bnf}: #{details}")
93
+ @log.debug("Don't forget to do 'zold push #{from}'")
92
94
  @log.info(txn.id)
93
95
  txn
94
96
  end
data/lib/zold/http.rb CHANGED
@@ -30,8 +30,16 @@ require_relative 'score'
30
30
  module Zold
31
31
  # Http page
32
32
  class Http
33
+ # HTTP header we add to each HTTP request, in order to inform
34
+ # the other node about the score. If the score is big enough,
35
+ # the remote node will add us to its list of remote nodes.
33
36
  SCORE_HEADER = 'X-Zold-Score'.freeze
34
37
 
38
+ # HTTP header we add, in order to inform the node about our
39
+ # version. This is done mostly in order to let the other node
40
+ # reboot itself, if the version is higher.
41
+ VERSION_HEADER = 'X-Zold-Version'.freeze
42
+
35
43
  def initialize(uri, score = Score::ZERO)
36
44
  @uri = uri
37
45
  @score = score
@@ -66,7 +74,8 @@ module Zold
66
74
  'User-Agent': "Zold #{VERSION}",
67
75
  'Connection': 'close'
68
76
  }
69
- headers[SCORE_HEADER] = score.reduced(4).to_s if @score.valid? && @score.value >= 3 && !score.expired?
77
+ headers[Http::VERSION_HEADER] = VERSION
78
+ headers[Http::SCORE_HEADER] = score.reduced(4).to_s if @score.valid? && @score.value >= 3 && !score.expired?
70
79
  headers
71
80
  end
72
81
  end
@@ -23,7 +23,7 @@ STDOUT.sync = true
23
23
  require 'json'
24
24
  require 'sinatra/base'
25
25
  require 'webrick'
26
-
26
+ require 'semantic'
27
27
  require_relative '../version'
28
28
  require_relative '../wallet'
29
29
  require_relative '../log'
@@ -45,6 +45,7 @@ module Zold
45
45
  set :lock, false
46
46
  set :show_exceptions, false
47
47
  set :server, 'webrick'
48
+ set :reboot, false # to be injected at node.rb
48
49
  set :home, nil? # to be injected at node.rb
49
50
  set :logging, true # to be injected at node.rb
50
51
  set :log, nil? # to be injected at node.rb
@@ -57,11 +58,16 @@ module Zold
57
58
  end
58
59
 
59
60
  before do
60
- if request.env[Http::SCORE_HEADER] && !settings.remotes.empty?
61
- s = Score.parse(request.env[Http::SCORE_HEADER])
62
- error(400, 'The score is invalid') unless s.valid?
63
- settings.remotes.add(s.host, s.port) if s.value > 3
61
+ if request.env[Http::VERSION_HEADER] &&
62
+ Semantic::Version.new(VERSION) < Semantic::Version.new(request.env[Http::VERSION_HEADER]) &&
63
+ !settings.remotes.empty? && settings.reboot
64
+ exit(0)
64
65
  end
66
+ return unless request.env[Http::SCORE_HEADER]
67
+ return unless settings.remotes.empty?
68
+ s = Score.parse(request.env[Http::SCORE_HEADER])
69
+ error(400, 'The score is invalid') unless s.valid?
70
+ settings.remotes.add(s.host, s.port) if s.value > 3
65
71
  end
66
72
 
67
73
  after do
@@ -85,6 +91,7 @@ module Zold
85
91
  score: score.to_h,
86
92
  uptime: `uptime`.strip,
87
93
  wallets: settings.wallets.all.count,
94
+ remotes: settings.remotes.all.count,
88
95
  farm: settings.farm.to_json,
89
96
  date: `date --iso-8601=seconds -u`.strip,
90
97
  hours_alive: ((Time.now - settings.start) / (60 * 60)).round(2),
data/lib/zold/txn.rb CHANGED
@@ -78,7 +78,8 @@ module Zold
78
78
  end
79
79
 
80
80
  def to_text
81
- "##{@id} #{@date.utc.iso8601} #{@amount} #{@bnf} #{@details}"
81
+ start = @amount.negative? ? "##{@id}" : '-'
82
+ "#{start} #{@date.utc.iso8601} #{@amount} #{@bnf} #{@details}"
82
83
  end
83
84
 
84
85
  def inverse(bnf)
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.9.9'.freeze
26
+ VERSION = '0.9.10'.freeze
27
27
  end
data/wp/wp.pdf CHANGED
Binary file
data/wp/wp.tex CHANGED
@@ -20,6 +20,7 @@
20
20
  \AfterEndEnvironment{minted}{\end{mdframed}}
21
21
  \usepackage{xcolor}
22
22
  \usepackage{graphicx}
23
+ \pagecolor{black!3}
23
24
  \newcommand\dd[1]{\colorbox{gray!30}{\texttt{#1}}}
24
25
  \usepackage{hyperref}
25
26
  \hypersetup{colorlinks=true,allcolors=blue!40!black}
@@ -107,7 +108,7 @@ The first problem is that transaction processing is rather slow.%
107
108
  and is therefore inappropriate for fast payments.''
108
109
  It is inevitable, since
109
110
  ``processing speed is at odds with the security aspects of the underlying
110
- proof-of-work based consensus mechanism''~\parencite{kiayias2015}.
111
+ proof-of-work based consensus mechanism'' according to~\textcite{kiayias2015}.
111
112
 
112
113
  The second problem, as noted by~\textcite{popov2017}, is that ``it is not easy to get rid
113
114
  of fees in the blockchain infrastructure since they serve
@@ -132,11 +133,13 @@ Unlike \emph{all} other crypto currencies, there is no central ledger in Zold.
132
133
  Each wallet has its own personal ledger.
133
134
  All transactions in each ledger are confirmed by
134
135
  \href{https://en.wikipedia.org/wiki/RSA_(cryptosystem)}{RSA signatures} of their owners.
136
+ Section~\ref{sec:wallets} explains how it works.
135
137
 
136
138
  \textbf{Proof of work}.
137
139
  Similar to many other digital currencies---including Bitcoin, Etherium, Plancoin, Monero, Trinity, Plancoin, Dero,
138
140
  and many others---Zold nodes find consensus by comparing the amount of CPU power invested
139
141
  by each of them into finding hash suffixes, performing certain expensive and meaningless calculations.
142
+ Section~\ref{sec:score} describes the algorithm being used.
140
143
 
141
144
  \textbf{Root Wallet}.
142
145
  Zold is a pre-mined%
@@ -180,7 +183,7 @@ EOS, NEO, Loki,%
180
183
  and many others.
181
184
  The only way to get ZLD is to receive it from someone else.
182
185
  The root wallet belongs to the issuer and may have a negative balance,
183
- which can grow according to a pre-defined restrictive formula.
186
+ which can grow according to a pre-defined restrictive formula, explained in Section~\ref{sec:formula}.
184
187
  All other wallets may only have positive balances.
185
188
 
186
189
  \textbf{Taxes}.
@@ -188,14 +191,16 @@ Unlike many other payment systems, Zold doesn't require its users
188
191
  to pay transaction fees. Instead, wallets have to pay regular ``taxes'' for the
189
192
  service of their maintenances. Taxes amounts depend on the amount
190
193
  of transactions in a wallet and the age of the wallet.
194
+ Section~\ref{sec:taxes} provides more details.
191
195
 
192
196
  \textbf{No Trust}.
193
197
  The network of communicating nodes maintains wallets of users.
194
198
  Anyone can add a node to the network.
195
199
  It is assumed that any node may contain corrupted data, either by mistake or intentionally.
200
+ Section~\ref{sec:remotes} explains how nodes communicate and rate each other.
196
201
 
197
202
  \textbf{Open Source}.
198
- Zold is a command line tool. Its entire code base is open source
203
+ Zold is a command line tool. Its entire code base is open
199
204
  and hosted at the GitHub \href{https://github.com/yegor256/zold}{yegor256/zold}
200
205
  repository.
201
206
 
@@ -224,7 +229,7 @@ A user may make up any number, even using
224
229
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
225
230
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
226
231
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
227
- \section{Proof of Work}
232
+ \section{Proof of Work}\label{sec:score}
228
233
 
229
234
  The system consists of nodes (server machines), which maintain the data.
230
235
  In order to guarantee data consistency among all distributed nodes
@@ -314,7 +319,7 @@ the score. All nodes in the network must have the same strength of their scores.
314
319
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
315
320
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
316
321
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
317
- \section{Wallets}
322
+ \section{Wallets}\label{sec:wallets}
318
323
 
319
324
  There is no central ledger in Zold, like in many other digital currencies.
320
325
  Instead, each user has their own \emph{wallets} (any number of them) with their own ledgers inside.
@@ -388,7 +393,7 @@ The order of transactions is not important, as long as their final balance is po
388
393
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
389
394
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
390
395
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
391
- \section{Mining Formula}
396
+ \section{Mining Formula}\label{sec:formula}
392
397
 
393
398
  The only way to get ZLD is to receive it from the \emph{root} wallet
394
399
  with a system pre-defined ID \dd{0000000000000000}.
@@ -420,7 +425,7 @@ The limitation is hardwired in Zold software and can't be eliminated.
420
425
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
421
426
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
422
427
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
423
- \section{Taxes}
428
+ \section{Taxes}\label{sec:taxes}
424
429
 
425
430
  Each wallet must have to pay \emph{taxes} in order to be promoted by nodes.
426
431
  The maximum amount of tax debt a node can tolerate is 1 ZLD. This means
@@ -456,7 +461,7 @@ Duplicate tax payments are ignored.
456
461
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
457
462
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
458
463
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
459
- \section{Remote Nodes}
464
+ \section{Remote Nodes}\label{sec:remotes}
460
465
 
461
466
  Each node maintains a list of \emph{remote nodes} (their host names and TCP port numbers),
462
467
  their scores and their availability information. When the node is just installed,
@@ -549,7 +554,7 @@ Then, it \emph{promotes} the wallet to all known remote nodes.
549
554
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
550
555
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
551
556
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
552
- \section{RESTful API}
557
+ \section{RESTful API}\label{sec:api}
553
558
 
554
559
  There is a limited set of RESTful API entry points in each node.
555
560
  Each response has \dd{Content-Type},
@@ -619,7 +624,7 @@ or
619
624
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
620
625
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
621
626
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
622
- \section{Incentives}
627
+ \section{Incentives}\label{sec:incentives}
623
628
 
624
629
  It is obvious that anonymous users will participate in Zold and maintain
625
630
  their nodes only if they have enough financial motivation to do that. Simply
@@ -662,7 +667,7 @@ each node is interested to push wallets further.
662
667
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
663
668
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
664
669
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
665
- \section{Threats \& Responses}
670
+ \section{Threats and Responses}\label{sec:threats}
666
671
 
667
672
  It is obvious that a distributed system that consists of anonymous nodes
668
673
  even theorecially can't be 100\% safe, reliable, secure and trustworthy.
@@ -717,6 +722,10 @@ The only sensitive part is the private key of the wallet. If that file
717
722
  is lost, the wallet can't pay anything anymore. This is the file all
718
723
  wallet owners must keep safe.
719
724
 
725
+ \section{Conclusion}
726
+
727
+ To be written...
728
+
720
729
  \printbibliography%
721
730
 
722
731
  \end{document}
data/zold.gemspec CHANGED
@@ -50,6 +50,7 @@ Gem::Specification.new do |s|
50
50
  s.add_runtime_dependency 'rake', '12.0.0'
51
51
  s.add_runtime_dependency 'rubocop', '~>0.52.0'
52
52
  s.add_runtime_dependency 'rubocop-rspec', '1.5.1'
53
+ s.add_runtime_dependency 'semantic', '~>1.5.0'
53
54
  s.add_runtime_dependency 'sinatra', '~>2.0.1'
54
55
  s.add_runtime_dependency 'slop', '~>4.4'
55
56
  s.add_runtime_dependency 'xcop', '~>0.5'
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.9.9
4
+ version: 0.9.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko
@@ -122,6 +122,20 @@ dependencies:
122
122
  - - '='
123
123
  - !ruby/object:Gem::Version
124
124
  version: 1.5.1
125
+ - !ruby/object:Gem::Dependency
126
+ name: semantic
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: 1.5.0
132
+ type: :runtime
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "~>"
137
+ - !ruby/object:Gem::Version
138
+ version: 1.5.0
125
139
  - !ruby/object:Gem::Dependency
126
140
  name: sinatra
127
141
  requirement: !ruby/object:Gem::Requirement