From 5c58488462865aed4ee8e0f75b16def948897b87 Mon Sep 17 00:00:00 2001 From: iskay Date: Thu, 20 Apr 2023 12:30:52 +0000 Subject: [PATCH] use pocket-deployments Dockerfile --- .../docker-compose-fixturenet-pocket.yml | 7 ++- .../fixturenet-pocket/create-fixturenet.sh | 11 +++- app/data/container-build/cerc-pocket/build.sh | 2 +- app/data/repository-list.txt | 3 +- app/data/stacks/fixturenet-pocket/README.md | 60 ++++--------------- app/data/stacks/fixturenet-pocket/stack.yml | 3 +- 6 files changed, 31 insertions(+), 55 deletions(-) diff --git a/app/data/compose/docker-compose-fixturenet-pocket.yml b/app/data/compose/docker-compose-fixturenet-pocket.yml index 0960a17a..88d34f91 100644 --- a/app/data/compose/docker-compose-fixturenet-pocket.yml +++ b/app/data/compose/docker-compose-fixturenet-pocket.yml @@ -3,12 +3,13 @@ services: pocket: restart: unless-stopped image: cerc/pocket:local - command: ["sh", "/docker-entrypoint-scripts.d/create-fixturenet.sh"] + # command: ["sh", "/docker-entrypoint-scripts.d/create-fixturenet.sh"] + entrypoint: ["sh", "/docker-entrypoint-scripts.d/create-fixturenet.sh"] volumes: # TODO: look at folding these scripts into the container - ../config/fixturenet-pocket/create-fixturenet.sh:/docker-entrypoint-scripts.d/create-fixturenet.sh - - ../config/fixturenet-pocket/chains.json:/root/pocket-configs/chains.json - - ../config/fixturenet-pocket/genesis.json:/root/pocket-configs/genesis.json + - ../config/fixturenet-pocket/chains.json:/home/app/pocket-configs/chains.json + - ../config/fixturenet-pocket/genesis.json:/home/app/pocket-configs/genesis.json ports: - "8081:8081" # pocket relay rpc networks: diff --git a/app/data/config/fixturenet-pocket/create-fixturenet.sh b/app/data/config/fixturenet-pocket/create-fixturenet.sh index 46c26006..4696749f 100644 --- a/app/data/config/fixturenet-pocket/create-fixturenet.sh +++ b/app/data/config/fixturenet-pocket/create-fixturenet.sh @@ -8,8 +8,15 @@ MONIKER="localtestnet" SERVICE_URL="http://127.0.0.1:8081" PASSWORD="mypassword" # wallet password, required by cli -# validate dependencies are installed -command -v jq > /dev/null 2>&1 || { echo >&2 "jq not installed. More info: https://stedolan.github.io/jq/download/"; exit 1; } +# check if jq is installed; install if necessary +# command -v jq > /dev/null 2>&1 || { echo >&2 "jq not installed. More info: https://stedolan.github.io/jq/download/"; exit 1; } +if ! command -v jq > /dev/null 2>&1; then + echo "jq not installed, downloading..." + mkdir -p /home/app/bin + wget -O /home/app/bin/jq https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64 + chmod +x /home/app/bin/jq + export PATH=$PATH:/home/app/bin +fi # remove existing daemon and client rm -rf ~/.pocket* diff --git a/app/data/container-build/cerc-pocket/build.sh b/app/data/container-build/cerc-pocket/build.sh index 431e750c..1f59a8f0 100755 --- a/app/data/container-build/cerc-pocket/build.sh +++ b/app/data/container-build/cerc-pocket/build.sh @@ -1,3 +1,3 @@ #!/usr/bin/env bash # Build cerc/pocket -docker build -t cerc/pocket:local ${CERC_REPO_BASE_DIR}/pocket-core +docker build -t cerc/pocket:local ${CERC_REPO_BASE_DIR}/pocket-core-deployments/docker diff --git a/app/data/repository-list.txt b/app/data/repository-list.txt index 5ce1a998..c6f84949 100644 --- a/app/data/repository-list.txt +++ b/app/data/repository-list.txt @@ -28,4 +28,5 @@ lirewine/sdk telackey/act_runner ethereum-optimism/op-geth ethereum-optimism/optimism -vknowable/pocket-core +pokt-network/pocket-core +pokt-network/pocket-core-deployments diff --git a/app/data/stacks/fixturenet-pocket/README.md b/app/data/stacks/fixturenet-pocket/README.md index ef8d9c2a..b29520c8 100644 --- a/app/data/stacks/fixturenet-pocket/README.md +++ b/app/data/stacks/fixturenet-pocket/README.md @@ -24,7 +24,7 @@ $ laconic-so --stack fixturenet-pocket deploy up ``` It may take up to 10 minutes for the Eth Fixturenet to fully come online and start producing blocks. ## 5. Check status -Eth Fixturenet: +**Eth Fixturenet:** ``` $ laconic-so --stack fixturenet-pocket deploy exec fixturenet-eth-bootnode-lighthouse /scripts/status-internal.sh Waiting for geth to generate DAG.... done @@ -33,61 +33,27 @@ Waiting for beacon altair.... done Waiting for beacon bellatrix pre-merge.... done Waiting for beacon bellatrix merge.... done ``` -Pocket node: +**Pocket node:** ``` -$ laconic-so --stack fixturenet-pocket deploy exec pocket "curl localhost:26657/status" +$ laconic-so --stack fixturenet-pocket deploy exec pocket "pocket query height" +2023/04/20 08:07:46 Initializing Pocket Datadir +2023/04/20 08:07:46 datadir = /home/app/.pocket +http://localhost:8081/v1/query/height { - "jsonrpc": "2.0", - "id": -1, - "result": { - "node_info": { - "protocol_version": { - "p2p": "7", - "block": "10", - "app": "0" - }, - "id": "ac476b11fd3dd3b646465afe8468b1adad249d32", - "listen_addr": "tcp://0.0.0.0:26656", - "network": "pocketlocal-1", - "version": "0.33.7", - "channels": "4020212223303800", - "moniker": "localtestnet", - "other": { - "tx_index": "on", - "rpc_address": "tcp://127.0.0.1:26657" - } - }, - "sync_info": { - "latest_block_hash": "CCB4E94F4958D5142C0DB218841D48FA37EABB411956ADBCBB7ECDCB17E81F66", - "latest_app_hash": "42DFF8EC70FDCB9B00C0305395B2A82F9813680E7C33093A629CBE2EBA7163EE", - "latest_block_height": "108", - "latest_block_time": "2023-04-14T18:59:31.493905099Z", - "earliest_block_hash": "AAA11DF19F18972DAF23A727B3B8BF9014972EC6561103A980014B721F53E275", - "earliest_app_hash": "", - "earliest_block_height": "1", - "earliest_block_time": "2020-07-28T15:00:00Z", - "catching_up": false - }, - "validator_info": [ - { - "address": "AC476B11FD3DD3B646465AFE8468B1ADAD249D32", - "pub_key": { - "type": "tendermint/PubKeyEd25519", - "value": "mnDMAT9TkST340qpJq3PCk1aymrtMw+RevoUsKQOSF4=" - }, - "voting_power": "5000000" - } - ] - } + "height": 4 } ``` +or +``` +$ laconic-so --stack fixturenet-pocket deploy logs pocket +``` ## 6. Send a relay request to Pocket node The Pocket node serves relay requests at `http://localhost:8081/v1/client/sim` -Example request: +**Example request:** ``` $ curl -X POST --data '{"relay_network_id":"0021","payload":{"data":"{\"jsonrpc\": \"2.0\",\"id\": 1,\"method\": \"eth_blockNumber\",\"params\": []}","method":"POST","path":"","headers":{}}}' http://localhost:8081/v1/client/sim ``` -Response: +**Response:** ``` "{\"jsonrpc\":\"2.0\",\"id\":1,\"result\":\"0x6fe\"}\n" ``` diff --git a/app/data/stacks/fixturenet-pocket/stack.yml b/app/data/stacks/fixturenet-pocket/stack.yml index 93d8144e..c5491f9a 100644 --- a/app/data/stacks/fixturenet-pocket/stack.yml +++ b/app/data/stacks/fixturenet-pocket/stack.yml @@ -3,7 +3,8 @@ name: fixturenet-pocket description: "A single node pocket chain that can serve relays from the geth-1 node in eth-fixturenet" repos: - cerc-io/go-ethereum - - vknowable/pocket-core + - pokt-network/pocket-core + - pokt-network/pocket-core-deployments # contains the dockerfile containers: - cerc/go-ethereum - cerc/lighthouse