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

fix beginner setup/instructions for playground config #232

Merged
merged 3 commits into from
Nov 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
version: nightly

- name: Install native dependencies
run: sudo apt-get install -y libsqlite3-dev
run: sudo apt-get update && sudo apt-get install -y libsqlite3-dev

- name: Lint
run: make lint
Expand Down
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,22 @@ You can use [builder-playground](https://github.com/flashbots/builder-playground

First, start [builder-playground](https://github.com/flashbots/builder-playground):

```
```bash
git clone [email protected]:flashbots/builder-playground.git
cd builder-playground
go run main.go
```

Then, run `rbuilder` using the `config-playground.toml` config file:
Next, update `config-playground.toml` with fully-qualified paths for entries containing `$HOME`:

```bash
# replaces '$HOME' with the actual value of "$HOME"
sed -i "s|\$HOME|$HOME|g" config-playground.toml
```

Then run `rbuilder` using the `config-playground.toml` config file:

```bash
cargo run --bin rbuilder run config-playground.toml
```

Expand Down
2 changes: 1 addition & 1 deletion config-playground.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ coinbase_secret_key = "ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf
cl_node_url = ["http://localhost:3500"]
jsonrpc_server_port = 8645
jsonrpc_server_ip = "0.0.0.0"
el_node_ipc_path = "/tmp/reth.ipc"
el_node_ipc_path = "$HOME/.playground/devnet/reth.ipc"
extra_data = "⚡🤖"

dry_run = false
Expand Down
2 changes: 1 addition & 1 deletion crates/rbuilder/src/live_builder/base_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ impl BaseConfig {
watchdog_timeout: self.watchdog_timeout(),
error_storage_path: self.error_storage_path.clone(),
simulation_threads: self.simulation_threads,
order_input_config: OrderInputConfig::from_config(self),
order_input_config: OrderInputConfig::from_config(self)?,
blocks_source: slot_source,
chain_chain_spec: self.chain_spec()?,
provider,
Expand Down
19 changes: 15 additions & 4 deletions crates/rbuilder/src/live_builder/order_input/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,17 +123,20 @@ impl OrderInputConfig {
input_channel_buffer_size,
}
}
pub fn from_config(config: &BaseConfig) -> Self {
OrderInputConfig {

pub fn from_config(config: &BaseConfig) -> eyre::Result<Self> {
let el_node_ipc_path = expand_path(config.el_node_ipc_path.clone())?;

Ok(OrderInputConfig {
ignore_cancellable_orders: config.ignore_cancellable_orders,
ignore_blobs: config.ignore_blobs,
ipc_path: config.el_node_ipc_path.clone(),
ipc_path: el_node_ipc_path,
server_port: config.jsonrpc_server_port,
server_ip: config.jsonrpc_server_ip(),
serve_max_connections: 4096,
results_channel_timeout: Duration::from_millis(50),
input_channel_buffer_size: 10_000,
}
})
}

pub fn default_e2e() -> Self {
Expand Down Expand Up @@ -288,3 +291,11 @@ where

Ok((handle, subscriber))
}

pub fn expand_path(path: PathBuf) -> eyre::Result<PathBuf> {
let path_str = path
.to_str()
.ok_or_else(|| eyre::eyre!("Invalid UTF-8 in path"))?;

Ok(PathBuf::from(shellexpand::full(path_str)?.into_owned()))
}
Loading