Class: BlockchainLite::Bitcoin::Block
- Inherits:
-
Object
- Object
- BlockchainLite::Bitcoin::Block
- Defined in:
- lib/blockchain-lite/bitcoin/block.rb
Overview
bitcoin-compatible block
note: work-in-progress
Defined Under Namespace
Classes: Header
Class Method Summary collapse
-
.first(data = 'Genesis') ⇒ Object
create genesis (big bang! first) block.
- .next(previous, data = 'Transaction Data...') ⇒ Object
Class Method Details
.first(data = 'Genesis') ⇒ Object
create genesis (big bang! first) block
44 45 46 47 |
# File 'lib/blockchain-lite/bitcoin/block.rb', line 44 def self.first( data='Genesis' ) # create genesis (big bang! first) block ## uses index zero (0) and arbitrary previous_hash ('0') Block.new( 0, data, '0' ) end |
.next(previous, data = 'Transaction Data...') ⇒ Object
49 50 51 |
# File 'lib/blockchain-lite/bitcoin/block.rb', line 49 def self.next( previous, data='Transaction Data...' ) Block.new( previous.index+1, data, previous.hash ) end |