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

View File

@ -233,6 +233,27 @@ example:
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
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/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
ENTRYPOINT ["/bin/bash", "-c"]