Skip to content

Commit a444326

Browse files
authored
Merge pull request #98 from nevermined-io/feat/geth-dev
Geth dev mode support
2 parents 7da2351 + 928e456 commit a444326

File tree

5 files changed

+67
-2
lines changed

5 files changed

+67
-2
lines changed

.github/workflows/test.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,4 @@ jobs:
3737
3838
# wait for the compute api to be online.
3939
# the compute api is the last service to come online
40-
./scripts/wait_for_compute_api.sh
40+
./scripts/wait-subgraphs.sh

compose-files/nodes/geth_localnet.yml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
version: '3'
2+
services:
3+
keeper-node:
4+
container_name: nevermined-keeper-node
5+
image: neverminedio/geth-localnet::${KEEPER_VERSION}
6+
user: root
7+
command:
8+
--dev
9+
--http
10+
--datadir /chain-data
11+
--http.corsdomain "*"
12+
--http.vhosts "*"
13+
--http.addr 0.0.0.0
14+
volumes:
15+
- ${KEEPER_ARTIFACTS_FOLDER}:/nevermined-contracts/artifacts/
16+
ports:
17+
- 8545:8545
18+
networks:
19+
backend:
20+
ipv4_address: 172.15.0.12

compose-files/nodes/polygon_localnet.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ version: '3'
22
services:
33
keeper-node:
44
container_name: nevermined-keeper-node
5-
image: neverminedio/polygon-localnet:latest
5+
image: neverminedio/polygon-localnet:${KEEPER_VERSION}
66
user: root
77
command:
88
--dev

scripts/wait-subgraphs.sh

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#!/bin/bash
2+
3+
RETRY_COUNT=0
4+
HTTP_CODE=0
5+
GRAPH_NODE_URL=${GRAPH_NODE_URL:-http://localhost:9000}
6+
SUBGRAPH=WhitelistingCondition
7+
SUBGRAPH_URL=$GRAPH_NODE_URL/subgraphs/name/neverminedio/$SUBGRAPH
8+
SUBGRAPH_CAN_QUERY=false
9+
10+
COMMAND=(curl -g -X POST \
11+
-H "Content-Type:application/json" \
12+
-d '{"query":"query{ownershipTransferreds{id}}"}')
13+
14+
until [ $HTTP_CODE -eq 200 ] || [ $RETRY_COUNT -eq 90 ]; do
15+
HTTP_CODE=$(${COMMAND[@]} -s -o /dev/null -w ''%{http_code}'' $SUBGRAPH_URL)
16+
if [ $HTTP_CODE -eq 200 ]; then
17+
break
18+
fi
19+
printf "Waiting for the subgraph ($SUBGRAPH) to be running at $SUBGRAPH_URL\n"
20+
sleep 10
21+
let RETRY_COUNT=RETRY_COUNT+1
22+
done
23+
24+
until [ "$SUBGRAPH_CAN_QUERY" = true ] || [ $RETRY_COUNT -eq 90 ]; do
25+
SUBGRAPH_CAN_QUERY=$(${COMMAND[@]} $SUBGRAPH_URL | jq 'has("data")')
26+
if [ "$SUBGRAPH_CAN_QUERY" = true ]; then
27+
break
28+
fi
29+
printf "Waiting for the subgraph ($SUBGRAPH) to be running at $SUBGRAPH_URL\n"
30+
sleep 10
31+
let RETRY_COUNT=RETRY_COUNT+1
32+
done
33+
34+
if [ "$SUBGRAPH_CAN_QUERY" != true ]; then
35+
echo "Waited for more than 15 minutes, but the graph node api is still not running"
36+
exit 1
37+
fi

start_nevermined.sh

+8
Original file line numberDiff line numberDiff line change
@@ -590,6 +590,14 @@ while :; do
590590
COMPOSE_FILES="${COMPOSE_FILES/ -f ${COMPOSE_DIR}\/nevermined_contracts.yml/}"
591591
printf $COLOR_Y'Starting with local Polygon node...\n\n'$COLOR_RESET
592592
;;
593+
# spins up geth dev mode
594+
--geth)
595+
export KEEPER_NETWORK_NAME="geth-localnet"
596+
export KEEPER_DEPLOY_CONTRACTS="false"
597+
export NODE_COMPOSE_FILE="${COMPOSE_DIR}/nodes/geth_localnet.yml"
598+
COMPOSE_FILES="${COMPOSE_FILES/ -f ${COMPOSE_DIR}\/nevermined_contracts.yml/}"
599+
printf $COLOR_Y'Starting with local Geth node...\n\n'$COLOR_RESET
600+
;;
593601
# spins up spree
594602
--local-spree-node)
595603
export KEEPER_NETWORK_NAME="spree"

0 commit comments

Comments
 (0)