Struct ibc_test_framework::chain::driver::ChainDriver
source · pub struct ChainDriver {Show 13 fields
pub chain_type: ChainType,
pub command_path: String,
pub chain_id: ChainId,
pub home_path: String,
pub account_prefix: String,
pub rpc_port: u16,
pub grpc_port: u16,
pub grpc_web_port: u16,
pub p2p_port: u16,
pub pprof_port: u16,
pub tx_config: TxConfig,
pub runtime: Arc<Runtime>,
pub compat_mode: Option<CompatMode>,
}
Expand description
A driver for interacting with a chain full nodes through command line.
The name ChainDriver
is inspired by
WebDriver,
which is the term used to describe programs that control spawning of the
web browsers. In our case, the ChainDriver is used to spawn and manage
chain full nodes.
Currently the ChainDriver
is hardcoded to support only a single version
of Gaia chain. In the future, we will want to turn this into one or more
ChainDriver
traits so that they can be used to spawn multiple chain
implementations other than a single version of Gaia.
Fields§
§chain_type: ChainType
§command_path: String
The filesystem path to the Gaia CLI. Defaults to gaiad
.
chain_id: ChainId
The ID of the chain.
home_path: String
The home directory for the full node to store data files.
account_prefix: String
§rpc_port: u16
The port used for RPC.
grpc_port: u16
The port used for GRPC.
grpc_web_port: u16
§p2p_port: u16
The port used for P2P. (Currently unused other than for setup)
pprof_port: u16
The port used for pprof. (Currently unused other than for setup)
tx_config: TxConfig
§runtime: Arc<Runtime>
§compat_mode: Option<CompatMode>
Implementations§
source§impl ChainDriver
impl ChainDriver
sourcepub fn create(
chain_type: ChainType,
command_path: String,
chain_id: ChainId,
home_path: String,
account_prefix: String,
rpc_port: u16,
grpc_port: u16,
grpc_web_port: u16,
p2p_port: u16,
pprof_port: u16,
runtime: Arc<Runtime>,
native_token: String,
compat_mode: Option<CompatMode>
) -> Result<Self, Error>
pub fn create( chain_type: ChainType, command_path: String, chain_id: ChainId, home_path: String, account_prefix: String, rpc_port: u16, grpc_port: u16, grpc_web_port: u16, p2p_port: u16, pprof_port: u16, runtime: Arc<Runtime>, native_token: String, compat_mode: Option<CompatMode> ) -> Result<Self, Error>
Create a new ChainDriver
sourcepub fn rpc_address(&self) -> String
pub fn rpc_address(&self) -> String
Returns the full URL for the RPC address.
sourcepub fn websocket_address(&self) -> String
pub fn websocket_address(&self) -> String
Returns the full URL for the WebSocket address.
sourcepub fn grpc_address(&self) -> String
pub fn grpc_address(&self) -> String
Returns the full URL for the GRPC address.
sourcepub fn rpc_listen_address(&self) -> String
pub fn rpc_listen_address(&self) -> String
Returns the full URL for the RPC address to listen to when starting the full node.
This is somehow different from rpc_address
as it requires the "tcp://"
scheme.
sourcepub fn grpc_listen_address(&self) -> String
pub fn grpc_listen_address(&self) -> String
Returns the full URL for the GRPC address to listen to when starting the full node.
This is somehow different from grpc_address
as it requires no scheme to be specified.
sourcepub fn query_balance(
&self,
wallet_id: &WalletAddress,
denom: &Denom
) -> Result<Amount, Error>
pub fn query_balance( &self, wallet_id: &WalletAddress, denom: &Denom ) -> Result<Amount, Error>
Query for the balances for a given wallet address and denomination
sourcepub fn assert_eventual_wallet_amount(
&self,
wallet: &WalletAddress,
token: &Token
) -> Result<(), Error>
pub fn assert_eventual_wallet_amount( &self, wallet: &WalletAddress, token: &Token ) -> Result<(), Error>
Assert that a wallet should eventually have the expected amount in the given denomination.
Trait Implementations§
source§impl ChainBootstrapMethodsExt for ChainDriver
impl ChainBootstrapMethodsExt for ChainDriver
source§fn read_file(&self, file_path: &str) -> Result<String, Error>
fn read_file(&self, file_path: &str) -> Result<String, Error>
source§fn write_file(&self, file_path: &str, content: &str) -> Result<(), Error>
fn write_file(&self, file_path: &str, content: &str) -> Result<(), Error>
source§fn update_chain_config(
&self,
file: &str,
cont: impl FnOnce(&mut Value) -> Result<(), Error>
) -> Result<(), Error>
fn update_chain_config( &self, file: &str, cont: impl FnOnce(&mut Value) -> Result<(), Error> ) -> Result<(), Error>
source§fn update_genesis_file(
&self,
file: &str,
cont: impl FnOnce(&mut Value) -> Result<(), Error>
) -> Result<(), Error>
fn update_genesis_file( &self, file: &str, cont: impl FnOnce(&mut Value) -> Result<(), Error> ) -> Result<(), Error>
source§fn add_wallet(&self, wallet_id: &str) -> Result<Wallet, Error>
fn add_wallet(&self, wallet_id: &str) -> Result<Wallet, Error>
source§fn add_genesis_account(
&self,
wallet: &WalletAddress,
amounts: &[&Token]
) -> Result<(), Error>
fn add_genesis_account( &self, wallet: &WalletAddress, amounts: &[&Token] ) -> Result<(), Error>
source§fn add_genesis_validator(
&self,
wallet_id: &WalletId,
token: &Token
) -> Result<(), Error>
fn add_genesis_validator( &self, wallet_id: &WalletId, token: &Token ) -> Result<(), Error>
source§fn collect_gen_txs(&self) -> Result<(), Error>
fn collect_gen_txs(&self) -> Result<(), Error>
gaiad collect-gentxs
to generate the genesis transactions.source§fn start(&self) -> Result<ChildProcess, Error>
fn start(&self) -> Result<ChildProcess, Error>
gaiad start
. Read moresource§fn submit_consumer_chain_proposal(
&self,
consumer_chain_id: &str,
_spawn_time: &str
) -> Result<(), Error>
fn submit_consumer_chain_proposal( &self, consumer_chain_id: &str, _spawn_time: &str ) -> Result<(), Error>
source§fn assert_consumer_chain_proposal_submitted(
&self,
chain_id: &str,
command_path: &str,
home_path: &str,
rpc_listen_address: &str
) -> Result<(), Error>
fn assert_consumer_chain_proposal_submitted( &self, chain_id: &str, command_path: &str, home_path: &str, rpc_listen_address: &str ) -> Result<(), Error>
source§fn assert_consumer_chain_proposal_passed(
&self,
chain_id: &str,
command_path: &str,
home_path: &str,
rpc_listen_address: &str
) -> Result<(), Error>
fn assert_consumer_chain_proposal_passed( &self, chain_id: &str, command_path: &str, home_path: &str, rpc_listen_address: &str ) -> Result<(), Error>
source§fn query_consumer_genesis(
&self,
consumer_chain_driver: &ChainDriver,
consumer_chain_id: &str
) -> Result<(), Error>
fn query_consumer_genesis( &self, consumer_chain_driver: &ChainDriver, consumer_chain_id: &str ) -> Result<(), Error>
source§fn copy_validator_key_pair(
&self,
provider_chain_driver: &ChainDriver
) -> Result<(), Error>
fn copy_validator_key_pair( &self, provider_chain_driver: &ChainDriver ) -> Result<(), Error>
source§impl Clone for ChainDriver
impl Clone for ChainDriver
source§fn clone(&self) -> ChainDriver
fn clone(&self) -> ChainDriver
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ChainDriver
impl Debug for ChainDriver
source§impl ExportEnv for ChainDriver
impl ExportEnv for ChainDriver
source§fn export_env(&self, writer: &mut impl EnvWriter)
fn export_env(&self, writer: &mut impl EnvWriter)
EnvWriter
.Auto Trait Implementations§
impl !RefUnwindSafe for ChainDriver
impl Send for ChainDriver
impl Sync for ChainDriver
impl Unpin for ChainDriver
impl !UnwindSafe for ChainDriver
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request
§impl<D> OwoColorize for D
impl<D> OwoColorize for D
§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where C: Color,
§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where C: Color,
§fn on_yellow<'a>(&'a self) -> BgColorDisplay<'a, Yellow, Self>
fn on_yellow<'a>(&'a self) -> BgColorDisplay<'a, Yellow, Self>
§fn magenta<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>
fn magenta<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>
§fn on_magenta<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
fn on_magenta<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
§fn on_purple<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
fn on_purple<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
§fn default_color<'a>(&'a self) -> FgColorDisplay<'a, Default, Self>
fn default_color<'a>(&'a self) -> FgColorDisplay<'a, Default, Self>
§fn on_default_color<'a>(&'a self) -> BgColorDisplay<'a, Default, Self>
fn on_default_color<'a>(&'a self) -> BgColorDisplay<'a, Default, Self>
§fn bright_black<'a>(&'a self) -> FgColorDisplay<'a, BrightBlack, Self>
fn bright_black<'a>(&'a self) -> FgColorDisplay<'a, BrightBlack, Self>
§fn on_bright_black<'a>(&'a self) -> BgColorDisplay<'a, BrightBlack, Self>
fn on_bright_black<'a>(&'a self) -> BgColorDisplay<'a, BrightBlack, Self>
§fn bright_red<'a>(&'a self) -> FgColorDisplay<'a, BrightRed, Self>
fn bright_red<'a>(&'a self) -> FgColorDisplay<'a, BrightRed, Self>
§fn on_bright_red<'a>(&'a self) -> BgColorDisplay<'a, BrightRed, Self>
fn on_bright_red<'a>(&'a self) -> BgColorDisplay<'a, BrightRed, Self>
§fn bright_green<'a>(&'a self) -> FgColorDisplay<'a, BrightGreen, Self>
fn bright_green<'a>(&'a self) -> FgColorDisplay<'a, BrightGreen, Self>
§fn on_bright_green<'a>(&'a self) -> BgColorDisplay<'a, BrightGreen, Self>
fn on_bright_green<'a>(&'a self) -> BgColorDisplay<'a, BrightGreen, Self>
§fn bright_yellow<'a>(&'a self) -> FgColorDisplay<'a, BrightYellow, Self>
fn bright_yellow<'a>(&'a self) -> FgColorDisplay<'a, BrightYellow, Self>
§fn on_bright_yellow<'a>(&'a self) -> BgColorDisplay<'a, BrightYellow, Self>
fn on_bright_yellow<'a>(&'a self) -> BgColorDisplay<'a, BrightYellow, Self>
§fn bright_blue<'a>(&'a self) -> FgColorDisplay<'a, BrightBlue, Self>
fn bright_blue<'a>(&'a self) -> FgColorDisplay<'a, BrightBlue, Self>
§fn on_bright_blue<'a>(&'a self) -> BgColorDisplay<'a, BrightBlue, Self>
fn on_bright_blue<'a>(&'a self) -> BgColorDisplay<'a, BrightBlue, Self>
§fn bright_magenta<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
fn bright_magenta<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
§fn on_bright_magenta<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
fn on_bright_magenta<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
§fn bright_purple<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
fn bright_purple<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
§fn on_bright_purple<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
fn on_bright_purple<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
§fn bright_cyan<'a>(&'a self) -> FgColorDisplay<'a, BrightCyan, Self>
fn bright_cyan<'a>(&'a self) -> FgColorDisplay<'a, BrightCyan, Self>
§fn on_bright_cyan<'a>(&'a self) -> BgColorDisplay<'a, BrightCyan, Self>
fn on_bright_cyan<'a>(&'a self) -> BgColorDisplay<'a, BrightCyan, Self>
§fn bright_white<'a>(&'a self) -> FgColorDisplay<'a, BrightWhite, Self>
fn bright_white<'a>(&'a self) -> FgColorDisplay<'a, BrightWhite, Self>
§fn on_bright_white<'a>(&'a self) -> BgColorDisplay<'a, BrightWhite, Self>
fn on_bright_white<'a>(&'a self) -> BgColorDisplay<'a, BrightWhite, Self>
§fn blink_fast<'a>(&'a self) -> BlinkFastDisplay<'a, Self>
fn blink_fast<'a>(&'a self) -> BlinkFastDisplay<'a, Self>
§fn strikethrough<'a>(&'a self) -> StrikeThroughDisplay<'a, Self>
fn strikethrough<'a>(&'a self) -> StrikeThroughDisplay<'a, Self>
§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where Color: DynColor,
OwoColorize::fg
or
a color-specific method, such as OwoColorize::green
, Read more§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where Color: DynColor,
OwoColorize::bg
or
a color-specific method, such as OwoColorize::on_yellow
, Read more