Crates.io | aptos-genesis-tool |
lib.rs | aptos-genesis-tool |
version | 0.1.7 |
source | src |
created_at | 2022-05-28 20:59:31.807472 |
updated_at | 2022-07-10 21:40:28.65234 |
description | A tool to manage genesis |
homepage | https://aptoslabs.com |
repository | https://github.com/aptos-labs/aptos-core |
max_upload_size | |
id | 596005 |
size | 203,264 |
The aptos-genesis-tool
provides a tool for the genesis ceremony of the Aptos blockchain. The functionality of the tool is dictated by the organization of nodes within the system:
The process for starting organization of the planned and current functionality includes:
shared storage
, e.g., GitHub. The association then distributes credentials for each OW and OP.aptos root key
and shares the public key to the shared storage
.shared storage
.owner key
and share the public key to the shared storage
.operator key
and share the public key to the shared storage
.owner key
and uploads it to the shared storage
.operator key
and uploads it to the shared storage
.Notes:
Each individual instance, OW or OP, should have access to a secure storage solution. Those leveraging Aptos Secure Storage can directly use this tool, those that do not will need to provide their own tooling.
aptos-genesis-tool
offers several facilities:
The end-to-end process assumes that each participant has their own secure storage solution, e.g., Vault, and a token stored locally on their disk in a file accessible to the management tool.
In addition, the association will provide an entry point into a shared storage
, e.g., GitHub repository (and repository owner) along with a distinct namespace for each participant. GitHub namespaces equate to directories within the repository.
Each participant must retrieve an appropriate GitHub token for their account that allows access to the repo
scope. This token must be stored locally on their disk in a file accessible to the management tool.
Finally, each participant should initialize their respective key: aptos_root
, owner
, or operator
in a secure storage solution. How this is done is outside the scope of this document.
The remainder of this section specifies distinct behaviors for each role.
While aptos-genesis-tool
supports setting the backends on each command, doing so is cumbersome and fraught with error. Instead, all participants, should first construct a configuration file for use in genesis and later use via the operational tool. Below is an example configuration file in yaml format:
# config.yaml
chain_id: "MAINNET"
json_server: "http://127.0.0.1:8080"
shared_backend:
type: "github"
repository_owner: "REPOSITORY_OWNER"
repository: "REPOSITORY"
namespace: "REPOSITOR_FOLDER"
token:
from_config: "test"
validator_backend:
type: "vault"
server: "127.0.0.1:8200"
namespace: "VIRTUAL_NAMESPACE"
token:
from_config: "test"
Overview of fields:
chain_id
specifies a distinct chain and is written into genesis, checked during network connections, and part of each transaction. It is provided by the association.json_server
specifies an Aptos JSON Server. This can be any that connect to your network including your own of one run by the association. It is not used in genesis, so a dummy value is acceptable during initial configuration.shared_backend
is a pointer to the associaton's shared storage
.validator_backend
is a pointer to the local validator node's secure storage.shared storage
:cargo run -p aptos-genesis-tool -- \
set-layout \
--config config_file.yaml \
--path $PATH_TO_LAYOUT
shared storage
:cargo run -p aptos-genesis-tool -- \
set-move-modules \
--config config_file.yaml \
--dir $MOVE_MODULES_DIR
This should be a directory containing only Move bytecode files (.mv
extension).
aptos root
public key to the shared storage
:cargo run -p aptos-genesis-tool -- \
aptos-root-key \
--config config_file.yaml
cargo run -p aptos-genesis-tool -- \
create-waypoint \
--config config_file.yaml
The layout is a toml configuration file of the following format:
[operator] = ["alice", "bob"]
[owner] = ["carol", "dave"]
aptos_root = "erin"
where each field maps to a role as described in this document.
cargo run -p aptos-genesis-tool -- \
owner-key \
--config config_file.yaml
cargo run -p aptos-genesis-tool --
set-operator \
--config config_file.yaml \
--operator-name $OPERATOR_NAME
cargo run -p aptos-genesis-tool --
operator-key \
--config config_file.yaml
cargo run -p aptos-genesis-tool --
validator-config \
--config config_file.yaml \
--owner-name $OWNER_NAME \
--validator-address "/dns/$VALIDATOR_DNS/tcp/$VALIDATOR_PORT" \
--fullnode-address "/dns/$VFN_DNS/tcp/$VFN_PORT" \
cargo run -p aptos-genesis-tool -- \
genesis \
--config config_file.yaml \
--path $PATH_TO_GENESIS \
cargo run -p aptos-genesis-tool -- \
insert-waypoint \
--config config_file.yaml \
--waypoint $WAYPOINT
cargo run -p aptos-genesis-tool -- \
verify \
--config config_file.yaml \
--genesis_path $PATH_TO_GENESIS
__
for transit, e.g., namespace__
.https://github.org/REPOSITORY_OWNER/REPOSITORY