Skip to content

Commit

Permalink
Merge pull request #18 from PowerLoom/chore/local_collector_port
Browse files Browse the repository at this point in the history
Chore/local collector port
  • Loading branch information
anomit authored Jul 4, 2024
2 parents d72c1cc + 9964aa0 commit bc5a49d
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 7 deletions.
13 changes: 12 additions & 1 deletion build-dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,20 @@ if [ "$POWERLOOM_REPORTING_URL" ]; then
echo "Found POWERLOOM_REPORTING_URL ${POWERLOOM_REPORTING_URL}";
fi

if [ "$LOCAL_COLLECTOR_PORT" ]; then
echo "Found LOCAL_COLLECTOR_PORT ${LOCAL_COLLECTOR_PORT}";
fi

if [ -z "$CORE_API_PORT" ]; then
export CORE_API_PORT=8002;
echo "CORE_API_PORT not found in .env, setting to default value ${CORE_API_PORT}";
else
echo "Found CORE_API_PORT ${CORE_API_PORT}";
fi

# setting up git submodules
git submodule update --init --recursive

git clone https://github.com/PowerLoom/snapshotter-lite-local-collector/ snapshotter-lite-local-collector --single-branch --branch main
cd ./snapshotter-lite-local-collector/ && chmod +x build-docker.sh && ./build-docker.sh;
cd ../;

Expand Down
11 changes: 11 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ if [ "$PROTOCOL_STATE_CONTRACT" ]; then
echo "Found PROTOCOL_STATE_CONTRACT ${PROTOCOL_STATE_CONTRACT}";
fi

if [ "$LOCAL_COLLECTOR_PORT" ]; then
echo "Found LOCAL_COLLECTOR_PORT ${LOCAL_COLLECTOR_PORT}";
fi

if [ "$RELAYER_HOST" ]; then
echo "Found RELAYER_HOST ${RELAYER_HOST}";
fi
Expand All @@ -98,6 +102,13 @@ if [ "$POWERLOOM_REPORTING_URL" ]; then
echo "Found POWERLOOM_REPORTING_URL ${POWERLOOM_REPORTING_URL}";
fi

if [ -z "$CORE_API_PORT" ]; then
export CORE_API_PORT=8002;
echo "CORE_API_PORT not found in .env, setting to default value ${CORE_API_PORT}";
else
echo "Found CORE_API_PORT ${CORE_API_PORT}";
fi

#fetch current git branch name
GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD)

Expand Down
9 changes: 5 additions & 4 deletions docker-compose-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ services:
snapshotter-lite-local-collector:
image: snapshotter-lite-local-collector
expose:
- 50051
- ${LOCAL_COLLECTOR_PORT}
ports:
- 50051:50051
- ${LOCAL_COLLECTOR_PORT}:${LOCAL_COLLECTOR_PORT}
volumes:
- ./shared-volume:/keys
environment:
Expand All @@ -22,6 +22,7 @@ services:
- REDIS_PORT=${REDIS_PORT:-6379}
- SEQUENCER_ID=$SEQUENCER_ID
- RELAYER_RENDEZVOUS_POINT=$RELAYER_RENDEZVOUS_POINT
- LOCAL_COLLECTOR_PORT=$LOCAL_COLLECTOR_PORT
- CLIENT_RENDEZVOUS_POINT=$CLIENT_RENDEZVOUS_POINT
- RELAYER_PRIVATE_KEY=$RELAYER_PRIVATE_KEY
- BLOCK_TIME=$BLOCK_TIME
Expand All @@ -31,9 +32,9 @@ services:
snapshotter-lite-v2:
image: snapshotter-lite-v2
expose:
- 8002
- ${CORE_API_PORT}
ports:
- 8002:8002
- ${CORE_API_PORT}:${CORE_API_PORT}
volumes:
- ./snapshotter:/snapshotter
- ./config:/config
Expand Down
9 changes: 7 additions & 2 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ services:
snapshotter-lite-local-collector:
image: ghcr.io/powerloom/snapshotter-lite-local-collector:${IMAGE_TAG}
expose:
- 50051
- ${LOCAL_COLLECTOR_PORT}
ports:
- 50051:50051
- ${LOCAL_COLLECTOR_PORT}:${LOCAL_COLLECTOR_PORT}
volumes:
- ./shared-volume:/keys
environment:
Expand All @@ -23,13 +23,18 @@ services:
- SEQUENCER_ID=$SEQUENCER_ID
- RELAYER_RENDEZVOUS_POINT=$RELAYER_RENDEZVOUS_POINT
- CLIENT_RENDEZVOUS_POINT=$CLIENT_RENDEZVOUS_POINT
- LOCAL_COLLECTOR_PORT=$LOCAL_COLLECTOR_PORT
- RELAYER_PRIVATE_KEY=$RELAYER_PRIVATE_KEY
- BLOCK_TIME=$BLOCK_TIME
command:
bash -c "sh server_autofill.sh && sh init_processes.sh"

snapshotter-lite-v2:
image: ghcr.io/powerloom/snapshotter-lite-v2:${IMAGE_TAG}
expose:
- ${CORE_API_PORT}
ports:
- ${CORE_API_PORT}:${CORE_API_PORT}
volumes:
- ./logs:/logs
environment:
Expand Down
2 changes: 2 additions & 0 deletions env.example
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ PROST_CHAIN_ID=11165
SEQUENCER_ID=QmdJbNsbHpFseUPKC9vLt4vMsfdxA4dyHPzsAWuzYz3Yxx
RELAYER_RENDEZVOUS_POINT=Relayer_POP_test_simulation_phase_1
CLIENT_RENDEZVOUS_POINT=POP_Client_simulation_test_alpha
LOCAL_COLLECTOR_PORT=50051
CORE_API_PORT=8002
# Optional
IPFS_URL=
IPFS_API_KEY=
Expand Down

0 comments on commit bc5a49d

Please sign in to comment.