Deployment guide

Version

0x Mesh Deployment Guide

Welcome to the 0x Mesh Deployment Guide! This guide will walk you through how to configure and deploy your own 0x Mesh node.

Supported Chains

Running Mesh

If you would like to participate in the Mesh Beta, check out this guide to deploying a telemetry-enabled Mesh node.

Make sure you have Docker installed. Then run:

docker run \
--restart unless-stopped \
-p 60557:60557 \
-p 60558:60558 \
-p 60559:60559 \
-e ETHEREUM_CHAIN_ID="1" \
-e ETHEREUM_RPC_URL="{your_ethereum_rpc_url}" \
-e VERBOSITY=5 \
-v {local_path_on_host_machine}/0x_mesh:/usr/mesh/0x_mesh \
0xorg/mesh:latest

You should replace {your_ethereum_rpc_url} with the RPC endpoint for an Ethereum node and {local_path_on_host_machine} with a directory on your host machine where all Mesh-related data will be stored.

Notes:

  • Ports 60557, 60558, and 60559 are the default ports used for the JSON RPC endpoint, communicating with peers over TCP, and communicating with peers over WebSockets, respectively.

  • In order to disable P2P order discovery and sharing, set USE_BOOTSTRAP_LIST to false.

  • Running a VPN may interfere with Mesh. If you are having difficulty connecting to peers, disable your VPN.

  • If you are running against a POA testnet (e.g., Kovan), you might want to shorten the BLOCK_POLLING_INTERVAL since blocks are mined more frequently then on mainnet. If you do this, your node will use more Ethereum RPC calls, so you will also need to adjust the ETHEREUM_RPC_MAX_REQUESTS_PER_24_HR_UTC upwards (warning: setting this higher than 100k won't fit into Infura's

    free tier).

  • If you want to run the mesh in "detached" mode, add the -d switch to the docker run command so that your console doesn't get blocked.

Persisting State

The Docker container is configured to store all Mesh state (e.g. database files, private key file) in /usr/mesh/0x_mesh. If you want the Mesh state to persist across Docker container re-starts, use the -v flag as included in the command above to mount a local 0x_mesh directory into your container. This is strongly recommended.

Environment Variables

0x Mesh uses environment variables for configuration. Most environment variables are detailed in the Config struct. They are copied here for convenience, although the source code is authoritative.

There is one additional environment variable in the main entrypoint for the Mesh executable:

Last updated

Was this helpful?