Skip to content

Commit

Permalink
Merge pull request #1032 from oasisprotocol/andrej/feature/update-loc…
Browse files Browse the repository at this point in the history
…alnet-docs

docs: Update localnet docs
  • Loading branch information
abukosek authored Dec 2, 2024
2 parents 9ba6288 + 3e8b31a commit a06e729
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions docs/dapp/tools/localnet.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ of a:
- single key manager node,
- PostgreSQL instance,
- Oasis Web3 gateway with transaction indexer and enabled Oasis RPCs,
- Oasis Nexus indexer and Explorer frontend,
- helper script which populates the account(s) for you.

:::note Hardware requirements
Expand Down Expand Up @@ -51,19 +52,19 @@ docker run -it -p8544-8548:8544-8548 ghcr.io/oasisprotocol/emerald-localnet
After a while, running the `sapphire-localnet` will show you something like:

```console
sapphire-localnet 2024-11-22-git502678f (oasis-core: 24.3, sapphire-paratime: 0.9.0-testnet, oasis-web3-gateway: 5.1.0)
sapphire-localnet 2024-11-29-gite748a1a (oasis-core: 24.3, sapphire-paratime: 0.9.0-testnet, oasis-web3-gateway: 5.1.0)

* No ROFLs detected.
* Starting oasis-net-runner with sapphire...
* Waiting for Postgres to start.
* Waiting for Oasis node to start.......
* Waiting for Postgres to start...
* Waiting for Oasis node to start.....
* Waiting for Envoy proxy to start.
* Starting oasis-web3-gateway...
* Bootstrapping network (this might take a minute)....
* Waiting for key manager......
* Creating database 'nexus'
* Waiting for Nexus to start.
* Waiting for Explorer to start.....
* Waiting for Explorer to start.
* Populating accounts...

Available Accounts
Expand Down Expand Up @@ -93,7 +94,7 @@ WARNING: The chain is running in ephemeral mode. State will be lost after restar
* Web3 RPC listening on http://localhost:8545 and ws://localhost:8546. Chain ID: 0x5afd.
* Nexus API listening on http://localhost:8547.
* Localnet Explorer available at http://localhost:8548.
* Container start-up took 73 seconds, node log level is set to warn.
* Container start-up took 69 seconds, node log level is set to warn.
```

Those familiar with local dApp environments will find the output above similar
Expand All @@ -109,12 +110,13 @@ The [Oasis GRPC][oasis-rpc] endpoint is exposed on:

- `http://localhost:8544`

The local explorer you can visit at:

- [http://localhost:8548](http://localhost:8548)

[oasis-rpc]: https://github.com/oasisprotocol/oasis-core/blob/master/docs/oasis-node/rpc.md

In addition to these, the Nexus API is available on `http://localhost:8547`
and an Explorer instance on `http://localhost:8548`.
These can be disabled by passing `--no-explorer` or setting the environment
variable `OASIS_DOCKER_START_EXPLORER` to `no`.

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
Expand All @@ -126,8 +128,8 @@ derived addresses to fund.
<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-8548:8544-8548 ghcr.io/oasisprotocol/sapphire-localnet -to "bench remain brave curve frozen verify dream margin alarm world repair innocent" -n3
docker run -it -p8544-8548:8544-8548 ghcr.io/oasisprotocol/sapphire-localnet -to "0x75eCF0d4496C2f10e4e9aF3D4d174576Ee9010E2,0xbDA5747bFD65F08deb54cb465eB87D40e51B197E"
```

</TabItem>
Expand Down Expand Up @@ -178,8 +180,8 @@ contract and wallet balance will be lost after you quit the Docker container!
## GitHub Actions

You can easily integrate localnet into your CI/CD workflow. Use the example
GitHub Action configuration to start a Sapphire or Emerald stack, fund the
first two test accounts, and expose the necessary ports for testing.
GitHub Action configuration to start a Sapphire or Emerald stack and expose
the necessary ports for testing.

<Tabs>
<TabItem value="Sapphire">
Expand All @@ -195,7 +197,7 @@ jobs:
- 8545:8545
- 8546:8546
env:
OASIS_DEPOSIT_BINARY: /oasis-deposit -n 2
OASIS_DOCKER_START_EXPLORER: no
options: >-
--rm
--health-cmd="test -f /CONTAINER_READY"
Expand All @@ -216,7 +218,7 @@ jobs:
- 8545:8545
- 8546:8546
env:
OASIS_DEPOSIT_BINARY: /oasis-deposit -n 2
OASIS_DOCKER_START_EXPLORER: no
options: >-
--rm
--health-cmd="test -f /CONTAINER_READY"
Expand Down

0 comments on commit a06e729

Please sign in to comment.