@@ -8,17 +8,16 @@ import TabItem from '@theme/TabItem';
8
8
# Localnet
9
9
10
10
For convenient development and testing of your dApps the Oasis team prepared
11
- both [ ghcr.io/oasisprotocol/sapphire-localnet] [ sapphire-localnet ] and
12
- [ ghcr.io/oasisprotocol/emerald-localnet] [ emerald-localnet ] Docker images.
13
- They will bring you a complete Oasis network stack to your workspace. The
11
+ the [ ghcr.io/oasisprotocol/sapphire-localnet] [ sapphire-localnet ] container image.
12
+ It will bring you a complete Oasis network stack to your workspace. The
14
13
Localnet Sapphire instance ** mimics confidential transactions** , but it does
15
14
not run in a trusted execution environment nor does it require Intel's SGX on
16
15
your computer. The network is isolated from the Mainnet or Testnet and consists
17
16
of a:
18
17
19
18
- single Oasis validator node with 1-second block time and 30-second epoch,
20
19
- single Oasis client node,
21
- - single compute node running Oasis Sapphire or Emerald ,
20
+ - single compute node running Oasis Sapphire,
22
21
- single key manager node,
23
22
- PostgreSQL instance,
24
23
- Oasis Web3 gateway with transaction indexer and enabled Oasis RPCs,
27
26
28
27
:::note Hardware requirements
29
28
30
- You will need at least 16GB of RAM to run the Docker images in addition to your
29
+ You will need at least 16GB of RAM to run the Docker image in addition to your
31
30
machine's OS.
32
31
33
32
:::
@@ -37,17 +36,39 @@ machine's OS.
37
36
To run the image, execute:
38
37
39
38
<Tabs >
40
- <TabItem value = " Sapphire " >
39
+ <TabItem value = " linux-intel-win " label = " Linux (Intel) / Windows " >
41
40
42
41
``` sh
43
- docker run -it -p8544-8548:8544-8548 ghcr.io/oasisprotocol/sapphire-localnet
42
+ docker run -it --rm - p8544-8548:8544-8548 ghcr.io/oasisprotocol/sapphire-localnet
44
43
```
45
44
46
45
</TabItem >
47
- <TabItem value = " Emerald " >
46
+ <TabItem value = " macos " label = " macOS " >
48
47
49
48
``` sh
50
- docker run -it -p8544-8548:8544-8548 ghcr.io/oasisprotocol/emerald-localnet
49
+ docker run -it --rm -p8544-8548:8544-8548 --platform linux/x86_64 ghcr.io/oasisprotocol/sapphire-localnet
50
+ ```
51
+
52
+ :::info macOS Startup Issue on Apple Silicon
53
+
54
+ On Apple Silicon Macs running macOS 26 (Tahoe) or later, the ` sapphire-localnet ` Docker
55
+ image may hang on startup with peer authentication errors (e.g.,
56
+ ` chacha20poly1305: message authentication failed ` ).
57
+
58
+ This is due to a bug in Rosetta 2's x86_64 emulation. The workaround is to
59
+ disable Rosetta in Docker Desktop settings, which makes Docker use QEMU
60
+ instead.
61
+
62
+ Go to ` Settings > Virtual Machine Options ` and disable
63
+ "Use Rosetta for x86/amd64 emulation on Apple Silicon".
64
+
65
+ :::
66
+
67
+ </TabItem >
68
+ <TabItem value = " linux-non-intel" label = " Linux (non-Intel)" >
69
+
70
+ ``` sh
71
+ docker run -it --rm -p8544-8548:8544-8548 --platform linux/x86_64 ghcr.io/oasisprotocol/sapphire-localnet
51
72
```
52
73
53
74
</TabItem >
@@ -121,60 +142,32 @@ and an Explorer instance on `http://localhost:8548`.
121
142
These can be disabled by passing ` --no-explorer ` or setting the environment
122
143
variable ` OASIS_DOCKER_START_EXPLORER ` to ` no ` .
123
144
145
+ ## Optional Parameters
146
+
124
147
By default, the Localnet docker image will populate the first five accounts
125
148
derived from the standard test mnemonic, compatible with ` hardhat node ` .
126
149
These accounts are typically used for Solidity unit tests. If you prefer
127
150
populating different accounts, use ` -to ` flag and pass the mnemonics seed
128
151
phrases or wallet addresses. Use the ` -n ` parameter to define the number of
129
152
derived addresses to fund.
130
153
131
- <Tabs >
132
- <TabItem value = " Sapphire" >
133
-
134
154
``` sh
135
155
docker run -it -p8544-8548:8544-8548 ghcr.io/oasisprotocol/sapphire-localnet -to " bench remain brave curve frozen verify dream margin alarm world repair innocent" -n3
136
156
docker run -it -p8544-8548:8544-8548 ghcr.io/oasisprotocol/sapphire-localnet -to " 0x75eCF0d4496C2f10e4e9aF3D4d174576Ee9010E2,0xbDA5747bFD65F08deb54cb465eB87D40e51B197E"
137
157
```
138
158
139
- </TabItem >
140
- <TabItem value = " Emerald" >
141
-
142
- ``` sh
143
- docker run -it -p8544-8548:8544-8548 ghcr.io/oasisprotocol/emerald-localnet -to " bench remain brave curve frozen verify dream margin alarm world repair innocent" -n3
144
- docker run -it -p8544-8548:8544-8548 ghcr.io/oasisprotocol/emerald-localnet -to " 0x75eCF0d4496C2f10e4e9aF3D4d174576Ee9010E2,0xbDA5747bFD65F08deb54cb465eB87D40e51B197E"
145
- ```
146
-
147
- </TabItem >
148
- </Tabs >
149
-
150
- :::note Running on Apple M chips
151
-
152
- There is currently no ` arm64 ` build available for M Macs, so you will need to
153
- force the docker image to use the ` linux/x86_64 ` platform, like this:
154
-
155
- <Tabs >
156
- <TabItem value = " Sapphire" >
157
-
158
- ``` sh
159
- docker run -it -p8544-8548:8544-8548 --platform linux/x86_64 ghcr.io/oasisprotocol/sapphire-localnet
160
- ```
161
-
162
- </TabItem >
163
- <TabItem value = " Emerald" >
164
-
165
- ``` sh
166
- docker run -it -p8544-8548:8544-8548 --platform linux/x86_64 ghcr.io/oasisprotocol/emerald-localnet
167
- ```
159
+ :::danger
168
160
169
- </ TabItem >
170
- </ Tabs >
161
+ The [ sapphire-localnet ] runs in ephemeral mode. Any smart
162
+ contract and wallet balance will be lost after you quit the Docker container!
171
163
172
164
:::
173
165
174
- :::danger
166
+ :::note Emerald Localnet
175
167
176
- [ sapphire-localnet] and [ emerald-localnet] run in ephemeral mode. Any smart
177
- contract and wallet balance will be lost after you quit the Docker container!
168
+ An Emerald flavor of [ sapphire-localnet] also exists, called
169
+ [ emerald-localnet] . It behaves the same way as Sapphire, but without
170
+ confidentiality.
178
171
179
172
:::
180
173
@@ -184,12 +177,9 @@ contract and wallet balance will be lost after you quit the Docker container!
184
177
## GitHub Actions
185
178
186
179
You can easily integrate localnet into your CI/CD workflow. Use the example
187
- GitHub Action configuration to start a Sapphire or Emerald stack and expose
180
+ GitHub Action configuration to start a Sapphire stack and expose
188
181
the necessary ports for testing.
189
182
190
- <Tabs >
191
- <TabItem value = " Sapphire" >
192
-
193
183
``` yaml
194
184
jobs :
195
185
example-test :
@@ -207,27 +197,3 @@ jobs:
207
197
--health-cmd="test -f /CONTAINER_READY"
208
198
--health-start-period=90s
209
199
` ` `
210
-
211
- </TabItem>
212
- <TabItem value="Emerald">
213
-
214
- ` ` ` yaml
215
- jobs :
216
- example-test :
217
- services :
218
- emerald-localnet-ci :
219
- image : ghcr.io/oasisprotocol/emerald-localnet
220
- ports :
221
- - 8544:8544
222
- - 8545:8545
223
- - 8546:8546
224
- env :
225
- OASIS_DOCKER_START_EXPLORER : no
226
- options : >-
227
- --rm
228
- --health-cmd="test -f /CONTAINER_READY"
229
- --health-start-period=90s
230
- ` ` `
231
-
232
- </TabItem>
233
- </Tabs>
0 commit comments