Skip to content

Commit

Permalink
feat: docs for sn_auditor
Browse files Browse the repository at this point in the history
  • Loading branch information
grumbach committed May 21, 2024
1 parent d542383 commit b832269
Show file tree
Hide file tree
Showing 3 changed files with 178 additions and 2 deletions.
53 changes: 52 additions & 1 deletion sn_auditor/README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,53 @@
# sn_auditor
Audit the SAFE Network Currency

This is a small webserver application that allows you to audit the SAFE Network Currency by gathering a DAG of Spends on the Network.

![](./dag.svg)

## Usage

Running an auditor instance:

```bash
# on a Network with known peers
cargo run --release --peer "/ip4/<network_peer_addr>"

# on a local testnet
cargo run --release --features=local-discovery
```

It can be run with the following flags:

```bash
-f, --force-from-genesis
Force the spend DAG to be updated from genesis

-c, --clean
Clear the local spend DAG and start from scratch

-o, --offline-viewer <dag_file>
Visualize a local DAG file offline, does not connect to the Network

-b, --beta-participants <discord_names_file>
Beta rewards program participants to track
Provide a file with a list of Discord
usernames as argument

-k, --beta-encryption-key <hex_secret_key>
Secret encryption key of the beta rewards to decypher
discord usernames of the beta participants
```

## Endpoints

The webserver listens on port `4242` and has the following endpoints:

| route | description |
|-------------------|---------------------------------------------------|
|`"/"` | `svg` representation of the DAG |
|`"/spend/<addr>"` | `json` information about the spend at this `addr` |
|`"/beta-rewards"` | `json` list of beta rewards participants |

Note that for the `"/"` endpoint to work properly you need:
- to have [graphviz](https://graphviz.org/download/) installed
- to enable the `svg-dag` feature flag (with `cargo run --release --features=svg-dag`)
125 changes: 125 additions & 0 deletions sn_auditor/dag.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion sn_auditor/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ struct Opt {
#[clap(long, value_parser = LogFormat::parse_from_str, verbatim_doc_comment)]
log_format: Option<LogFormat>,

/// Beta rewards program patricipants to track
/// Beta rewards program participants to track
/// Provide a JSON file with a list of Discord usernames as argument
#[clap(short, long, value_name = "discord_names_file")]
beta_participants: Option<PathBuf>,
Expand Down

0 comments on commit b832269

Please sign in to comment.