class Centralbank::Configuration
Constants
- COINBASE
note: add a (†) coinbase marker
- WALLET_ADDRESSES
Attributes
address[RW]
user/node settings
coinbase[RW]
system/blockchain settings
mining_reward[RW]
Public Class Methods
new()
click to toggle source
# File lib/centralbank.rb, line 60 def initialize ## try default setup via ENV variables ## pick "random" address if nil (none passed in) @address = ENV[ 'CENTRALBANK_NAME'] || rand_address() @coinbase = COINBASE ## use a different name - why? why not? ## note: for now is an array (multiple coinbases) @mining_reward = 5 end
Public Instance Methods
coinbase?( address )
click to toggle source
# File lib/centralbank.rb, line 73 def coinbase?( address ) ## check/todo: use wallet - why? why not? (for now wallet==address) @coinbase.include?( address ) end
rand_address()
click to toggle source
# File lib/centralbank.rb, line 70 def rand_address() WALLET_ADDRESSES[rand( WALLET_ADDRESSES.size )]; end
rand_coinbase()
click to toggle source
# File lib/centralbank.rb, line 71 def rand_coinbase() @coinbase[rand( @coinbase.size )]; end