Elixium Core v0.6.3 Elixium.Store.Ledger View Source

Provides an interface for interacting with the blockchain stored within LevelDB. This is where blocks are stored and fetched

Link to this section Summary

Functions

Add a block to leveldb, indexing it by its hash (this is the most likely piece of data to be unique)

Returns the block at a given index

Returns the number of blocks in the chain

Hydrate ETS with our chain data

Returns the most recent block on the chain

Given a block hash, return its contents

Return the whole chain from leveldb

Link to this section Functions

Add a block to leveldb, indexing it by its hash (this is the most likely piece of data to be unique)

Link to this function block_at_height(height) View Source
block_at_height(integer()) :: Atom
block_at_height(integer()) :: Elixium.Block

Returns the block at a given index

Link to this function count_blocks() View Source
count_blocks() :: integer()

Returns the number of blocks in the chain

Link to this function drop_block(block) View Source
drop_block(Elixium.Block) :: none()

Hydrate ETS with our chain data

Link to this function last_block() View Source
last_block() :: Elixium.Block

Returns the most recent block on the chain

Link to this function last_n_blocks(n, starting_at \\ :binary.decode_unsigned(last_block().index())) View Source

Returns the last N blocks in the chain

Link to this function retrieve_block(hash) View Source
retrieve_block(String.t()) :: Elixium.Block

Given a block hash, return its contents

Return the whole chain from leveldb