From 8cc7612d8888951a97c0d33034e677a0e2beffae Mon Sep 17 00:00:00 2001 From: Evan Batsell Date: Tue, 20 Aug 2024 17:48:14 -0400 Subject: [PATCH] Move stuff around --- .../managing-validator-states.md | 0 .../spl-stake-pool-internals.md | 0 docs/{ => developers}/api.md | 4 +- docs/{ => developers}/cli.md | 4 +- docs/developers/keeper-bot-quick-start.md | 160 ++++++++++++++++++ docs/faq.md | 8 + docs/governance.md | 11 ++ docs/index.md | 18 +- docs/ui.md | 8 + 9 files changed, 203 insertions(+), 10 deletions(-) rename docs/{developers => advanced}/managing-validator-states.md (100%) rename docs/{developers => advanced}/spl-stake-pool-internals.md (100%) rename docs/{ => developers}/api.md (93%) rename docs/{ => developers}/cli.md (99%) create mode 100644 docs/developers/keeper-bot-quick-start.md create mode 100644 docs/faq.md create mode 100644 docs/governance.md diff --git a/docs/developers/managing-validator-states.md b/docs/advanced/managing-validator-states.md similarity index 100% rename from docs/developers/managing-validator-states.md rename to docs/advanced/managing-validator-states.md diff --git a/docs/developers/spl-stake-pool-internals.md b/docs/advanced/spl-stake-pool-internals.md similarity index 100% rename from docs/developers/spl-stake-pool-internals.md rename to docs/advanced/spl-stake-pool-internals.md diff --git a/docs/api.md b/docs/developers/api.md similarity index 93% rename from docs/api.md rename to docs/developers/api.md index 449ac302..68aca1df 100644 --- a/docs/api.md +++ b/docs/developers/api.md @@ -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 @@ -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 { diff --git a/docs/cli.md b/docs/developers/cli.md similarity index 99% rename from docs/cli.md rename to docs/developers/cli.md index a94d257f..0dfa3881 100644 --- a/docs/cli.md +++ b/docs/developers/cli.md @@ -16,7 +16,7 @@ title: Parameters # CLI Commands -Build CLI binary: +Build CLI binary from `/stakenet` directory: ```bash cargo build -p steward-cli --release @@ -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 ``` diff --git a/docs/developers/keeper-bot-quick-start.md b/docs/developers/keeper-bot-quick-start.md new file mode 100644 index 00000000..0aef1577 --- /dev/null +++ b/docs/developers/keeper-bot-quick-start.md @@ -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 +``` diff --git a/docs/faq.md b/docs/faq.md new file mode 100644 index 00000000..36727f90 --- /dev/null +++ b/docs/faq.md @@ -0,0 +1,8 @@ +--- +layout: default +title: Steward UI +--- + +# Validator Frequently Asked Questions + +[FAQ in progress] diff --git a/docs/governance.md b/docs/governance.md new file mode 100644 index 00000000..fd057ee4 --- /dev/null +++ b/docs/governance.md @@ -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) diff --git a/docs/index.md b/docs/index.md index 54a40a16..41914578 100644 --- a/docs/index.md +++ b/docs/index.md @@ -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) diff --git a/docs/ui.md b/docs/ui.md index e69de29b..f2f776c5 100644 --- a/docs/ui.md +++ b/docs/ui.md @@ -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.]