34 releases

new 0.2.2 Jul 8, 2024
0.2.1 Jun 4, 2024
0.1.26 Jun 13, 2024
0.1.17 May 24, 2024
0.1.2 Mar 28, 2024

#114 in Network programming

Download history 366/week @ 2024-03-25 366/week @ 2024-04-01 189/week @ 2024-04-08 192/week @ 2024-04-15 362/week @ 2024-04-22 4/week @ 2024-04-29 448/week @ 2024-05-06 164/week @ 2024-05-13 291/week @ 2024-05-20 26/week @ 2024-05-27 1123/week @ 2024-06-03 191/week @ 2024-06-10 21/week @ 2024-06-17

1,340 downloads per month

GPL-3.0 license

500KB
8K SLoC

sn_auditor

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

Usage

Running an auditor instance:

# 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:

  -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

The following env var:

# time in seconds UTXOs are refetched in DAG crawl
UTXO_REATTEMPT_INTERVAL=3600

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 installed
  • to enable the svg-dag feature flag (with cargo run --release --features=svg-dag)

Dependencies

~55–93MB
~2M SLoC