Skip to content

Commit

Permalink
Simplifies docker steps. Reduces title length.
Browse files Browse the repository at this point in the history
  • Loading branch information
johnnymatthews committed Jan 27, 2025
1 parent 19ed77b commit 3354521
Showing 1 changed file with 59 additions and 13 deletions.
72 changes: 59 additions & 13 deletions content/guides/spin-up-a-devnet.md
Original file line number Diff line number Diff line change
@@ -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."
---

Expand Down Expand Up @@ -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 Docker daemon is running:

{{< tabs items="MacOS, Linux" >}}
{{< tab >}}
Expand All @@ -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:

Expand Down

0 comments on commit 3354521

Please sign in to comment.