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

Enabling Telemetry

You can optionally help us develop and maintain Mesh by automatically sending your logs, which requires a few extra steps. If you are interested in enabling telemetry, check out this guide.

Running Mesh

Make sure you have Docker installed. Then run:

docker run \
--restart unless-stopped \
-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:{version}
  1. Replace {your_ethereum_rpc_url} with the RPC endpoint for an Ethereum node (e.g. Infura or Alchemy).

  2. Replace and {local_path_on_host_machine} with a directory on your host machine where all Mesh-related data will be stored.

  3. Replace {version} with the latest version of Mesh.

Notes:

  • Ports 60558 and 60559 are the default ports used for communicating with other peers in the network.

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

  • 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: changing this setting can exceed the limits of your Ethereum RPC provider).

  • 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.

Enabling the GraphQL API

In order to enable the GraphQL API, you just need to add these additional arguments

Additionally, to enable the GraphQL playground, just add:

Note that the GraphQL API is intended to be private. If you enable the GraphQL API on a production server, we recommend using a firewall or VPC to prevent unauthorized access. See the GraphQL API page for more information.

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 are some additional environment variable in the main entrypoint for the Mesh executable:

Last updated

Was this helpful?