Skip to content

Commit

Permalink
fixed docker
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian Krueger authored and Christian Krueger committed Aug 1, 2024
1 parent f07ce24 commit 8a95460
Show file tree
Hide file tree
Showing 3 changed files with 100 additions and 0 deletions.
37 changes: 37 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
version: "3"
services:
validator-keeper:
build:
context: .
target: validator-history
container_name: validator-keeper
environment:
- RUST_LOG=${RUST_LOG:-info}
- SOLANA_METRICS_CONFIG=${SOLANA_METRICS_CONFIG}
- JSON_RPC_URL=${JSON_RPC_URL}
- KEYPAIR=${KEYPAIR}
- ORACLE_AUTHORITY_KEYPAIR=${ORACLE_AUTHORITY_KEYPAIR}
- CLUSTER=${CLUSTER}
- VALIDATOR_HISTORY_PROGRAM_ID=${VALIDATOR_HISTORY_PROGRAM_ID}
- TIP_DISTRIBUTION_PROGRAM_ID=${TIP_DISTRIBUTION_PROGRAM_ID}
- STEWARD_PROGRAM_ID=${STEWARD_PROGRAM_ID}
- STEWARD_CONFIG=${STEWARD_CONFIG}
- PRIORITY_FEES=${PRIORITY_FEES}
- RUN_CLUSTER_HISTORY=${RUN_CLUSTER_HISTORY}
- RUN_COPY_VOTE_ACCOUNTS=${RUN_COPY_VOTE_ACCOUNTS}
- RUN_MEV_COMMISSION=${RUN_MEV_COMMISSION}
- RUN_MEV_EARNED=${RUN_MEV_EARNED}
- RUN_STEWARD=${RUN_STEWARD}
- VALIDATOR_HISTORY_INTERVAL=${VALIDATOR_HISTORY_INTERVAL}
- STEWARD_INTERVAL=${STEWARD_INTERVAL}
- METRICS_INTERVAL=${METRICS_INTERVAL}
- RUN_STAKE_UPLOAD=${RUN_STAKE_UPLOAD}
- RUN_GOSSIP_UPLOAD=${RUN_GOSSIP_UPLOAD}
- FULL_STARTUP=${FULL_STARTUP}
- NO_PACK=${NO_PACK}
- PAY_FOR_NEW_ACCOUNTS=${PAY_FOR_NEW_ACCOUNTS}
- COOL_DOWN_RANGE=${COOL_DOWN_RANGE}
- GOSSIP_ENTRYPOINT=${GOSSIP_ENTRYPOINT}
volumes:
- ./credentials:/credentials
restart: on-failure:5
2 changes: 2 additions & 0 deletions keepers/validator-keeper/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,8 @@ async fn main() {
let flag_args = Args::parse();
let run_flags = set_run_flags(&flag_args);

info!("{}\n\n", args.to_string());

set_host_id(format!("{}", args.cluster));

let client = Arc::new(RpcClient::new_with_timeout(
Expand Down
61 changes: 61 additions & 0 deletions keepers/validator-keeper/src/state/keeper_config.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use std::fmt;

use clap::{arg, command, Parser};
use solana_client::nonblocking::rpc_client::RpcClient;
use solana_sdk::{pubkey::Pubkey, signature::Keypair};
Expand Down Expand Up @@ -142,3 +144,62 @@ pub struct Args {
#[arg(long, env, default_value = "20")]
pub cool_down_range: u8,
}

impl fmt::Display for Args {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(
f,
"Stakenet Keeper Configuration:\n\
-------------------------------\n\
JSON RPC URL: {}\n\
Gossip Entrypoint: {:?}\n\
Keypair Path: {:?}\n\
Oracle Authority Keypair Path: {:?}\n\
Validator History Program ID: {}\n\
Tip Distribution Program ID: {}\n\
Steward Program ID: {}\n\
Steward Config: {}\n\
Validator History Interval: {} seconds\n\
Steward Interval: {} seconds\n\
Metrics Interval: {} seconds\n\
Priority Fees: {} microlamports\n\
Cluster: {:?}\n\
Run Cluster History: {}\n\
Run Copy Vote Accounts: {}\n\
Run MEV Commission: {}\n\
Run MEV Earned: {}\n\
Run Stake Upload: {}\n\
Run Gossip Upload: {}\n\
Run Steward: {}\n\
Full Startup: {}\n\
No Pack: {}\n\
Pay for New Accounts: {}\n\
Cool Down Range: {} minutes\n\
-------------------------------",
self.json_rpc_url,
self.gossip_entrypoint,
self.keypair,
self.oracle_authority_keypair,
self.validator_history_program_id,
self.tip_distribution_program_id,
self.steward_program_id,
self.steward_config,
self.validator_history_interval,
self.steward_interval,
self.metrics_interval,
self.priority_fees,
self.cluster,
self.run_cluster_history,
self.run_copy_vote_accounts,
self.run_mev_commission,
self.run_mev_earned,
self.run_stake_upload,
self.run_gossip_upload,
self.run_steward,
self.full_startup,
self.no_pack,
self.pay_for_new_accounts,
self.cool_down_range
)
}
}

0 comments on commit 8a95460

Please sign in to comment.