Skip to content

Commit 3354521

Browse files
Simplifies docker steps. Reduces title length.
1 parent 19ed77b commit 3354521

File tree

1 file changed

+59
-13
lines changed

1 file changed

+59
-13
lines changed

content/guides/spin-up-a-devnet.md

Lines changed: 59 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: "Spin up a devnet for Entropy"
2+
title: "Spin up a devnet"
33
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."
44
---
55

@@ -27,14 +27,7 @@ This method leverages pre-built Docker images to quickly and easily spin up a lo
2727

2828
### Steps
2929

30-
1. Clone the Entropy Core repo:
31-
32-
```bash
33-
git clone https://github.com/entropyxyz/entropy-core.git
34-
cd entropy-core
35-
```
36-
37-
1. Start the Docker daemon:
30+
1. Ensure that Docker daemon is running:
3831

3932
{{< tabs items="MacOS, Linux" >}}
4033
{{< tab >}}
@@ -50,11 +43,64 @@ This method leverages pre-built Docker images to quickly and easily spin up a lo
5043
{{< /tab >}}
5144
{{< /tabs >}}
5245

53-
1. Start the Docker containers:
46+
1. Create the following Docker file and call it `four-nodes.yaml`:
47+
48+
```shell
49+
---
50+
name: entropy-devnet-local-4-nodes
51+
services:
52+
alice-tss-server:
53+
image: entropyxyz/entropy-tss:${ENTROPY_CORE_VERSION:-latest}
54+
ports: ["127.0.0.1:3001:3001/tcp"]
55+
command: ["--alice", "--threshold-url", "0.0.0.0:3001", "--chain-endpoint", "ws://alice-chain-node:9944", "--no-sync"]
56+
alice-chain-node:
57+
image: entropyxyz/entropy:${ENTROPY_CORE_VERSION:-latest}
58+
ports: ["127.0.0.1:9944:9944/tcp"]
59+
volumes: ["${PWD}/dev:/srv/entropy/dev"]
60+
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"]
61+
bob-tss-server:
62+
image: entropyxyz/entropy-tss:${ENTROPY_CORE_VERSION:-latest}
63+
ports: ["127.0.0.1:3002:3002/tcp"]
64+
command: ["--bob", "--threshold-url", "0.0.0.0:3002", "--chain-endpoint", "ws://bob-chain-node:9944", "--no-sync"]
65+
bob-chain-node:
66+
image: entropyxyz/entropy:${ENTROPY_CORE_VERSION:-latest}
67+
ports: ["127.0.0.1:9945:9944/tcp"]
68+
volumes: ["${PWD}/dev:/srv/entropy/dev"]
69+
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"]
70+
charlie-tss-server:
71+
image: entropyxyz/entropy-tss:${ENTROPY_CORE_VERSION:-latest}
72+
ports: ["127.0.0.1:3003:3003/tcp"]
73+
command: ["--charlie", "--threshold-url", "0.0.0.0:3003", "--chain-endpoint", "ws://charlie-chain-node:9944", "--no-sync"]
74+
charlie-chain-node:
75+
image: entropyxyz/entropy:${ENTROPY_CORE_VERSION:-latest}
76+
ports: ["127.0.0.1:9946:9944/tcp"]
77+
volumes: ["${PWD}/dev:/srv/entropy/dev"]
78+
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"]
79+
dave-tss-server:
80+
image: entropyxyz/entropy-tss:${ENTROPY_CORE_VERSION:-latest}
81+
ports: ["127.0.0.1:3004:3004/tcp"]
82+
command: ["--dave", "--threshold-url", "0.0.0.0:3004", "--chain-endpoint", "ws://dave-chain-node:9944", "--no-sync"]
83+
dave-chain-node:
84+
image: entropyxyz/entropy:${ENTROPY_CORE_VERSION:-latest}
85+
ports: ["127.0.0.1:9947:9944/tcp"]
86+
volumes: ["${PWD}/dev:/srv/entropy/dev"]
87+
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"]
88+
```
5489

55-
```bash
56-
docker compose up --detach
57-
```
90+
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).
91+
92+
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:
93+
94+
```shell
95+
docker pull entropyxyz/entropy
96+
docker pull entropyxyz/entropy-tss
97+
```
98+
99+
1. Start the devnet using the two containers you just downloaded and the `four-nodes.yaml` file you created:
100+
101+
```shell
102+
docker-compose -f four-up.yaml up -d
103+
```
58104

59105
1. Verify container status:
60106

0 commit comments

Comments
 (0)