expose ws port for testnet (#428)

* expose ws port

* include jsonrpc and ws docs

* Apply suggestions from code review

Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
This commit is contained in:
Daniel Choi 2020-08-04 14:46:41 -07:00 committed by GitHub
parent 50a632580d
commit 18a710b552
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 26 additions and 1 deletions

View File

@ -8,6 +8,7 @@ services:
- "26656-26657:26656-26657" - "26656-26657:26656-26657"
- "1317:1317" - "1317:1317"
- "8545:8545" - "8545:8545"
- "8546:8546"
environment: environment:
- ID=0 - ID=0
- LOG=${LOG:-emintd.log} - LOG=${LOG:-emintd.log}
@ -25,6 +26,7 @@ services:
- "26659-26660:26656-26657" - "26659-26660:26656-26657"
- "1318:1317" - "1318:1317"
- "8546:8545" - "8546:8545"
- "8546:8546"
environment: environment:
- ID=1 - ID=1
- LOG=${LOG:-emintd.log} - LOG=${LOG:-emintd.log}
@ -45,6 +47,7 @@ services:
- "26661-26662:26656-26657" - "26661-26662:26656-26657"
- "1319:1317" - "1319:1317"
- "8547:8545" - "8547:8545"
- "8546:8546"
volumes: volumes:
- ./build:/ethermint:Z - ./build:/ethermint:Z
networks: networks:
@ -62,6 +65,7 @@ services:
- "26663-26664:26656-26657" - "26663-26664:26656-26657"
- "1320:1317" - "1320:1317"
- "8548:8545" - "8548:8545"
- "8546:8546"
volumes: volumes:
- ./build:/ethermint:Z - ./build:/ethermint:Z
networks: networks:

View File

@ -233,6 +233,27 @@ example:
docker logs -f emintdnode0 docker logs -f emintdnode0
``` ```
### Interact With the Testnet
#### Ethereum JSON RPC & Websocket Ports
To interact with the testnet via WebSockets or RPC/API, you will send your request to the corresponding ports:
| Eth JSON-RPC | Eth WS |
|--------------|--------|
| `8545` | `8546` |
You can send a curl command such as:
```bash
curl -X POST --data '{"jsonrpc":"2.0","method":"eth_accounts","params":[],"id":1}' -H "Content-Type: application/json" 192.162.10.1:8545
```
::: tip
The IP address will be the public IP of the docker container.
:::
Additional instructions on how to interact with the WebSocket can be found on the [events documentation](./events.md#ethereum-websocket).
### Keys & Accounts ### Keys & Accounts
To interact with `emintcli` and start querying state or creating txs, you use the To interact with `emintcli` and start querying state or creating txs, you use the

View File

@ -26,7 +26,7 @@ COPY --from=build-env /go/src/github.com/ChainSafe/ethermint/build/emintd /usr/b
COPY --from=build-env /go/src/github.com/ChainSafe/ethermint/build/emintcli /usr/bin/emintcli COPY --from=build-env /go/src/github.com/ChainSafe/ethermint/build/emintcli /usr/bin/emintcli
COPY --from=build-env /go/src/github.com/ChainSafe/ethermint/scripts/start.sh / COPY --from=build-env /go/src/github.com/ChainSafe/ethermint/scripts/start.sh /
EXPOSE 26656 26657 1317 8545 EXPOSE 26656 26657 1317 8545 8546
# Run emintd by default, omit entrypoint to ease using container with emintcli # Run emintd by default, omit entrypoint to ease using container with emintcli
ENTRYPOINT ["/bin/bash", "-c"] ENTRYPOINT ["/bin/bash", "-c"]