class Tulipmania::Configuration
Constants
- TULIPS
- TULIP_GROWERS
note: add a (†) coinbase / grower marker
- WALLET_ADDRESSES
Attributes
address[RW]
user/node settings
coinbase[RW]
system/blockchain settings
mining_reward[RW]
tulips[RW]
Public Class Methods
new()
click to toggle source
# File lib/tulipmania.rb, line 64 def initialize ## try default setup via ENV variables ## pick "random" address if nil (none passed in) @address = ENV[ 'TULIPMANIA_NAME'] || rand_address() @coinbase = TULIP_GROWERS ## use a different name for coinbase - why? why not? ## note: for now is an array (multiple growsers) @tulips = TULIPS ## change name to commodities or assets - why? why not? @mining_reward = 5 end
Public Instance Methods
coinbase?( address )
click to toggle source
# File lib/tulipmania.rb, line 81 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/tulipmania.rb, line 77 def rand_address() WALLET_ADDRESSES[rand( WALLET_ADDRESSES.size )]; end
rand_coinbase()
click to toggle source
# File lib/tulipmania.rb, line 79 def rand_coinbase() @coinbase[rand( @coinbase.size )]; end
rand_tulip()
click to toggle source
# File lib/tulipmania.rb, line 78 def rand_tulip() @tulips[rand( @tulips.size )]; end