Skip to content

Commit

Permalink
Move stuff around
Browse files Browse the repository at this point in the history
  • Loading branch information
ebatsell committed Aug 20, 2024
1 parent 9fa8b58 commit 8cc7612
Show file tree
Hide file tree
Showing 9 changed files with 203 additions and 10 deletions.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions docs/api.md → docs/developers/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ This endpoint allows you to retrieve various events related to the Steward progr

### Endpoint

GET https://kobe.mainnet.jito.network/api/v1/steward_events
`GET https://kobe.mainnet.jito.network/api/v1/steward_events`

### Parameters

Expand Down Expand Up @@ -41,7 +41,7 @@ Updates to overall state:

### Example Request: Get a validator's scores

GET https://kobe.mainnet.jito.network/api/v1/steward_events?vote_account=J1to3PQfXidUUhprQWgdKkQAMWPJAEqSJ7amkBDE9qhF&event_type=ScoreComponents
`GET https://kobe.mainnet.jito.network/api/v1/steward_events?vote_account=J1to3PQfXidUUhprQWgdKkQAMWPJAEqSJ7amkBDE9qhF&event_type=ScoreComponents`

```json
{
Expand Down
4 changes: 3 additions & 1 deletion docs/cli.md → docs/developers/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ title: Parameters

# CLI Commands

Build CLI binary:
Build CLI binary from `/stakenet` directory:

```bash
cargo build -p steward-cli --release
Expand All @@ -26,6 +26,8 @@ cargo build -p steward-cli --release

### View Config

Displays all parameters of this Steward configuration.

```bash
./target/release/steward-cli --program-id Stewardf95sJbmtcZsyagb2dg4Mo8eVQho8gpECvLx8 view-config --steward-config jitoVjT9jRUyeXHzvCwzPgHj7yWNRhLcUoXtes4wtjv
```
Expand Down
160 changes: 160 additions & 0 deletions docs/developers/keeper-bot-quick-start.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
---
layout: default
title: Running a Keeper
---

# Keeper Bot Quick-start

Below are the steps to configuring and running the Stakenet Keeper Bot. We recommend running it as a docker container.

## Setup

### Credentials

In the root directory create a new folder named `credentials` and then populate it with a keypair. This is keypair that signs and pays for all transactions.

```bash
mkdir credentials
solana-keygen new -o ./credentials/keypair.json
```

### ENV

In the root directory create `.env` file

```bash
touch .env
```

Then copy into the `.env` file the contents below. Everything should be set as-is, however you will need to include a `JSON_RPC_URL` that can handle getProgramAccounts calls.

```bash
# RPC URL for the cluster
JSON_RPC_URL="INCLUDE YOUR RPC URL HERE"

# Cluster to specify (mainnet, testnet, devnet)
CLUSTER=mainnet

# Log levels
RUST_LOG="info,solana_gossip=error,solana_metrics=info"

# Path to keypair used to execute tranasactions
KEYPAIR=./credentials/keypair.json

# Validator history program ID (Pubkey as base58 string)
VALIDATOR_HISTORY_PROGRAM_ID=HistoryJTGbKQD2mRgLZ3XhqHnN811Qpez8X9kCcGHoa

# Tip distribution program ID (Pubkey as base58 string)
TIP_DISTRIBUTION_PROGRAM_ID=4R3gSG8BpU4t19KYj8CfnbtRpnT8gtk4dvTHxVRwc2r7

# Steward program ID
STEWARD_PROGRAM_ID=Stewardf95sJbmtcZsyagb2dg4Mo8eVQho8gpECvLx8

# Steward config account for JitoSOL
STEWARD_CONFIG=jitoVjT9jRUyeXHzvCwzPgHj7yWNRhLcUoXtes4wtjv

# Priority Fees in microlamports
PRIORITY_FEES=20000

# Retry count
TX_RETRY_COUNT=100

# Confirmation time after submission
TX_CONFIRMATION_SECONDS=30

# Run flags (true/false)
RUN_CLUSTER_HISTORY=true
RUN_COPY_VOTE_ACCOUNTS=true
RUN_MEV_COMMISSION=true
RUN_MEV_EARNED=true
RUN_STEWARD=true
RUN_EMIT_METRICS=false

# Interval to update Validator History Accounts (in seconds)
VALIDATOR_HISTORY_INTERVAL=300

# Interval to run steward (in seconds)
STEWARD_INTERVAL=301

# Interval to emit metrics (in seconds)
METRICS_INTERVAL=60

# For Oracle Authority Only
RUN_STAKE_UPLOAD=false
RUN_GOSSIP_UPLOAD=false

# Run with the startup flag set to true
FULL_STARTUP=true

# Running with no_pack set to true skips packing the instructions and will cost more
NO_PACK=false

# Pay for new accounts when necessary
PAY_FOR_NEW_ACCOUNTS=false

# Max time in minutes to wait after any fire cycle
COOL_DOWN_RANGE=20

# Metrics upload influx server (optional)
SOLANA_METRICS_CONFIG=""
```

## Running Docker image from source

Once the setup is complete use the following commands to run/manage the docker container:

> Note: We are running `Docker version 24.0.5, build ced0996`
### Start Docker

```bash
docker compose --env-file .env up -d --build stakenet-keeper --remove-orphans
```

### View Logs

```bash
docker logs stakenet-keeper -f
```

### Stop Docker\*\*

```bash
docker stop stakenet-keeper; docker rm stakenet-keeper;
```

## Run from Dockerhub

This image is available on Dockerhub at: https://hub.docker.com/r/jitolabs/stakenet-keeper

```bash
docker pull jitolabs/stakenet-keeper:latest
docker run -d \
--name stakenet-keeper \
--env-file .env \
-v $(pwd)/credentials:/credentials \
--restart on-failure:5 \
jitolabs/stakenet-keeper:latest
```

## Running as Binary

To run the keeper in terminal, build for release and run the program.

### Build for Release

```bash
cargo build --release --bin stakenet-keeper
```

### Run Keeper

```bash
RUST_LOG=info ./target/release/stakenet-keeper
```

To see all available parameters run:

```bash
RUST_LOG=info ./target/release/stakenet-keeper -h
```
8 changes: 8 additions & 0 deletions docs/faq.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
layout: default
title: Steward UI
---

# Validator Frequently Asked Questions

[FAQ in progress]
11 changes: 11 additions & 0 deletions docs/governance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
layout: default
title: StakeNet Governance
---

# StakeNet Governance

JitoSOL was transitioned to management by StakeNet via the JIP-3 proposal. This proposal includes information on the motivation, transition plan, costs, and community discussion.

Proposal: [JIP-3 Forum Post](https://forum.jito.network/t/jip-3-transfer-of-jito-stake-pool-management-to-stakenet-protocol-development/309)
DAO Vote: [JIP-3 Realms](https://gov.jito.network/dao/Jito/proposal/CTaYLKaPw7gexrjp8gi2aDkG8QJuWzqz6LrySCJoRhyt)
18 changes: 11 additions & 7 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,20 @@ _Note: documentation for the Validator History program is a work in progress. Pl

The Steward Program is an Anchor program designed to manage the staking authority for a SPL Stake Pool. Using on-chain [validator history](https://github.com/jito-foundation/stakenet) the steward selects a set of high-performing validators to delegate to, maintains the desired level of stake on those validators over time, and continuously monitors and re-evaluates the validator set at a set cadence. Initially, the validator selection is customized for the JitoSOL stake pool criteria and will be deployed to manage that stake pool. Additionally, the steward surfaces this staking algorithm through variable parameters to be decided by [Jito DAO](https://gov.jito.network/dao/Jito). In turn, this greatly decentralizes the stake pool operations.

The core operations of the Steward Program are permissionless such that any cranker can operate the system. However there are some [admin/management functions](#admin-abilities) that allow for tweaking parameters and system maintenance.
The core operations of the Steward Program are permissionless such that any cranker can operate the system. However there are some admin abilities that allow for tweaking parameters and system maintenance.

## Table of Contents

1. [Terminology](./terminology.md)
2. [Program Overview](program-overview.md)
3. [Parameters](parameters.md)
4. [Command-line interface](./cli.md)
5. [Events API](./api.md)
6. [StakeNet UI](./ui.md)
7. Advanced
- [SPL Stake Pool Internals](developers/spl-stake-pool-internals.md)
- [Validator States](developers/validator-states.md)
4. [StakeNet UI](./ui.md) (work in progress)
5. Developers
- [Command-line interface](developers/cli.md)
- [Events API](developers/api.md)
- [Running a Keeper](developers/keeper-bot-quick-start.md)
6. Advanced Concepts
- [SPL Stake Pool Internals](advanced/spl-stake-pool-internals.md)
- [Validator States](advanced/validator-states.md)
7. [Governance](./governance.md)
8. [Validator FAQ](./faq.md) (work in progress)
8 changes: 8 additions & 0 deletions docs/ui.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
layout: default
title: Steward UI
---

# Steward UI

[Detailed description of the Steward UI in progress. For now, check the tooltips on the website, read Program Overview, and direct questions to Jito Discord.]

0 comments on commit 8cc7612

Please sign in to comment.