在 Azure 上运行
export WORKSPACE=testnetmkdir -p ~/$WORKSPACEexport USERNAME=alice
az group create -l <azure region> -n aptos-$WORKSPACE az storage account create -n <storage account name> -g aptos-$WORKSPACE -l <azure region> --sku Standard_LRS az storage container create -n <container name> --account-name <storage account name> --resource-group aptos-$WORKSPACEcd ~/$WORKSPACE vi main.tfterraform { required_version = "~> 1.2.0" backend "azurerm" { resource_group_name = <resource group name> storage_account_name = <storage account name> container_name = <container name> key = "state/validator" } } module "aptos-node" { # download Terraform module from aptos-labs/aptos-core repo source = "github.com/aptos-labs/aptos-core.git//terraform/aptos-node/azure?ref=testnet" region = <azure region> # Specify the region era = 1 # bump era number to wipe the chain chain_id = 43 image_tag = "testnet" # Specify the docker image tag to use validator_name = "<Name of Your Validator>" }terraform initterraform workspace new $WORKSPACE # This command will list all workspaces terraform workspace listterraform applyexport VALIDATOR_ADDRESS="$(kubectl get svc ${WORKSPACE}-aptos-node-0-validator-lb --output jsonpath='{.status.loadBalancer.ingress[0].hostname}')" export FULLNODE_ADDRESS="$(kubectl get svc ${WORKSPACE}-aptos-node-0-fullnode-lb --output jsonpath='{.status.loadBalancer.ingress[0].hostname}')"aptos genesis generate-keys --output-dir ~/$WORKSPACE/keysaptos genesis set-validator-configuration \\ --local-repository-dir ~/$WORKSPACE \\ --username $USERNAME \\ --owner-public-identity-file ~/$WORKSPACE/keys/public-keys.yaml \\ --validator-host $VALIDATOR_ADDRESS:6180 \\ --full-node-host $FULLNODE_ADDRESS:6182 \\ --stake-amount 100000000000000aptos genesis generate-layout-template --output-file ~/$WORKSPACE/layout.yamlroot_key: "D04470F43AB6AEAA4EB616B72128881EEF77346F2075FFE68E14BA7DEBD8095E" users: ["<username you specified from previous step>"] chain_id: 43 allow_new_validators: false epoch_duration_secs: 7200 is_test: true min_stake: 100000000000000 min_voting_threshold: 100000000000000 max_stake: 100000000000000000 recurring_lockup_duration_secs: 86400 required_proposer_stake: 100000000000000 rewards_apy_percentage: 10 voting_duration_secs: 43200 voting_power_increase_limit: 20wget <https://github.com/aptos-labs/aptos-core/releases/download/aptos-framework-v0.3.0/framework.mrb> -P ~/$WORKSPACEaptos genesis generate-genesis --local-repository-dir ~/$WORKSPACE --output-dir ~/$WORKSPACEkubectl create secret generic ${WORKSPACE}-aptos-node-0-genesis-e1 \\ --from-file=genesis.blob=genesis.blob \\ --from-file=waypoint.txt=waypoint.txt \\ --from-file=validator-identity.yaml=keys/validator-identity.yaml \\ --from-file=validator-full-node-identity.yaml=keys/validator-full-node-identity.yamlkubectl get pods NAME READY STATUS RESTARTS AGE node1-aptos-node-0-fullnode-e9-0 1/1 Running 0 4h31m node1-aptos-node-0-haproxy-7cc4c5f74c-l4l6n 1/1 Running 0 4h40m node1-aptos-node-0-validator-0 1/1 Running 0 4h30m
Last updated