This tooling facilitates the generation and management of keypairs and access controllers essential for the application. It ensures secure handling of sensitive information and streamlines the setup process for deploying a full-stack decentralized application.
Follow these steps to install Rust and build the project:
-
Download and Install Rust:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Follow the on-screen instructions to complete the installation.
-
Verify Installation:
rustc --version
-
Navigate to the Project Directory:
cd fullstack-dapp-example/packages/bootstrap-accounts -
Run Cargo Build:
cargo build
This tooling provides the following features:
- Purpose: Generates all necessary keypairs required for the application, including
owner,system,payer, anddapp-definition. It also generates one key pair for confirmation role and one for recovery role. - Command: Execute the following command to generate the keypairs.
- Environment Variables: Ensure that the
NETWORK_IDenvironment variable is exported before running the command.
export NETWORK_ID=2
cargo run -- key-pairs- Output: Creates a file named
secrets-account.jsoncontaining the private and public keys of all accounts.- Security: Keep
secrets-account.jsonvery secure as it holds sensitive information.
- Security: Keep
- Secret Storage: To store the generated keys securely (e.g., using AWS Secrets Manager), use the appropriate command to create a copy of the
secrets-account.jsonfile.
To store the contents of secrets-account.json in AWS Secrets Manager, execute the following command:
aws secretsmanager create-secret --name secrets-account --description "Secrets for Accounts" --secret-string file://secrets-account.json-
Purpose: Creates access controllers for each of the
payerkeys listed insecrets-account.json. -
Command: Before executing the command, export the following environment variables.
SIGNER_PRIVATE_KEYis for the fee payer account and should be in the formated25519:private_key_here: This payer account is not same as payer account generated in keypairs. Instead this account is one of yours that have xrds to pay fees for access controller creation
export NETWORK_ID=2
export SIGNER_PRIVATE_KEY=ed25519:private_key_hereExecute the following command sequentially after keypair generation, as it takes the secrets-account.json as it looks for that file
cargo run -- create-access-controllers -a <payer-account address>Output: Generates an output file named controller-accounts.json containing the necessary access controller address and the corresponding account address controlled by the access controller.
All access controllers share the same confirmation role.