在 CGP 上运行全节点
先决条件
$ gcloud auth login --update-adcGCP 设置
入门
验证
使用新版本更新全节点
配置身份和种子对等点
检查日志记录





检查监控


故障排除
全节点“NoAvailablePeers”错误消息
Last updated
$ gcloud auth login --update-adc






Last updated
$ export WORKSPACE=devnet$ mkdir -p ~/$WORKSPACE$ gsutil mb gs://BUCKET_NAME
# for example
$ gsutil mb gs://<project-name>-aptos-terraform-dev$ cd ~/$WORKSPACE
$ touch main.tfterraform {
required_version = "~> 1.2.0"
backend "gcs" {
bucket = "BUCKET_NAME" # bucket name created in step 2
prefix = "state/fullnode"
}
}
module "fullnode" {
# download Terraform module from aptos-labs/aptos-core repo
source = "github.com/aptos-labs/aptos-core.git//terraform/fullnode/gcp?ref=main"
region = "us-central1" # Specify the region
zone = "c" # Specify the zone suffix
project = "gcp-fullnode" # Specify your GCP project name
era = 1 # bump era number to wipe the chain
image_tag = "devnet" # Specify the docker image tag to use, replace to `testnet` or other tag if needed
fullnode_helm_values = {
chain = {
name = "devnet" # replace with `ait3` or other values if connecting to different networks.
}
}
}$ terraform init$ terraform workspace new $WORKSPACE
# This command will list all workspaces
$ terraform workspace list$ terraform apply$ gcloud container clusters get-credentials aptos-$WORKSPACE --zone <region_zone_name> --project <project_name>
# for example:
$ gcloud container clusters get-credentials aptos-devnet --zone us-central1-a --project aptos-fullnode$ kubectl get pods -n aptos$ kubectl get svc -o custom-columns=IP:status.loadBalancer.ingress -n aptos$ curl http://<IP>/v1
# Example command syntax: curl <http://104.198.36.142/v1>$ kubectl port-forward -n aptos <pod-name> 9101:9101
# for example:
$ kubectl port-forward -n aptos devnet0-aptos-fullnode-0 9101:9101$ curl -v <http://0:9101/metrics> 2> /dev/null | grep "aptos_state_sync_version{type=\\"synced\\"}"
$ curl -v <http://0:9101/metrics> 2> /dev/null | grep "aptos_connections{direction=\\"outbound\\""$ terraform get -update$ terraform apply$ terraform get -update$ terraform apply
# if you didn't update the image tag, terraform will show nothing to change, in this case, force helm update
$ terraform apply -var force_helm_update=truemodule "fullnode" {
# download Terraform module from aptos-labs/aptos-core repo
source = "github.com/aptos-labs/aptos-core.git//terraform/fullnode/gcp?ref=main"
region = "us-central1" # Specify the region
zone = "c" # Specify the zone suffix
project = "gcp-fullnode" # Specify your GCP project name
era = 1 # bump era number to wipe the chain
image_tag = "devnet" # Specify the docker image tag to use
fullnode_helm_values = {
chain = {
name = "devnet"
}
# create fullnode from this identity config, so it will always have same peer id and address
fullnode_identity = {
type = "from_config"
key = "B8BD811A91D8E6E0C6DAC991009F189337378760B55F3AD05580235325615C74"
peer_id = "ca3579457555c80fc7bb39964eb298c414fd60f81a2f8eedb0244ec07a26e575"
}
}
}$ terraform applymodule "fullnode" {
# download Terraform module from aptos-labs/aptos-core repo
source = "github.com/aptos-labs/aptos-core.git//terraform/fullnode/gcp?ref=main"
region = "us-central1" # Specify the region
zone = "c" # Specify the zone suffix
project = "gcp-fullnode" # Specify your GCP project name
era = 1 # bump era number to wipe the chain
image_tag = "dev_5b525691" # Specify the docker image tag to use
fullnode_helm_values = {
# add a list of peers as upstream
aptos_chains = {
devnet = {
seeds = {
"bb14af025d226288a3488b4433cf5cb54d6a710365a2d95ac6ffbd9b9198a86a" = {
addresses = ["/dns4/pfn0.node.devnet.aptoslabs.com/tcp/6182/noise-ik/bb14af025d226288a3488b4433cf5cb54d6a710365a2d95ac6ffbd9b9198a86a/handshake/0"]
role = "Upstream"
},
"7fe8523388084607cdf78ff40e3e717652173b436ae1809df4a5fcfc67f8fc61" = {
addresses = ["/dns4/pfn1.node.devnet.aptoslabs.com/tcp/6182/noise-ik/7fe8523388084607cdf78ff40e3e717652173b436ae1809df4a5fcfc67f8fc61/handshake/0"]
role = "Upstream"
},
"f6b135a59591677afc98168791551a0a476222516fdc55869d2b649c614d965b" = {
addresses = ["/dns4/pfn2.node.devnet.aptoslabs.com/tcp/6182/noise-ik/f6b135a59591677afc98168791551a0a476222516fdc55869d2b649c614d965b/handshake/0"]
role = "Upstream"
}
}
}
}
}
}$ terraform apply# Get a list of the pods
$ kubectl get pods -n aptos
# Get logs of the pod
$ kubectl logs <pod-name> -n aptos
# for example:
$ kubectl logs devnet0-aptos-fullnode-0 -n aptosError: Get "<http://localhost/api/v1/namespaces/aptos>": dial tcp 127.0.0.1:80: connect: connection refusedterraform state list
terraform state rm <state>