class Zold::Routines::Spread
Spread
random wallets to the network.
- Author
-
Yegor Bugayenko (yegor256@gmail.com)
- Copyright
-
Copyright © 2018 Yegor Bugayenko
- License
-
MIT
Public Class Methods
new(opts, wallets, remotes, copies, log: Log::NULL)
click to toggle source
# File lib/zold/commands/routines/spread.rb, line 35 def initialize(opts, wallets, remotes, copies, log: Log::NULL) @opts = opts @wallets = wallets @remotes = remotes @copies = copies @log = log end
Public Instance Methods
exec(_ = 0)
click to toggle source
# File lib/zold/commands/routines/spread.rb, line 43 def exec(_ = 0) sleep(60) unless @opts['routine-immediately'] @wallets.all.sample(100).each do |id| next if Zold::Copies.new(File.join(@copies, id)).all.count < 2 Zold::Push.new(wallets: @wallets, remotes: @remotes, log: @log).run( ['push', "--network=#{Shellwords.escape(@opts['network'])}", id.to_s] ) end end