Skip to content

Commit

Permalink
docs: Add docs for trustworthy node metrics (#71)
Browse files Browse the repository at this point in the history
* docs: Add docs for trustworthy node metrics

* Address reviewer comments
  • Loading branch information
sasa-tomic committed Jan 19, 2024
1 parent ef78777 commit 7df6bb4
Show file tree
Hide file tree
Showing 9 changed files with 163,055 additions and 24 deletions.
1 change: 1 addition & 0 deletions .github/workflows/mkdocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
paths:
- 'docs/**'
- 'mkdocs.yml'
branches:
- main

Expand Down
25 changes: 25 additions & 0 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Getting Started

## Downloading the pre-built binary

These instructions are for a Linux based system. We tested on Ubuntu 22.04.

```bash
mkdir -p $HOME/bin
curl -L https://github.com/dfinity/dre/releases/download/v0.1.0/dre -o $HOME/bin/dre
chmod +x $HOME/bin/dre
```

Make sure that `$HOME/bin` is added to your path. If it's not, you might get an error such as:
```bash
❯ dre
Command 'dre' not found, did you mean:
[...]
```

To fix this issue, you can run
```bash
export PATH=$HOME/bin:$PATH
```

And you can also add this to your $HOME/.bashrc file (or the one appropriate for your shell).
21 changes: 21 additions & 0 deletions docs/how-to-update-docs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@

# Documentation

We use MkDocs to generate, serve, and search the team documentation.
For full documentation visit [mkdocs.org](https://www.mkdocs.org).

## Commands

* `bazel run "//:mkdocs" new [dir-name]` - Create a new project.
* `bazel run "//:mkdocs" serve` - Start the live-reloading docs server.
* `bazel run "//:mkdocs" build` - Build the documentation site.
* `bazel run "//:mkdocs" -h` - Print help message and exit.

To generate documentation as HTML, you can use convenience script `./bin/mkdocs-build.sh`. The generated documentation will be in the `site` subdirectory of the repo root.

## Project layout

mkdocs.yml # The configuration file.
docs/
index.md # The documentation homepage.
... # Other markdown pages, images and other files.
24 changes: 2 additions & 22 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,3 @@
# Repo description

# Documentation

We use MkDocs to generate, serve, and search the team documentation.
For full documentation visit [mkdocs.org](https://www.mkdocs.org).

## Commands

* `bazel run "//:mkdocs" new [dir-name]` - Create a new project.
* `bazel run "//:mkdocs" serve` - Start the live-reloading docs server.
* `bazel run "//:mkdocs" build` - Build the documentation site.
* `bazel run "//:mkdocs" -h` - Print help message and exit.

To generate documentation as HTML, you can use convenience script `./bin/mkdocs-build.sh`. The generated documentation will be in the `site` subdirectory of the repo root.

## Project layout

mkdocs.yml # The configuration file.
docs/
index.md # The documentation homepage.
... # Other markdown pages, images and other files.

## Hello from dre repo!
This repo holds the tools and documentation for IC Decentralized Reliability Engineering (DRE). We manage the IC Mainnet, topology, observability and monitoring.
95 changes: 95 additions & 0 deletions docs/nns-proposals.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# NNS/ic-admin operations

Most of the commands here can be run in multiple ways. Currently we are putting in the effort to make `dre` as useful as possible. As such it provides support for `dry_run` as default and that can be highly beneficial in most scenarios (for eg. if someone is asking you to submit a proposal for them the best practice way is to run a `dry_run` and ask them to double check the command and the payload that would be submitted) and that is why we recommend using `dre` whenever possible. In some use-cases `dre` cannot help you, and that is when you should use whatever tool/script is at hand.

### Get the principal from your HSM

```bash
❯ dfx identity use hsm
Using identity: "hsm".
export DFX_HSM_PIN=$(cat ~/.hsm-pin)
❯ dfx identity get-principal
as4rt-t4nqh-64j36-ubyaa-2c6uz-f2qbm-67llh-ftd3y-epn2e-wzaut-wae
```

### Get the neuron id associated with your HSM

```bash
export DFX_HSM_PIN=$(cat ~/.hsm-pin)
❯ dfx canister --identity=hsm --network=ic call rrkah-fqaaa-aaaaa-aaaaq-cai get_neuron_ids '()'
(vec { 40 : nat64 })
```
### Getting the Mainnet firewall rules
```bash
dre get firewall-rules replica_nodes | jq
```
### Get the Node Rewards Table, used for the Node Provider compensation
```bash
ic-admin --nns-url https://ic0.app get-node-rewards-table
{
"table": {
"Asia": {
[...]
}
```
- Alternative
```bash
dre get node-rewards-table
```
### Update the Node Rewards Table
```bash
ic-admin --nns-url https://ic0.app --use-hsm --pin $(cat ~/.hsm-pin) --key-id 01 --slot 0 propose-to-update-node-rewards-table --proposer $PROPOSER_NEURON_INDEX --summary-file 2022-12-type3.md --updated-node-rewards "$(cat 2022-12-type3-rewards.json)"
```
- Alternative
```bash
dre propose update-node-rewards-table --summary-file 2022-12-type3.md --updated-node-rewards "$(cat 2022-12-type3-rewards.json | jq -c)"
```
### Enable the HTTPs outcalls on a subnet
```bash
cargo run --bin ic-admin -- --nns-url https://ic0.app/ \
--use-hsm \
--pin $(cat ~/.hsm-pin) \
--key-id 01 \
--slot 0 \
propose-to-update-subnet \
--proposer <neuron> \
--features "http_requests" \
--subnet uzr34-akd3s-xrdag-3ql62-ocgoh-ld2ao-tamcv-54e7j-krwgb-2gm4z-oqe \
--summary "Enable the HTTPS outcalls feature on the non-whitelisted uzr34 subnet so that the exchange rate canister can query exchange rate data."
```
- Alternative
```bash
dre propose update-subnet \
--features "http_requests" \
--subnet uzr34-akd3s-xrdag-3ql62-ocgoh-ld2ao-tamcv-54e7j-krwgb-2gm4z-oqe \
--summary "Enable the HTTPS outcalls feature on the non-whitelisted uzr34 subnet so that the exchange rate canister can query exchange rate data."
```
### Removing node operator principal id
```bash
dre propose remove-node-operators kdqam-hauon-sdvym-42eyg-5wyff-4ywbw-v6iij-2sw2z-bu4rj-ejusn-jae \
--summary "<An appropriate summary for the proposal, and a link to the forum post for further discussion, if possible>"
```
### Removing nodes from the registry
Here is an example where we remove all AW1 nodes for redeployment.
```bash
dre nodes remove aw1 --motivation "Removing AW1 nodes for redeployment"
```
Loading

0 comments on commit 7df6bb4

Please sign in to comment.