From f50b704f368a6d0250649844345e49841d703301 Mon Sep 17 00:00:00 2001 From: Johnny <9611008+johnnymatthews@users.noreply.github.com> Date: Mon, 27 Jan 2025 13:47:47 -0400 Subject: [PATCH] Simplifies docker steps. Reduces title length. (#311) * Simplifies docker steps. Reduces title length. * Minor grammar improvements. --- content/guides/spin-up-a-devnet.md | 74 ++++++++++++++++++++++++------ 1 file changed, 60 insertions(+), 14 deletions(-) diff --git a/content/guides/spin-up-a-devnet.md b/content/guides/spin-up-a-devnet.md index ce649fb..e919694 100644 --- a/content/guides/spin-up-a-devnet.md +++ b/content/guides/spin-up-a-devnet.md @@ -1,5 +1,5 @@ --- -title: "Spin up a devnet for Entropy" +title: "Spin up a devnet" lead: "A developer network (devnet) is a private blockchain network that mimics the mainnet but is isolated for testing and development purposes. This allows developers to make mistakes and iterate quickly without impacting real users or risking real-world assets. This guide will walk you through setting up a local devnet for the Entropy." --- @@ -27,14 +27,7 @@ This method leverages pre-built Docker images to quickly and easily spin up a lo ### Steps -1. Clone the Entropy Core repo: - - ```bash - git clone https://github.com/entropyxyz/entropy-core.git - cd entropy-core - ``` - -1. Start the Docker daemon: +1. Ensure that the Docker daemon is running: {{< tabs items="MacOS, Linux" >}} {{< tab >}} @@ -50,11 +43,64 @@ This method leverages pre-built Docker images to quickly and easily spin up a lo {{< /tab >}} {{< /tabs >}} -1. Start the Docker containers: +1. Create the following Docker file and call it `four-nodes.yaml`: + + ```shell + --- + name: entropy-devnet-local-4-nodes + services: + alice-tss-server: + image: entropyxyz/entropy-tss:${ENTROPY_CORE_VERSION:-latest} + ports: ["127.0.0.1:3001:3001/tcp"] + command: ["--alice", "--threshold-url", "0.0.0.0:3001", "--chain-endpoint", "ws://alice-chain-node:9944", "--no-sync"] + alice-chain-node: + image: entropyxyz/entropy:${ENTROPY_CORE_VERSION:-latest} + ports: ["127.0.0.1:9944:9944/tcp"] + volumes: ["${PWD}/dev:/srv/entropy/dev"] + command: ["--chain", "devnet-local", "--alice", "--base-path", ".entropy/alice", "--rpc-port", "9944", "--rpc-cors", "all", "--unsafe-rpc-external", "--node-key=0000000000000000000000000000000000000000000000000000000000000001", "--tss-server-endpoint", "http://alice-tss-server:3001"] + bob-tss-server: + image: entropyxyz/entropy-tss:${ENTROPY_CORE_VERSION:-latest} + ports: ["127.0.0.1:3002:3002/tcp"] + command: ["--bob", "--threshold-url", "0.0.0.0:3002", "--chain-endpoint", "ws://bob-chain-node:9944", "--no-sync"] + bob-chain-node: + image: entropyxyz/entropy:${ENTROPY_CORE_VERSION:-latest} + ports: ["127.0.0.1:9945:9944/tcp"] + volumes: ["${PWD}/dev:/srv/entropy/dev"] + command: ["--chain", "devnet-local", "--bob", "--base-path", ".entropy/bob", "--rpc-port", "9944", "--rpc-cors", "all", "--unsafe-rpc-external", "--bootnodes", "/dns4/alice-chain-node/tcp/30333/p2p/12D3KooWEyoppNCUx8Yx66oV9fJnriXwCcXwDDUA2kj6vnc6iDEp", "--tss-server-endpoint", "http://bob-tss-server:3002"] + charlie-tss-server: + image: entropyxyz/entropy-tss:${ENTROPY_CORE_VERSION:-latest} + ports: ["127.0.0.1:3003:3003/tcp"] + command: ["--charlie", "--threshold-url", "0.0.0.0:3003", "--chain-endpoint", "ws://charlie-chain-node:9944", "--no-sync"] + charlie-chain-node: + image: entropyxyz/entropy:${ENTROPY_CORE_VERSION:-latest} + ports: ["127.0.0.1:9946:9944/tcp"] + volumes: ["${PWD}/dev:/srv/entropy/dev"] + command: ["--chain", "devnet-local", "--charlie", "--base-path", ".entropy/charlie", "--rpc-port", "9944", "--rpc-cors", "all", "--unsafe-rpc-external", "--bootnodes", "/dns4/alice-chain-node/tcp/30333/p2p/12D3KooWEyoppNCUx8Yx66oV9fJnriXwCcXwDDUA2kj6vnc6iDEp", "--tss-server-endpoint", "http://charlie-tss-server:3003"] + dave-tss-server: + image: entropyxyz/entropy-tss:${ENTROPY_CORE_VERSION:-latest} + ports: ["127.0.0.1:3004:3004/tcp"] + command: ["--dave", "--threshold-url", "0.0.0.0:3004", "--chain-endpoint", "ws://dave-chain-node:9944", "--no-sync"] + dave-chain-node: + image: entropyxyz/entropy:${ENTROPY_CORE_VERSION:-latest} + ports: ["127.0.0.1:9947:9944/tcp"] + volumes: ["${PWD}/dev:/srv/entropy/dev"] + command: ["--chain", "devnet-local", "--dave", "--base-path", ".entropy/dave", "--rpc-port", "9944", "--rpc-cors", "all", "--unsafe-rpc-external", "--bootnodes", "/dns4/alice-chain-node/tcp/30333/p2p/12D3KooWEyoppNCUx8Yx66oV9fJnriXwCcXwDDUA2kj6vnc6iDEp", "--tss-server-endpoint", "http://dave-tss-server:3004"] + ``` - ```bash - docker compose up --detach - ``` + The reference for this file can be found in the [Entropy JavaScript SDK repo](https://github.com/entropyxyz/sdk/blob/4ea6037276a5e406668bd1ff25b0ea265b5e904e/dev/docker-scripts/four-nodes.yaml). + +1. Grab the [entropyxyz/entropy](https://hub.docker.com/r/entropyxyz/entropy) and [entropyxyz/entropy-tss](https://hub.docker.com/r/entropyxyz/entropy-tss) Docker containers: + + ```shell + docker pull entropyxyz/entropy + docker pull entropyxyz/entropy-tss + ``` + +1. Start the devnet using the two containers you just downloaded and the `four-nodes.yaml` file you created: + + ```shell + docker-compose -f four-up.yaml up -d + ``` 1. Verify container status: @@ -70,7 +116,7 @@ This method leverages pre-built Docker images to quickly and easily spin up a lo docker compose logs ``` - While optional, this command shows logs from running containers which can be helpful for troubleshooting. + While optional, this command shows logs from running containers, which can help with troubleshooting. 1. Stop all running containers: