Skip to content

Commit

Permalink
chore: update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Shr1ftyy committed Nov 19, 2024
1 parent 0de545f commit 3aafcda
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 16 deletions.
21 changes: 15 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,13 @@ There are three core files.
first_pool = pool_list[0]
first_pool.sync(web3_provider)
match first_pool.pool_type:
case T if T in (POOL_TYPES.STURDY_SILO, POOL_TYPES.AAVE_DEFAULT, POOL_TYPES.AAVE_TARGET, POOL_TYPES.MORPHO):
case T if T in (
POOL_TYPES.STURDY_SILO,
POOL_TYPES.AAVE_DEFAULT,
POOL_TYPES.AAVE_TARGET,
POOL_TYPES.MORPHO,
POOL_TYPES.YEARN_V3,
):
total_assets = first_pool._user_asset_balance
case _:
pass
Expand All @@ -103,11 +109,13 @@ There are three core files.
pool.sync(web3_provider)
total_asset = 0
match pool.pool_type:
case POOL_TYPES.STURDY_SILO:
total_asset += pool._user_deposits
case T if T in (POOL_TYPES.AAVE_DEFAULT, POOL_TYPES.AAVE_TARGET):
total_asset += pool._user_deposits
case POOL_TYPES.MORPHO:
case T if T in (
POOL_TYPES.STURDY_SILO,
POOL_TYPES.AAVE_DEFAULT,
POOL_TYPES.AAVE_TARGET,
POOL_TYPES.MORPHO,
POOL_TYPES.YEARN_V3,
):
total_asset += pool._user_deposits
case _:
pass
Expand All @@ -121,6 +129,7 @@ There are three core files.
challenge_data["user_address"] = global_user_address

return challenge_data

```
Validators can optionally run an API server and sell their bandwidth to outside users to send
their own pools (organic requests) to the subnet. For more information on this process - please read
Expand Down
19 changes: 9 additions & 10 deletions docs/validator.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ You will need `pm2` if you would like to utilize the auto update scripts that co
1. Install [node and npm](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm)
2. Install [pm2](https://pm2.io)

### Creating the database
Used to store api keys (only for organic validators), scoring logs, and "active" miner allocations for scoring

First, [install dbmate](https://github.com/amacneil/dbmate?tab=readme-ov-file#installation). then run the command below
```bash
dbmate --url "sqlite:validator_database.db" up
```


## Running a Validator

Expand Down Expand Up @@ -140,15 +148,6 @@ Where `ID_OR_PROCESS_NAME` is the `name` OR `id` of the process as noted per the

## Selling your bandwidth

### Creating the database
Used to store api keys & scoring logs

First, [install dbmate](https://github.com/amacneil/dbmate?tab=readme-ov-file#installation)

```bash
dbmate --url "sqlite:validator_database.db" up
```

### Managing access

To manage access to the your api server and sell access to anyone you like, using the sturdy-cli is the easiest way.
Expand All @@ -172,7 +171,7 @@ To get more info about that command!
For example:

```bash
sturdy create-key 10 60 test
sturdy create-key --balance 10 --rate-limit-per-minute 60 --name test
```
Creates a test key with a balance of 10 (which corresponds to 10 requests), a rate limit of 60 requests per minute = 1/s, and a name 'test'.

Expand Down

0 comments on commit 3aafcda

Please sign in to comment.