Skip to content

Commit 310d362

Browse files
committed
docs: added deployment
1 parent a8d4723 commit 310d362

File tree

1 file changed

+20
-7
lines changed

1 file changed

+20
-7
lines changed

README.md

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -116,12 +116,8 @@ The Validators API provides endpoints to retrieve validator information for inte
116116

117117
The Validators Dashboard is a simple Nuxt application that displays all validators along with their scores. You can access the dashboard here: https://validators-api-mainnet.pages.dev/
118118

119-
## Development
120-
121-
```bash
122-
pnpm install
123-
pnpm dev
124-
```
119+
> [!TIP]
120+
> Check also the [deployment](#deployment) section to learn how to access to the `testnet` and `preview` environments.
125121
126122
## How the API works
127123

@@ -183,11 +179,28 @@ To learn more about the algorithm the calculation of the score, check:
183179
- [Documentation](./packages/nimiq-validator-trustscore/README.md).
184180
- [`nimiq-validator-trustscore`](https://www.nimiq.com/developers/learn/validator-trustscore) package.
185181

186-
#### Development
182+
## Development
187183

188184
Once it is cloned and installed the dependencies, you must run:
189185

190186
```bash
191187
pnpm db:generate
192188
pnpm dev # or pnpm dev:local to use the local database
193189
```
190+
191+
## Deployment
192+
193+
The deployment is handled by [`NuxtHub Action`](./.github/workflows/nuxt-hub.yml).
194+
195+
There are 4 different environments:
196+
197+
| Nuxt Hub Env | GitHub Env | Dashboard URL | Trigger |
198+
| ------------ | -------------------- | -------------------------------------------------------------------------- | ----------------------------- |
199+
| `production` | `production-mainnet` | [Validators API Mainnet](https://validators-api-mainnet.pages.dev) | Push to `main` branch |
200+
| `production` | `production-testnet` | [Validators API Testnet](https://validators-api-testnet.pages.dev) | Push to `main` branch |
201+
| `preview` | `preview-mainnet` | [Validators API Mainnet Preview](https://validators-api-preview.pages.dev) | Push any commit to any branch |
202+
| `preview` | `preview-testnet` | [Validators API Testnet Preview](https://validators-api-preview.pages.dev) | Push any commit to any branch |
203+
204+
Each Nuxt Hub environment has its own database, so effectively we have 4 different databases and there 4 tasks in the [`sync.yml`](./.github/workflows/sync.yml) workflow that are responsible for syncing the data from the Nimiq network to the database.
205+
206+
**Write operations to `main` are restricted**, only via PR.

0 commit comments

Comments
 (0)