diff --git a/Dockerfile b/Dockerfile index a47602c..80af555 100644 --- a/Dockerfile +++ b/Dockerfile @@ -32,8 +32,13 @@ RUN curl -o /home/$USERNAME/hl-visor $HL_VISOR_URL \ && gpg --verify /home/$USERNAME/hl-visor.asc /home/$USERNAME/hl-visor \ && chmod +x /home/$USERNAME/hl-visor +# Expose rpc port +EXPOSE 3001 # Expose gossip ports EXPOSE 4000-4010 # Run a non-validating node ENTRYPOINT ["/home/hluser/hl-visor", "run-non-validator", "--replica-cmds-style", "recent-actions"] + +# Optional: Run a non-validating node with EVM RPC enabled (if using, comment out the above line and uncomment this one) +# ENTRYPOINT ["/home/hluser/hl-visor", "run-non-validator", "--serve-eth-rpc", "--replica-cmds-style", "recent-actions"] \ No newline at end of file diff --git a/README.md b/README.md index e89ba1d..77fb503 100644 --- a/README.md +++ b/README.md @@ -138,6 +138,8 @@ Enable the EVM RPC by adding the `--serve-eth-rpc` flag: ~/hl-visor run-non-validator --serve-eth-rpc ``` +Ensure that port 3001 is open in your local firewall if you are planning on accessing the EVM RPC from outside the node. + Once running, you can send RPC requests. For example, to retrieve the latest block: ```bash curl -X POST --header 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["latest",false],"id":1}' http://localhost:3001/evm diff --git a/docker-compose.yml b/docker-compose.yml index 8ab3288..d1d37c3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,6 +5,7 @@ services: restart: unless-stopped build: . ports: + - "3001:3001" - "4000-4010:4000-4010" volumes: - hl-data:/home/hluser/hl/data