sawtooth.cli.stats_lib.fork_detect module

class sawtooth.cli.stats_lib.fork_detect.BlockChainBranch[source]

Bases: object

assess(block)[source]

adds block to branch if branch is empty, else.... adds block to branch if block is a direct predecessor or successor returns true if block is added or exact copy already exists in branch otherwise returns false

block_count
get_stats_as_dict()[source]
is_active_count
print_branch(do_print=False, print_all=False, print_terse=False)[source]
remove_head()[source]
remove_tail()[source]
class sawtooth.cli.stats_lib.fork_detect.BlockChainFork[source]

Bases: object

branch_count
build_fork(active_branch)[source]
find_intercept(child_fork)[source]

while stepping through child fork branches from head to tail if the child fork branch is found in parent fork branches if the child fork branch intercept block num is less than the parent fork branch intercept block num then intercept block num is child intercept block num if the child fork branch intercept block num is greater than the parent fork branch intercept block num then intercept block num is parent intercept block num else there is no intercept

get_stats_as_dict()[source]
get_successor_info(info_branch)[source]
class sawtooth.cli.stats_lib.fork_detect.BlockClient(bc_id, full_url, look_back_count=5, validator=None)[source]

Bases: object

blocks_request()[source]
get_new_blocks()[source]
update(block_response)[source]
class sawtooth.cli.stats_lib.fork_detect.BranchManager(endpoint_manager, config)[source]

Bases: sawtooth.cli.stats_lib.stats_utils.StatsModule

branch_count
branch_update(block)[source]

for each branch in branches.... assess whether the current block should be added to the branch if the block is not found in any branches, create a new one and add it

collect()[source]
connect()[source]
fork_count
trim_empty_branches()[source]
update()[source]
update_client_list()[source]
class sawtooth.cli.stats_lib.fork_detect.BranchManagerStats[source]

Bases: object

get_stats_as_dict()[source]
print_stats()[source]
class sawtooth.cli.stats_lib.fork_detect.ForkManagerStats[source]

Bases: object

get_stats_as_dict()[source]
print_stats()[source]