Skip to content

Commit

Permalink
Merge pull request #734 from chainbound/nico/feat/mainnet-genesis-guide
Browse files Browse the repository at this point in the history
feat: initial MG operator guide
  • Loading branch information
merklefruit authored Jan 24, 2025
2 parents 4c1e5e1 + 56dc368 commit 758f64d
Show file tree
Hide file tree
Showing 12 changed files with 1,307 additions and 472 deletions.
2 changes: 1 addition & 1 deletion bolt-cli/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion bolt-cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "bolt"
version = "0.1.2"
version = "0.1.3"
edition = "2021"
description = "CLI for interacting with bolt protocol"
authors = ["Chainbound Developers <[email protected]>"]
Expand Down
61 changes: 47 additions & 14 deletions bolt-cli/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@ use clap::{
};
use reqwest::Url;

use crate::{
common::{keystore::DEFAULT_KEYSTORE_PASSWORD, parse_ether_value},
contracts::EigenLayerStrategy,
};
use crate::common::{keystore::DEFAULT_KEYSTORE_PASSWORD, parse_ether_value};

/// `bolt` is a CLI tool to interact with bolt Protocol ✨
#[derive(Parser, Debug, Clone)]
Expand Down Expand Up @@ -109,7 +106,7 @@ pub struct SendCommand {
///
/// Leaving this empty will default to the canonical bolt RPC URL, which
/// automatically manages increasing nonces on preconfirmed state.
#[clap(long, env = "BOLT_RPC_URL", default_value = "https://rpc-holesky.bolt.chainbound.io")]
#[clap(long, env = "BOLT_RPC_URL", default_value = "https://rpc.holesky.boltprotocol.xyz")]
pub bolt_rpc_url: Url,

/// The private key to sign the transaction with.
Expand Down Expand Up @@ -216,12 +213,13 @@ pub struct OperatorsCommand {
#[derive(Debug, Clone, Parser)]
pub enum OperatorsSubcommand {
/// Commands to interact with EigenLayer and bolt.
#[clap(name = "eigenlayer")] // and not eigen-layer
#[clap(name = "eigenlayer", alias = "el")]
EigenLayer {
#[clap(subcommand)]
subcommand: EigenLayerSubcommand,
},
/// Commands to interact with Symbiotic and bolt.
#[clap(alias = "symb")]
Symbiotic {
#[clap(subcommand)]
subcommand: SymbioticSubcommand,
Expand All @@ -240,9 +238,8 @@ pub enum EigenLayerSubcommand {
operator_private_key: B256,
/// The name of the strategy to deposit into.
#[clap(long, env = "EIGENLAYER_STRATEGY")]
strategy: EigenLayerStrategy,
/// The amount to deposit into the strategy, in units (e.g. '1ether', '10gwei')
/// If no unit is provided, it is assumed to be in wei.
strategy: Address,
/// The amount to deposit into the strategy, in units (e.g. '1ether', '10gwei').
#[clap(long, env = "EIGENLAYER_STRATEGY_DEPOSIT_AMOUNT", value_parser = parse_ether_value)]
amount: U256,
},
Expand All @@ -256,11 +253,17 @@ pub enum EigenLayerSubcommand {
#[clap(long, env = "OPERATOR_PRIVATE_KEY")]
operator_private_key: B256,
/// The URL of the operator RPC.
/// If not provided, the "bolt RPC" URL is used, which is
/// consistent with bolt-sidecars running in "firewall delegation" mode.
#[clap(long, env = "OPERATOR_RPC")]
operator_rpc: Url,
/// The salt for the operator signature.
operator_rpc: Option<Url>,
/// The operator's extra data string to be stored in the registry.
#[clap(long, env = "OPERATOR_EXTRA_DATA")]
extra_data: String,
/// The salt for the operator signature, to prevent replay attacks.
/// If not provided, a random value is used.
#[clap(long, env = "OPERATOR_SIGNATURE_SALT")]
salt: B256,
salt: Option<B256>,
},

/// Deregister an EigenLayer operator from the bolt AVS.
Expand Down Expand Up @@ -288,13 +291,20 @@ pub enum EigenLayerSubcommand {

/// Check the status of an operator in the bolt AVS.
Status {
/// The URL of the RPC to broadcast the transaction.
/// The URL of the RPC to read data from
#[clap(long, env = "RPC_URL")]
rpc_url: Url,
/// The address of the operator to check.
#[clap(long, env = "OPERATOR_ADDRESS")]
address: Address,
},

/// List all whitelisted EigenLayer strategies
ListStrategies {
/// The URL of the RPC to read data from
#[clap(long, env = "RPC_URL")]
rpc_url: Url,
},
}

#[derive(Debug, Clone, Parser)]
Expand All @@ -308,8 +318,13 @@ pub enum SymbioticSubcommand {
#[clap(long, env = "OPERATOR_PRIVATE_KEY")]
operator_private_key: B256,
/// The URL of the operator RPC.
/// If not provided, the "bolt RPC" URL is used, which is
/// consistent with bolt-sidecars running in "firewall delegation" mode.
#[clap(long, env = "OPERATOR_RPC")]
operator_rpc: Url,
operator_rpc: Option<Url>,
/// The operator's extra data string to be stored in the registry.
#[clap(long, env = "OPERATOR_EXTRA_DATA")]
extra_data: String,
},

/// Deregister a Symbiotic operator from bolt.
Expand Down Expand Up @@ -344,6 +359,13 @@ pub enum SymbioticSubcommand {
#[clap(long, env = "OPERATOR_ADDRESS")]
address: Address,
},

/// List all whitelisted Symbiotic vaults
ListVaults {
/// The URL of the RPC to read data from
#[clap(long, env = "RPC_URL")]
rpc_url: Url,
},
}

#[derive(Debug, Clone, Parser)]
Expand Down Expand Up @@ -513,6 +535,17 @@ impl Chain {
}
}

/// Get the bolt RPC URL for the given chain.
///
/// Returns None if bolt RPC is not deployed for the chain.
pub fn bolt_rpc(&self) -> Option<Url> {
match self {
Self::Mainnet => Some(Url::parse("https://rpc.boltprotocol.xyz").unwrap()),
Self::Holesky => Some(Url::parse("https://rpc.holesky.boltprotocol.xyz").unwrap()),
_ => None,
}
}

/// Get the chain ID for the given chain. Returns `None` if the chain ID is not supported.
pub fn from_id(id: u64) -> Option<Self> {
match id {
Expand Down
Loading

0 comments on commit 758f64d

Please sign in to comment.