[][src]Module damn_vuln_blockchain::chain

[]

Ledger data-structure for the blockchain

Create a new blockchain

use damn_vuln_blockchain::{ asset::AssetLedger, block::{BlockBuilder, Block}, chain::Chain};

fn main() {
       let chain = Chain::new("My chain"); // crate cahin
  }

The easiest way to interact with the ledger is via the Chain actor.

Chain supports the followings messages:

Structs

AddBlock

Add Block send block and network_size network_size is required becuase when InitNetwork is called it sets an offset for Block.serial_no = network_size

Chain

Ledger data-structure for the blockchain

DumpLedger

Dumps entire ledger Useful when forking: send DumpLedger and send output with ReplaceChain

GetLastBlock

Get last block

ReplaceChain

Replace Chain