diff --git a/.gitignore b/.gitignore index b019658..506c20b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ *.log* -.env +.env* .python-version __pycache__/ .idea/ diff --git a/README.md b/README.md index b8d8b40..fba63b7 100755 --- a/README.md +++ b/README.md @@ -14,9 +14,6 @@ - [Using Docker](#using-docker) - [Without Docker](#without-docker) - [Monitoring and Debugging](#monitoring-and-debugging) - - [Simulation run logs](#simulation-run-logs) - - [Verifying success of simulation run](#verifying-success-of-simulation-run) - - [Monitoring](#monitoring) - [Debugging](#debugging) - [For Contributors](#for-contributors) - [Case Studies](#case-studies) @@ -254,36 +251,6 @@ If you want to run the Snapshotter Lite Node without Docker, you need to make su ## Monitoring and Debugging -### Simulation run logs - -While running this node for the first time, it performs a couple of dummy submissions to simulate its connections to the relayer and sequencer network. If you notice logs similar to the lines below in the node run logs, your node's simulation run was successful. - -``` -snapshotter-lite-new-proto-snapshotter-lite-v2-1 | 1|snapshotter-lite | June 6, 2024 > 17:30:49 | INFO | ✅ Event processed successfully: request { -snapshotter-lite-new-proto-snapshotter-lite-v2-1 | 1|snapshotter-lite | slotId: 4036 -snapshotter-lite-new-proto-snapshotter-lite-v2-1 | 1|snapshotter-lite | deadline: 7747061 -snapshotter-lite-new-proto-snapshotter-lite-v2-1 | 1|snapshotter-lite | snapshotCid: "bafkreia4m4icjc4q46rv2ncszplaibeiytce2iqa5qu4dr3wj7w3vwljai" -``` - -### Verifying success of simulation run - -To verify the success of the same, make use of the utility script bundled within here by running the following on a MacOS/Linux command line terminal. - - ->This will work only after you have set up the node correctly with the right `.env` variables and run it successfully. - - -```bash -./check_simulation.sh - -{"success":true,"submissionCount":2,"lastPing":1717672628,"message":"","nodeVersion":"v0.2.1"} -``` - -If you observe `submissionCount` and `lastPing` in the above response to be greater than 0, your node's simulation run was successful. - -### Monitoring -**TODO** - Enter Node dashboard screenshots and information here - ### Debugging Usually the easiest way to fix node related issues is to restart the node. If you're facing issues with the node, you can try going through the logs present in the `logs` directory. If you're unable to find the issue, you can reach out to us on [Discord](https://powerloom.io/discord) and we will be happy to help you out. diff --git a/_override_defaults.sh b/_override_defaults.sh new file mode 100755 index 0000000..0c6982d --- /dev/null +++ b/_override_defaults.sh @@ -0,0 +1,11 @@ +source .env + +if [ -z "$OVERRIDE_DEFAULTS" ]; then + echo "reset to default values..."; + export PROST_RPC_URL="https://rpc-prost1h-proxy.powerloom.io" + export PROTOCOL_STATE_CONTRACT="0x10c5E2ee14006B3860d4FdF6B173A30553ea6333" + export PROST_CHAIN_ID="11165" + export SEQUENCER_ID="QmdJbNsbHpFseUPKC9vLt4vMsfdxA4dyHPzsAWuzYz3Yxx" + export RELAYER_RENDEZVOUS_POINT="Relayer_POP_test_simulation_phase_1" + export CLIENT_RENDEZVOUS_POINT="POP_Client_simulation_test_alpha" +fi diff --git a/build-dev.sh b/build-dev.sh index 9c9c72f..d801696 100755 --- a/build-dev.sh +++ b/build-dev.sh @@ -36,6 +36,8 @@ if [ ! -f .env ]; then fi +./_override_defaults.sh + source .env echo "testing before build..."; @@ -91,7 +93,10 @@ if [ "$POWERLOOM_REPORTING_URL" ]; then echo "Found POWERLOOM_REPORTING_URL ${POWERLOOM_REPORTING_URL}"; fi -if [ "$LOCAL_COLLECTOR_PORT" ]; then +if [ -z "$LOCAL_COLLECTOR_PORT" ]; then + export LOCAL_COLLECTOR_PORT=50051; + echo "LOCAL_COLLECTOR_PORT not found in .env, setting to default value ${LOCAL_COLLECTOR_PORT}"; +else echo "Found LOCAL_COLLECTOR_PORT ${LOCAL_COLLECTOR_PORT}"; fi @@ -104,7 +109,15 @@ 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 +# check if snapshotter-lite-local-collector exists +if [ -d "./snapshotter-lite-local-collector" ]; then + echo "snapshotter-lite-local-collector exists, do you want to delete and clone a fresh one? (y/n)"; + read response; + if [ "$response" == "y" ]; then + rm -rf ./snapshotter-lite-local-collector + git clone https://github.com/PowerLoom/snapshotter-lite-local-collector/ snapshotter-lite-local-collector --single-branch --branch main + fi +fi cd ./snapshotter-lite-local-collector/ && chmod +x build-docker.sh && ./build-docker.sh; cd ../; diff --git a/build.sh b/build.sh index e0dc839..0b64edb 100755 --- a/build.sh +++ b/build.sh @@ -36,14 +36,9 @@ if [ ! -f .env ]; then fi -source .env +./_override_defaults.sh -if [ -z "$OVERRIDE_DEFAULTS" ]; then - echo "reset to default values..."; - export PROST_RPC_URL="https://rpc-prost1h-proxy.powerloom.io" - export PROTOCOL_STATE_CONTRACT="0x1996e00549a7b664E927F872342cE66D2545869c" - export PROST_CHAIN_ID="11165" -fi +source .env echo "testing before build..."; @@ -82,9 +77,6 @@ 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}"; @@ -109,6 +101,13 @@ else echo "Found CORE_API_PORT ${CORE_API_PORT}"; fi +if [ -z "$LOCAL_COLLECTOR_PORT" ]; then + export LOCAL_COLLECTOR_PORT=50051; + echo "LOCAL_COLLECTOR_PORT not found in .env, setting to default value ${LOCAL_COLLECTOR_PORT}"; +else + echo "Found LOCAL_COLLECTOR_PORT ${LOCAL_COLLECTOR_PORT}"; +fi + #fetch current git branch name GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD) @@ -116,10 +115,11 @@ echo "Current branch is ${GIT_BRANCH}"; #if on main git branch, set image_tag to latest or use the branch name -if [ "$GIT_BRANCH" = "main" ]; then - export IMAGE_TAG="latest"; + +if [ "$GIT_BRANCH" = "dockerify" ]; then + export IMAGE_TAG="dockerify" else - export IMAGE_TAG="${GIT_BRANCH}"; + export IMAGE_TAG="latest" fi echo "Building image with tag ${IMAGE_TAG}"; diff --git a/config b/config index 994904d..ce7c3ff 160000 --- a/config +++ b/config @@ -1 +1 @@ -Subproject commit 994904d54d3d35a4db59ff9da087f466d087006e +Subproject commit ce7c3ff4020378157d4240fea6e8bb55e19d9274 diff --git a/docker-compose-dev.yaml b/docker-compose-dev.yaml index d051c50..ccfa769 100755 --- a/docker-compose-dev.yaml +++ b/docker-compose-dev.yaml @@ -27,7 +27,7 @@ services: - RELAYER_PRIVATE_KEY=$RELAYER_PRIVATE_KEY - BLOCK_TIME=$BLOCK_TIME command: - bash -c "sh server_autofill.sh && sh init_processes.sh" + bash -c "bash server_autofill.sh && bash init_processes.sh" snapshotter-lite-v2: image: snapshotter-lite-v2 @@ -61,7 +61,7 @@ services: retries: 3 start_period: 30s command: - bash -c "sh snapshotter_autofill.sh && sh init_docker.sh" + bash -c "bash snapshotter_autofill.sh && bash init_docker.sh" ipfs: image: ipfs/kubo:release profiles: ["ipfs"] diff --git a/docker-compose.yaml b/docker-compose.yaml index bd22f49..7b9fdc8 100755 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -27,7 +27,7 @@ services: - RELAYER_PRIVATE_KEY=$RELAYER_PRIVATE_KEY - BLOCK_TIME=$BLOCK_TIME command: - bash -c "sh server_autofill.sh && sh init_processes.sh" + bash -c "bash server_autofill.sh && bash init_processes.sh" snapshotter-lite-v2: image: ghcr.io/powerloom/snapshotter-lite-v2:${IMAGE_TAG} @@ -59,7 +59,7 @@ services: retries: 3 start_period: 30s command: - bash -c "sh snapshotter_autofill.sh && sh init_docker.sh" + bash -c "bash snapshotter_autofill.sh && bash init_docker.sh" ipfs: image: ipfs/kubo:release profiles: ["ipfs"] diff --git a/env.example b/env.example index d844447..572acd5 100755 --- a/env.example +++ b/env.example @@ -4,7 +4,7 @@ SIGNER_ACCOUNT_ADDRESS= SIGNER_ACCOUNT_PRIVATE_KEY= SLOT_ID= PROST_RPC_URL=https://rpc-prost1h-proxy.powerloom.io -PROTOCOL_STATE_CONTRACT=0x1996e00549a7b664E927F872342cE66D2545869c +PROTOCOL_STATE_CONTRACT=0x10c5E2ee14006B3860d4FdF6B173A30553ea6333 RELAYER_HOST=https://prost1h-relayer-public.powerloom.io NAMESPACE=UNISWAPV2 POWERLOOM_REPORTING_URL=https://nms-testnet-reporting.powerloom.io diff --git a/snapshotter_autofill.sh b/snapshotter_autofill.sh index cc093e4..4a607eb 100755 --- a/snapshotter_autofill.sh +++ b/snapshotter_autofill.sh @@ -1,14 +1,5 @@ #!/bin/bash -source .env - -if [ -z "$OVERRIDE_DEFAULTS" ]; then - echo "reset to default values..."; - export PROST_RPC_URL="https://rpc-prost1h-proxy.powerloom.io" - export PROTOCOL_STATE_CONTRACT="0x1996e00549a7b664E927F872342cE66D2545869c" - export PROST_CHAIN_ID="11165" -fi - echo 'populating setting from environment values...'; if [ -z "$SOURCE_RPC_URL" ]; then