use pocket-deployments Dockerfile

This commit is contained in:
iskay 2023-04-20 12:30:52 +00:00
parent 1304f6f8a2
commit 5c58488462
6 changed files with 31 additions and 55 deletions

View File

@ -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:

View File

@ -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*

View File

@ -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

View File

@ -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

View File

@ -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"
```

View File

@ -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