diff --git a/testnet_v1_1/README.md b/testnet_v1_1/README.md index 35b4841..b0e395f 100644 --- a/testnet_v1_1/README.md +++ b/testnet_v1_1/README.md @@ -31,7 +31,8 @@ * [Godwoken readonly node config](./gw-testnet_v1-config-readonly.toml) ```sh cd testnet_v1_1 -# Note: It is better to run your own CKB testnet node first. +# Note: To achieve higher sync speed, please run your own ckb-testnet-node and ckb-testnet-indexer, +# and update [rpc_client] in gw-testnet_v1-config-readonly.toml. # see: https://docs.nervos.org/docs/basics/guides/run-ckb-with-docker#run-a-ckb-testnet-node docker-compose up -d gw-readonly diff --git a/testnet_v1_1/docker-compose.yml b/testnet_v1_1/docker-compose.yml index a7031a3..254ed91 100644 --- a/testnet_v1_1/docker-compose.yml +++ b/testnet_v1_1/docker-compose.yml @@ -2,22 +2,13 @@ version: '3.9' services: - ckb-testnet-indexer: - container_name: ckb-testnet-indexer-v0.3.2-202205 - image: nervos/ckb-indexer:0.3.2 - volumes: - - ../chain-data/ckb-indexer-data:/ckb-testnet-indexer-data - expose: [8116] - environment: - - RUST_LOG=info - command: -s /ckb-testnet-indexer-data -c http://3.83.107.217:8114 -l 0.0.0.0:8116 - # TODO: healthcheck: - + # Note: To achieve higher sync speed, please run your own ckb-testnet-node and ckb-testnet-indexer, + # and update [rpc_client] in gw-testnet_v1-config-readonly.toml. + # see: https://docs.nervos.org/docs/basics/guides/run-ckb-with-docker#run-a-ckb-testnet-node gw-readonly: - container_name: gw-testnet_v1.1-readonly - image: ghcr.io/nervosnetwork/godwoken-prebuilds:1.2.2-rc1 + container_name: gw-testnet_v1-readonly + image: ghcr.io/nervosnetwork/godwoken-prebuilds:1.3.0-rc2 expose: [8119, 8219] - depends_on: [ckb-testnet-indexer] healthcheck: test: /healthcheck.sh start_period: 10s @@ -28,7 +19,7 @@ services: - ./chain-data/readonly/:/mnt/ - ./gw-testnet_v1-config-readonly.toml:/deploy/config.toml - ./db.toml:/deploy/db.toml:ro - - ./block_producer.key:/deploy/block_producer.key:ro + - ./zero.key:/deploy/block_producer.key:ro - ./healthcheck.sh:/healthcheck.sh:ro environment: # other log envs: ,gw_generator=debug,gw_chain=debug @@ -43,9 +34,9 @@ services: image: postgres:alpine expose: [5432] environment: - POSTGRES_USER: user - POSTGRES_DB: lumos - POSTGRES_PASSWORD: password + POSTGRES_DB: web3-indexer-db + POSTGRES_USER: your_db_user_name + POSTGRES_PASSWORD: your_password volumes: - ./chain-data/postgresql/data:/var/lib/postgresql/data @@ -56,7 +47,7 @@ services: - ./chain-data/redis-data:/data web3: - image: nervos/godwoken-web3-prebuilds:v1.1.2-rc1 + image: nervos/godwoken-web3-prebuilds:v1.3.0-rc1 healthcheck: test: curl http://127.0.0.1:8024 || exit 1 volumes: @@ -73,7 +64,7 @@ services: condition: service_healthy web3-indexer: - image: nervos/godwoken-web3-indexer-prebuilds:v1.1.3-rc1 + image: nervos/godwoken-web3-indexer-prebuilds:v1.3.0-rc1 volumes: - ./web3-indexer-config.toml:/var/lib/web3-indexer/indexer-config.toml working_dir: /var/lib/web3-indexer diff --git a/testnet_v1_1/gw-testnet_v1-config-readonly.toml b/testnet_v1_1/gw-testnet_v1-config-readonly.toml index 3f73082..689771e 100644 --- a/testnet_v1_1/gw-testnet_v1-config-readonly.toml +++ b/testnet_v1_1/gw-testnet_v1-config-readonly.toml @@ -1,19 +1,11 @@ node_mode = 'readonly' -# It is better to run your own CKB testnet node +# To achieve higher sync speed, please run your own ckb-testnet-node and ckb-testnet-indexer # see: https://docs.nervos.org/docs/basics/guides/run-ckb-with-docker#run-a-ckb-testnet-node [rpc_client] # Public Nodes (rate_limit: 20 req/s) -# ckb_url = 'https://testnet.ckbapp.dev/rpc' -# indexer_url = 'https://testnet.ckbapp.dev/indexer' - -# Local Nodes -indexer_url = 'http://ckb-testnet-indexer:8116' -# ckb_url = 'http://172.17.0.1:38114' - -# Backup Nodes -ckb_url = 'http://3.83.107.217:8114' -# indexer_url = 'http://3.83.107.217:8116' +ckb_url = 'https://testnet.ckbapp.dev/rpc' +indexer_url = 'https://testnet.ckbapp.dev/indexer' [rpc_server] listen = '0.0.0.0:8119' @@ -51,6 +43,14 @@ generator_path = '/scripts/godwoken-polyjuice-v1.2.0/generator' validator_script_type_hash = '0x1629b04b49ded9e5747481f985b11cba6cdd4ffc167971a585e96729455ca736' backend_type = 'Polyjuice' +[[backend_switches]] +switch_height = 180000 +[[backend_switches.backends]] +validator_path = '/scripts/godwoken-polyjuice-v1.3.0/validator' +generator_path = '/scripts/godwoken-polyjuice-v1.3.0/generator' +validator_script_type_hash = '0x1629b04b49ded9e5747481f985b11cba6cdd4ffc167971a585e96729455ca736' +backend_type = 'Polyjuice' + [genesis] timestamp = 1651979802446 rollup_type_hash = '0x702359ea7f073558921eb50d8c1c77e92f760c8f8656bde4995f26b8963e2dd8' diff --git a/testnet_v1_1/healthcheck.sh b/testnet_v1_1/healthcheck.sh index 4dd45c2..f8061d2 100755 --- a/testnet_v1_1/healthcheck.sh +++ b/testnet_v1_1/healthcheck.sh @@ -1,28 +1,5 @@ #!/usr/bin/env bash -function get_ckb_indexer() { - local ckb_indexer_url=$1 - echo '{ - "id": 2, - "jsonrpc": "2.0", - "method": "get_tip" - }' \ - | tr -d '\n' \ - | curl -sS -H 'content-type: application/json' -d @- \ - $ckb_indexer_url \ - | awk 'BEGIN { FS=":"; RS="," }; { if ($1 == "\"block_number\"") {print $2} }' \ - | tr -d '}' -} - -function check_ckb_indexer_tip() { - local local_indexer_tip="$(get_ckb_indexer http://ckb-testnet-indexer:8116)" - local remote_indexer_tip="$(get_ckb_indexer https://testnet.ckbapp.dev/indexer)" - test $local_indexer_tip = $remote_indexer_tip -} - -# Check the ckb-indexer TIP of testnet -check_ckb_indexer_tip - # Query whether a Godwoken readonly node is ready to serve # see: https://github.com/nervosnetwork/godwoken/pull/644 echo '{ diff --git a/testnet_v1_1/web3-indexer-config.toml b/testnet_v1_1/web3-indexer-config.toml index 91a25f6..5ea11ec 100644 --- a/testnet_v1_1/web3-indexer-config.toml +++ b/testnet_v1_1/web3-indexer-config.toml @@ -1,13 +1,5 @@ # Web3 Indexer Configs - -chain_id=71401 - -l2_sudt_type_script_hash="0xb6176a6170ea33f8468d61f934c45c57d29cdc775bcd3ecaaec183f04b9f33d9" -polyjuice_type_script_hash="0x1629b04b49ded9e5747481f985b11cba6cdd4ffc167971a585e96729455ca736" -rollup_type_hash="0x702359ea7f073558921eb50d8c1c77e92f760c8f8656bde4995f26b8963e2dd8" -eth_account_lock_hash="0x07521d0aa8e66ef441ebc31204d86bb23fc83e9edc58c19dbb1b0ebe64336ec0" +# see: https://github.com/nervosnetwork/godwoken-web3#start-indexer godwoken_rpc_url="http://gw-readonly:8119" -ws_rpc_url="ws://gw-readonly:8219" - -pg_url="postgres://user:password@postgres:5432/lumos" +pg_url="postgres://your_db_user_name:your_password@postgres:5432/web3-indexer-db" diff --git a/testnet_v1_1/web3.env b/testnet_v1_1/web3.env index 0bfe5ca..7912bf8 100644 --- a/testnet_v1_1/web3.env +++ b/testnet_v1_1/web3.env @@ -1,11 +1,9 @@ -# see: https://github.com/nervosnetwork/godwoken-web3/tree/compatibility-breaking-changes#config-database +# see: https://github.com/nervosnetwork/godwoken-web3#config-database -DATABASE_URL=postgres://user:password@postgres:5432/lumos +DATABASE_URL=postgres://your_db_user_name:your_password@postgres:5432/web3-indexer-db REDIS_URL=redis://redis:6379 GODWOKEN_JSON_RPC=http://gw-readonly:8119 -# TODO: add Godwoken readonly node -# GODWOKEN_READONLY_JSON_RPC= # eth_estimateGas will add this number to result, optional, default to 0 -EXTRA_ESTIMATE_GAS=20000 +EXTRA_ESTIMATE_GAS=30000 diff --git a/testnet_v1_1/block_producer.key b/testnet_v1_1/zero.key similarity index 100% rename from testnet_v1_1/block_producer.key rename to testnet_v1_1/zero.key