Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/JoshOrndorff/blockchain-from-scratch
/ functions
Functions
239 in github.com/JoshOrndorff/blockchain-from-scratch
⨍
Functions
239
◇
Types & classes
58
Function
change_difficulty
Create a PoW consensus engine that changes the difficulty part way through the chain's history.
src/c3_consensus/p6_forking.rs:55
Method
child
Create and return a valid child header.
src/c4_client/p1_data_structure.rs:31
Method
contains
(&self, t: <SM as StateMachine>::Transition)
src/c4_client/p4_transaction_pool.rs:80
Function
create_empty_chain
Create and return a block chain that is n blocks long starting from the given genesis state. The blocks should not contain any transactions.
src/c4_client/p1_data_structure.rs:70
Method
default
()
src/c4_client/p1_data_structure.rs:99
Function
even_after_given_height
Earlier in this chapter we implemented a consensus rule in which blocks are only considered valid if they contain an even state root. Sometimes a chai
src/c3_consensus/p6_forking.rs:70
Method
first_chain_is_better
(chain_1: &[Header], chain_2: &[Header])
src/c2_blockchain/p5_fork_choice.rs:43
Method
from
(value: [Bill; N])
src/c1_state_machine/p5_digital_cash.rs:71
Method
from
(_: u64)
src/c3_consensus/p5_interleave.rs:22
Method
from_iter
(iter: I)
src/c1_state_machine/p5_digital_cash.rs:60
Method
genesis
Returns a new valid genesis header.
src/c4_client/p1_data_structure.rs:26
Method
genesis
Returns a new valid genesis header.
src/c2_blockchain/p2_extrinsic_state.rs:33
Method
genesis
Returns a new valid genesis header.
src/c2_blockchain/p4_batched_extrinsics.rs:35
Method
genesis
Returns a new valid genesis header.
src/c2_blockchain/p3_consensus.rs:39
Method
genesis
Returns a new valid genesis header.
src/c2_blockchain/p6_rich_state.rs:49
Method
genesis
Returns a new valid genesis header.
src/c2_blockchain/p1_header_chain.rs:27
Method
get_block
(&self, block_hash: u64)
src/c4_client/p2_importing_blocks.rs:41
Method
get_state
(&self, block_hash: u64)
src/c4_client/p2_importing_blocks.rs:45
Method
human_name
A human-readable name for this state machine. This may be used in user-facing programs such as the repl described below. This is not in any way relate
src/c1_state_machine/mod.rs:25
Method
human_name
A human-readable name for this engine. This may be used in user-facing programs error reporting. This is not in any way related to the correctness of
src/c3_consensus/mod.rs:85
Method
import_block
(&mut self, _: Block<C, SM>)
src/c4_client/p2_importing_blocks.rs:37
Method
import_hook
(&mut self, header: Header<C::Digest>)
src/c4_client/p3_fork_choice.rs:36
Method
is_leaf
(&self, block_hash: u64)
src/c4_client/p2_importing_blocks.rs:49
Method
manually_finalize_block
Mark the given block as final so that it will never be reverted. Returns whether or not the block was known and marked successfully.
src/c4_client/p6_finality.rs:13
Function
moderate_difficulty_pow
Create a PoW consensus engine that has a difficulty threshold such that roughly 1 in 100 blocks with randomly drawn nonces will be valid. That is: the
src/c3_consensus/p1_pow.rs:34
Method
new
(genesis_state: SM::State)
src/c4_client/p1_data_structure.rs:84
Method
new
()
src/c1_state_machine/p5_digital_cash.rs:34
Method
next_from_pool
(&mut self)
src/c4_client/p4_transaction_pool.rs:84
Method
next_serial
(&self)
src/c1_state_machine/p5_digital_cash.rs:45
Method
next_state
(starting_state: &ClothesState, t: &ClothesAction)
src/c1_state_machine/p2_laundry_machine.rs:42
Method
next_state
(starting_state: &bool, t: &())
src/c1_state_machine/p1_switches.rs:17
Method
next_state
(starting_state: &Self::State, t: &Self::Transition)
src/c1_state_machine/p5_digital_cash.rs:96
Method
next_state
(starting_state: &Balances, t: &AccountingTransaction)
src/c1_state_machine/p4_accounted_currency.rs:47
Method
next_state
(_starting: &Self::State, _t: &Self::Transition)
src/c1_state_machine/p6_open_ended.rs:33
Method
next_state
(starting_state: &Self::State, t: &Self::Transition)
src/c1_state_machine/p3_atm.rs:60
Method
pool_contains
Check whether a a given transaction is in the client's transaction pool.
src/c4_client/p4_transaction_pool.rs:59
Method
pool_size
Get the total number of transactions in the node's transaction pool.
src/c4_client/p4_transaction_pool.rs:54
Function
pow_to_poa
In the spirit of Ethereum's recent switch from PoW to PoA, let us model a similar switch in our consensus framework. It should go without saying that
src/c3_consensus/p6_forking.rs:80
Method
remove
(&mut self, t: <SM as StateMachine>::Transition)
src/c4_client/p4_transaction_pool.rs:72
Method
seal
( &self, parent_digest: &Self::Digest, partial_header: Header<()>, )
src/c3_consensus/p5_interleave.rs:56
Method
seal
Sign the given partial header by the dictator
src/c3_consensus/p2_dictator.rs:28
Method
seal
( &self, parent_digest: &Self::Digest, partial_header: Header<()>, )
src/c3_consensus/p3_poa.rs:26
Method
seal
No real sealing is required.
src/c3_consensus/mod.rs:101
Method
seal
( &self, parent_digest: &Self::Digest, partial_header: Header<()>, )
src/c3_consensus/p4_even_only.rs:23
Method
seal
Mine a new PoW seal for the partial header provided. This does not rely on the parent digest at all.
src/c3_consensus/p1_pow.rs:27
Method
seal
( &self, parent_digest: &Self::Digest, partial_header: Header<()>, )
src/c3_consensus/p6_forking.rs:35
Method
size
(&self)
src/c4_client/p4_transaction_pool.rs:76
Function
sm_1_light_switch_toggles_off
()
src/c1_state_machine/p1_switches.rs:50
Function
sm_1_light_switch_toggles_on
()
src/c1_state_machine/p1_switches.rs:55
Function
sm_1_two_switches_first_goes_off_second_was_off
()
src/c1_state_machine/p1_switches.rs:93
Function
sm_1_two_switches_first_goes_off_second_was_on
()
src/c1_state_machine/p1_switches.rs:76
Function
sm_1_two_switches_first_goes_on
()
src/c1_state_machine/p1_switches.rs:60
Function
sm_1_two_switches_second_goes_off
()
src/c1_state_machine/p1_switches.rs:126
Function
sm_1_two_switches_second_goes_on
()
src/c1_state_machine/p1_switches.rs:110
Function
sm_2_dry_clean_clothes
()
src/c1_state_machine/p2_laundry_machine.rs:160
Function
sm_2_dry_clean_until_tattered
()
src/c1_state_machine/p2_laundry_machine.rs:192
Function
sm_2_dry_cwet_until_tattered
()
src/c1_state_machine/p2_laundry_machine.rs:200
Function
sm_2_dry_dirty_clothes
()
src/c1_state_machine/p2_laundry_machine.rs:168
Function
sm_2_dry_dirty_until_tattered
()
src/c1_state_machine/p2_laundry_machine.rs:208
Function
sm_2_dry_tattered_clothes
()
src/c1_state_machine/p2_laundry_machine.rs:184
Function
sm_2_dry_wet_clothes
()
src/c1_state_machine/p2_laundry_machine.rs:176
Function
sm_2_wash_clean_clothes
()
src/c1_state_machine/p2_laundry_machine.rs:104
Function
sm_2_wash_clean_until_tattered
()
src/c1_state_machine/p2_laundry_machine.rs:136
Function
sm_2_wash_dirty_clothes
()
src/c1_state_machine/p2_laundry_machine.rs:112
Function
sm_2_wash_dirty_until_tattered
()
src/c1_state_machine/p2_laundry_machine.rs:152
Function
sm_2_wash_tattered_clothes
()
src/c1_state_machine/p2_laundry_machine.rs:128
Function
sm_2_wash_wet_clothes
()
src/c1_state_machine/p2_laundry_machine.rs:120
Function
sm_2_wash_wet_until_tattered
()
src/c1_state_machine/p2_laundry_machine.rs:144
Function
sm_2_wear_clean_clothes
()
src/c1_state_machine/p2_laundry_machine.rs:48
Function
sm_2_wear_clean_until_tattered
()
src/c1_state_machine/p2_laundry_machine.rs:80
Function
sm_2_wear_dirty_clothes
()
src/c1_state_machine/p2_laundry_machine.rs:56
Function
sm_2_wear_dirty_until_tattered
()
src/c1_state_machine/p2_laundry_machine.rs:96
Function
sm_2_wear_tattered_clothes
()
src/c1_state_machine/p2_laundry_machine.rs:72
Function
sm_2_wear_wet_clothes
()
src/c1_state_machine/p2_laundry_machine.rs:64
Function
sm_2_wear_wet_until_tattered
()
src/c1_state_machine/p2_laundry_machine.rs:88
Function
sm_3_enter_correct_pin
()
src/c1_state_machine/p3_atm.rs:183
Function
sm_3_enter_single_digit_of_pin
()
src/c1_state_machine/p3_atm.rs:131
Function
sm_3_enter_single_digit_of_withdraw_amount
()
src/c1_state_machine/p3_atm.rs:204
Function
sm_3_enter_wrong_pin
()
src/c1_state_machine/p3_atm.rs:162
Function
sm_3_press_key_before_card_swipe
()
src/c1_state_machine/p3_atm.rs:114
Function
sm_3_simple_swipe_card
()
src/c1_state_machine/p3_atm.rs:66
Function
sm_3_swipe_card_again_part_way_through
()
src/c1_state_machine/p3_atm.rs:83
Function
sm_3_try_to_withdraw_too_much
()
src/c1_state_machine/p3_atm.rs:235
Function
sm_3_withdraw_acceptable_amount
()
src/c1_state_machine/p3_atm.rs:252
Function
sm_4_burn_more_than_balance
()
src/c1_state_machine/p4_accounted_currency.rs:158
Function
sm_4_burn_no_existential_deposit_left
()
src/c1_state_machine/p4_accounted_currency.rs:128
Function
sm_4_burner_does_not_exist
()
src/c1_state_machine/p4_accounted_currency.rs:188
Function
sm_4_empty_burn
()
src/c1_state_machine/p4_accounted_currency.rs:173
Function
sm_4_empty_mint
()
src/c1_state_machine/p4_accounted_currency.rs:98
Function
sm_4_insufficient_balance_transfer
()
src/c1_state_machine/p4_accounted_currency.rs:248
Function
sm_4_mint_creates_account
()
src/c1_state_machine/p4_accounted_currency.rs:53
Function
sm_4_mint_creates_second_account
()
src/c1_state_machine/p4_accounted_currency.rs:68
Function
sm_4_mint_increases_balance
()
src/c1_state_machine/p4_accounted_currency.rs:83
Function
sm_4_non_registered_burner
()
src/c1_state_machine/p4_accounted_currency.rs:143
Function
sm_4_receiver_not_registered
()
src/c1_state_machine/p4_accounted_currency.rs:280
Function
sm_4_send_to_same_user
()
src/c1_state_machine/p4_accounted_currency.rs:232
Function
sm_4_sender_not_registered
()
src/c1_state_machine/p4_accounted_currency.rs:264
Function
sm_4_sender_to_empty_balance
()
src/c1_state_machine/p4_accounted_currency.rs:296
Function
sm_4_simple_burn
()
src/c1_state_machine/p4_accounted_currency.rs:113
Function
sm_4_simple_transfer
()
src/c1_state_machine/p4_accounted_currency.rs:203
← previous
next →
101–200 of 239, ranked by callers