-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: Move Localnet development to separate page #977
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for oasisprotocol-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
b2afac7
to
639f05f
Compare
@@ -79,91 +79,9 @@ ParaTime. | |||
[Emerald Mainnet]: ./network.mdx | |||
[Emerald Testnet]: ./network.mdx | |||
|
|||
## Running a Private Oasis Network Locally | |||
#### For development and testing, you can run a local [instance][localnet] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#### For development and testing, you can run a local [instance][localnet] | |
## For development and testing, you can run a local [instance][localnet] |
Probably 2 # too much
I think having the old header and card to the localnet could be also a good way
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm. Yeah, ##
is more consistent with "Testnet" etc. Let me try the text for now. I tend to think that the card takes the reader away from the flow of the document.
42aa9cc
to
2a0e8e7
Compare
2a0e8e7
to
80db33b
Compare
After a while, running the `sapphire-localnet` will show you something like: | ||
|
||
``` | ||
sapphire-localnet 2024-05-28-git37b7166 (oasis-core: 24.0-gitfb49717, sapphire-paratime: 0.7.3-testnet, oasis-web3-gateway: 5.1.0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think devs need duplicated info for Emerald.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added some ideas.
:::tip | ||
|
||
If you prefer using the same mnemonics each time (e.g. for testing purposes) | ||
or to populate just a single account, use `-to` flag and pass the mnemonics or | ||
the wallet addresses. By passing the `-test-mnemonic` flag you can fund the | ||
standard test accounts provided by the `hardhat node` commmand and that are | ||
typically used for solidity unit tests. | ||
|
||
<Tabs> | ||
<TabItem value="Sapphire"> | ||
|
||
```sh | ||
docker run -it -p8544-8546:8544-8546 ghcr.io/oasisprotocol/sapphire-localnet -to "bench remain brave curve frozen verify dream margin alarm world repair innocent" -n3 | ||
docker run -it -p8544-8546:8544-8546 ghcr.io/oasisprotocol/sapphire-localnet -to "0x75eCF0d4496C2f10e4e9aF3D4d174576Ee9010E2,0xbDA5747bFD65F08deb54cb465eB87D40e51B197E" | ||
docker run -it -p8544-8546:8544-8546 ghcr.io/oasisprotocol/sapphire-localnet -test-mnemonic | ||
``` | ||
|
||
</TabItem> | ||
<TabItem value="Emerald"> | ||
|
||
```sh | ||
docker run -it -p8544-8546:8544-8546 ghcr.io/oasisprotocol/emerald-localnet -to "bench remain brave curve frozen verify dream margin alarm world repair innocent" -n3 | ||
docker run -it -p8544-8546:8544-8546 ghcr.io/oasisprotocol/emerald-localnet -to "0x75eCF0d4496C2f10e4e9aF3D4d174576Ee9010E2,0xbDA5747bFD65F08deb54cb465eB87D40e51B197E" | ||
docker run -it -p8544-8546:8544-8546 ghcr.io/oasisprotocol/emerald-localnet -test-mnemonic | ||
``` | ||
|
||
</TabItem> | ||
</Tabs> | ||
|
||
::: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The -test-mnemonic
is now default. Let's keep this outside of admonition not to bloat the chapter too much.
:::tip | |
If you prefer using the same mnemonics each time (e.g. for testing purposes) | |
or to populate just a single account, use `-to` flag and pass the mnemonics or | |
the wallet addresses. By passing the `-test-mnemonic` flag you can fund the | |
standard test accounts provided by the `hardhat node` commmand and that are | |
typically used for solidity unit tests. | |
<Tabs> | |
<TabItem value="Sapphire"> | |
```sh | |
docker run -it -p8544-8546:8544-8546 ghcr.io/oasisprotocol/sapphire-localnet -to "bench remain brave curve frozen verify dream margin alarm world repair innocent" -n3 | |
docker run -it -p8544-8546:8544-8546 ghcr.io/oasisprotocol/sapphire-localnet -to "0x75eCF0d4496C2f10e4e9aF3D4d174576Ee9010E2,0xbDA5747bFD65F08deb54cb465eB87D40e51B197E" | |
docker run -it -p8544-8546:8544-8546 ghcr.io/oasisprotocol/sapphire-localnet -test-mnemonic | |
``` | |
</TabItem> | |
<TabItem value="Emerald"> | |
```sh | |
docker run -it -p8544-8546:8544-8546 ghcr.io/oasisprotocol/emerald-localnet -to "bench remain brave curve frozen verify dream margin alarm world repair innocent" -n3 | |
docker run -it -p8544-8546:8544-8546 ghcr.io/oasisprotocol/emerald-localnet -to "0x75eCF0d4496C2f10e4e9aF3D4d174576Ee9010E2,0xbDA5747bFD65F08deb54cb465eB87D40e51B197E" | |
docker run -it -p8544-8546:8544-8546 ghcr.io/oasisprotocol/emerald-localnet -test-mnemonic | |
``` | |
</TabItem> | |
</Tabs> | |
::: | |
By default, the Localnet docker image will populate the first five accounts | |
derived from the standard test mnemonic, compatible with `hardhat node`. | |
These accounts are typically used for solidity unit tests. If you prefer | |
populating different accounts, use `-to` flag and pass the mnemonics or the | |
wallet addresses. Using the `-n` parameter defines the number of derived | |
addresses to fund. | |
<Tabs> | |
<TabItem value="Sapphire"> | |
```sh | |
docker run -it -p8544-8546:8544-8546 ghcr.io/oasisprotocol/sapphire-localnet -to "bench remain brave curve frozen verify dream margin alarm world repair innocent" -n3 | |
docker run -it -p8544-8546:8544-8546 ghcr.io/oasisprotocol/sapphire-localnet -to "0x75eCF0d4496C2f10e4e9aF3D4d174576Ee9010E2,0xbDA5747bFD65F08deb54cb465eB87D40e51B197E" | |
``` | |
</TabItem> | |
<TabItem value="Emerald"> | |
```sh | |
docker run -it -p8544-8546:8544-8546 ghcr.io/oasisprotocol/emerald-localnet -to "bench remain brave curve frozen verify dream margin alarm world repair innocent" -n3 | |
docker run -it -p8544-8546:8544-8546 ghcr.io/oasisprotocol/emerald-localnet -to "0x75eCF0d4496C2f10e4e9aF3D4d174576Ee9010E2,0xbDA5747bFD65F08deb54cb465eB87D40e51B197E" | |
``` | |
</TabItem> | |
</Tabs> |
|
||
- `http://localhost:8545` | ||
- `ws://localhost:8546` | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Additionally, the [Oasis GRPC](https://github.com/oasisprotocol/oasis-core/blob/master/docs/oasis-node/rpc.md) endpoint is exposed on: | |
- `http://localhost:8544` | |
@@ -16,7 +16,7 @@ import {AddEmeraldToMetaMask as E, AddEmeraldTestnetToMetaMask as ET} from '@sit | |||
| Tools | | [Testing token Faucet][faucet] | [Local development Docker image][localnet] | |||
|
|||
[faucet]: https://faucet.testnet.oasis.io/ | |||
[localnet]: https://github.com/oasisprotocol/oasis-web3-gateway/tree/main/docker | |||
[localnet]: /dapp/tools/localnet |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use paths to the .md files instead.
[localnet]: /dapp/tools/localnet | |
[localnet]: ../tools/localnet.mdx |
::: | ||
|
||
[sapphire-localnet]: https://github.com/oasisprotocol/oasis-web3-gateway/pkgs/container/sapphire-localnet | ||
[emerald-localnet]: https://github.com/oasisprotocol/oasis-web3-gateway/pkgs/container/emerald-localnet |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please also add a section on how to run Localnet with github actions. For example:
jobs:
services:
sapphire-localnet-ci:
image: ghcr.io/oasisprotocol/sapphire-localnet
ports:
- 8544:8544
- 8545:8545
- 8546:8546
env:
OASIS_DEPOSIT_BINARY: /oasis-deposit -n 2
options: >-
--rm
--health-cmd="test -f /CONTAINER_READY"
--health-start-period=90s
Description
Close #959
Note. Configuring Docusaurus redirect is not possible from an URL with an anchor.
message: '"redirects[54].from[0]" (/dapp/emerald/writing-dapps-on-emerald#running-a-private-oasis-network-locally) is not a valid pathname. Pathname should start with slash and not contain any domain or query string.',
TODO
PREVIEW