diff --git a/packages/devnet/Dockerfile b/packages/devnet/Dockerfile index 8e276d605b..56311327ee 100644 --- a/packages/devnet/Dockerfile +++ b/packages/devnet/Dockerfile @@ -20,6 +20,7 @@ COPY run.sh . RUN /geth --datadir node0/ init genesis.json EXPOSE 8501 +EXPOSE 8546 EXPOSE 30310 ENTRYPOINT ./run.sh diff --git a/packages/devnet/README.md b/packages/devnet/README.md index f0b165cbd4..44a3b9c8e9 100644 --- a/packages/devnet/README.md +++ b/packages/devnet/README.md @@ -18,16 +18,19 @@ docker build -t 0x-devnet . To start the network, run: ``` -docker run -it --rm -p 8501:8501 0x-devnet +docker run -it --rm -p 8501:8501 -p 8546:8546 0x-devnet ``` Depending on your OS and how you installed docker, you may need to prefix any docker commands with `sudo`. -The Docker container exposes the JSON RPC API at port 8501, and this is the +The Docker container exposes the HTTP JSON RPC API at port 8501, and this is the primary way you are expected to interact with the devnet. The following endpoints are supported: `personal,db,eth,net,web3,txpool,miner,debug`. +It also exposes the WS JSON RPC API at port 8546. The following +endpoints are supported: `personal,db,eth,net,web3,txpool,miner,debug`. + You can stop the network with `docker stop` and it will automatically clean up after itself. (`docker stop` typically requires you to use `docker ps` to find the name of the currently running container). diff --git a/packages/devnet/run.sh b/packages/devnet/run.sh index 6000813f00..3d4a2e8a60 100755 --- a/packages/devnet/run.sh +++ b/packages/devnet/run.sh @@ -17,6 +17,11 @@ mkdir -p /var/log --rpcport 8501 \ --rpcvhosts '*' \ --rpcapi 'personal,db,eth,net,web3,txpool,miner,debug' \ + --ws \ + --wsaddr 0.0.0.0 \ + --wsport 8546 \ + --wsorigins '*' \ + --wsapi 'personal,db,eth,net,web3,txpool,miner,debug' \ --networkid 50 \ --gasprice '2000000000' \ --targetgaslimit '0x4c4b400000' \