-
Notifications
You must be signed in to change notification settings - Fork 255
Conversation
8afc5cf
to
b15584b
Compare
src/cli/miner_cli_genesis.erl
Outdated
Addrs = [Addr || Addr <- ValAddrs ], | ||
SortedAddrs = lists:sort(Addrs), | ||
ConsensusAddrs = lists:sublist(SortedAddrs, 1, N), | ||
NewConsensusGroupTxn = blockchain_txn_consensus_group_v1:new(ConsensusAddrs, <<>>, 1, 0), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The risk here is that you pick some dead consensus members, how do you boot a chain with this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i could check for liveness based on last heartbeat, exclude any which are not recent from the sorted list
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another option would be to carry across the existing CG members to the new group
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it'd be better to not include a consensus group txn, and let initial_dkg handle it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then you could simply boot the chain on the new validators by giving them the exported genesis txns and the initial consensus group members.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/helium/miner/blob/master/src/miner_consensus_mgr.erl#L947-L958
So really you're not making the genesis block directly, you're making the contents of the genesis block
a4ad80b
to
b1f2e27
Compare
src/cli/miner_cli_genesis.erl
Outdated
" genesis key - create a keypair for use as a master key\n" | ||
" genesis proof <privkey> - create a key proof for adding a master key to the genesis block\n" | ||
" genesis export_ledger <masterkey> <txn_list_output_path> - export data from ledger as a list of txns including accounts, gateways, validators and chainvars\n" | ||
" genesis recreate_ledger <n> <curve> <path_to_txn_list> <addrs> - export data from ledger as a list of txns including accounts, gateways, validators and chainvars\n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has copied help text from export_ledger
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed here: 1675824
src/cli/miner_cli_genesis.erl
Outdated
%% | ||
genesis_recreate_ledger_cmd() -> | ||
[ | ||
[["genesis", "recreate_ledger", '*', '*'], [], [], fun genesis_recreate_ledger/3] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the second form, with 4 arguments isn;t listed here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
22217fc
to
9667b7d
Compare
Adds CLI and associated helper scripts to export the ledger data to a batch of gen txns, which can then be loaded and used as part of an initial dkg. Allows a test network such as testnet to be reset whilst maintaining existing data.
Exported data includes accounts, gateways, validators, oracle price & chainvars.
Tested on a local chain via run.sh