blockchain v0.1.7 Blockchain.Chain

Represents the information about a specific chain. This will either be a current chain (such as homestead), or a test chain (such as ropsten). Different chains have different parameters, such as accounts with an initial balance and when EIPs are implemented.

For compatibility, we’ll use the configuration files from Parity: https://github.com/paritytech/parity/tree/master/ethcore/res/ethereum

Link to this section Summary

Functions

Loads a given blockchain, such as Homestead or Ropsten. This chain is used to set the genesis block and tweak parameters of the Blockchain and EVM

Link to this section Types

Link to this type t()
t() :: %Blockchain.Chain{accounts: %{optional(EVM.address) => %{balance: EVM.Wei.t, nonce: integer, storage: %{optional(binary) => binary}}}, engine: %{optional(String.t) => %{minimum_difficulty: integer, difficulty_bound_divisor: integer, duration_limit: integer, homestead_transition: integer, eip150_transition: integer, eip160_transition: integer, eip161abc_transition: integer, eip161d_transition: integer, max_code_size: integer}}, genesis: %{difficulty: integer, author: EVM.address, timestamp: integer, parent_hash: EVM.hash, extra_data: binary, gas_limit: EVM.Gas.t, mix_hash: binary, nonce: binary}, name: String.t, nodes: [String.t], params: %{gas_limit_bound_divisor: integer, block_reward: integer, account_start_nonce: integer, maximum_extra_data_size: integer, min_gas_limit: integer, eip155_transition: integer, eip98_transition: integer, eip86_transition: integer}}

Link to this section Functions

Link to this function load_chain(chain)
load_chain(atom) :: t

Loads a given blockchain, such as Homestead or Ropsten. This chain is used to set the genesis block and tweak parameters of the Blockchain and EVM.

See the /chains directory of this repo for supported block chains.

Examples

iex> Blockchain.Chain.load_chain(:ropsten).name
"Ropsten"

iex> Blockchain.Chain.load_chain(:ropsten).genesis.difficulty
0x100000
Link to this function load_decimal(dec_data)
load_decimal(String.t) :: integer