Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimism local testnet setup #196

Open
4 tasks
Lohann opened this issue Oct 12, 2023 · 0 comments
Open
4 tasks

Optimism local testnet setup #196

Lohann opened this issue Oct 12, 2023 · 0 comments
Assignees
Labels

Comments

@Lohann
Copy link
Collaborator

Lohann commented Oct 12, 2023

Feature description
Create a rust crate at chains/optimism/testing/... that manages a local Optimism testnet, below an example of what is expected:

obs: this is just an example, feel free to remove/add fields from those structures as necessary.

/// All settings necessary to configure an arbitrum testnet
pub struct Config {
    /// Base Directory for store temporary files (chain config files, docker volumes, etc).
    pub base_directory: PathBuf;
   
    /// Port where the L2 Optimism node is listening, if none pick a random port
    pub optimism_port: Option<u16>,

    /// Port where the L1 ethereum node is listening, if none pick a random port
    pub ethereum_port: Option<u16>,
    
    /// unlocked accounts which will receive funds.
    pub main_account: Vec<(ethereum_types::Address, ethereum_types::U256)>,
    
    // ...
}

pub struct OptimismEnv {
    // ...
}

impl OptimismEnv {
    /// Starts a new optimism testnet
    pub async new(config: Config) -> Result<Self>;
    
    /// Stop the optimism testnet and cleanup dependencies
    /// ex: stop docker containers, delete temporary files, etc
    pub async cleanup(self) -> Result<()>;
}

Related

This library will be used by the new testing framework: #158

Expected output

  • it correctly starts a new optimism network
  • it correctly cleanup the optimism network
  • Multiple optimism networks can be created simultaneously as long there's no port conflicts.
  • Unit tests covering all basic functionalities
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants