Skip to content
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
4 changes: 3 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,15 @@ jobs:
run: cargo run --package bbuilder run examples/input_polygon.json --dry-run
- name: Test Ethereum example
run: cargo run --package bbuilder run examples/input_ethereum.json --dry-run
- name: Test Tempo example
run: cargo run --package bbuilder run examples/input_tempo.json --dry-run

test-wasm-build:
name: Test WASM build - ${{ matrix.catalog }}
runs-on: ubuntu-latest
strategy:
matrix:
catalog: [catalog-berachain, catalog-ethereum, catalog-polygon]
catalog: [catalog-berachain, catalog-ethereum, catalog-polygon, catalog-tempo]
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
Expand Down
65 changes: 11 additions & 54 deletions Cargo.lock

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

4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ members = [
"crates/cosmos-keys",
"catalog/berachain",
"catalog/ethereum",
"catalog/polygon"
"catalog/polygon",
"catalog/tempo"
]

[workspace.dependencies]
Expand All @@ -28,6 +29,7 @@ cosmos-keys = { path = "crates/cosmos-keys" }
catalog-berachain = { path = "catalog/berachain" }
catalog-ethereum = { path = "catalog/ethereum" }
catalog-polygon = { path = "catalog/polygon" }
catalog-tempo = { path = "catalog/tempo" }

serde = { version = "1.0", features = ["derive"] }
serde_yaml = "0.9.34"
Expand Down
13 changes: 13 additions & 0 deletions catalog/tempo/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[package]
name = "catalog-tempo"
version = "0.1.0"
edition = "2024"

[dependencies]
serde.workspace = true
spec.workspace = true
eyre.workspace = true
getrandom.workspace = true

[lib]
path = "lib.rs"
90 changes: 90 additions & 0 deletions catalog/tempo/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
use serde::Deserialize;
use spec::{Arg, Babel, ComputeResource, Deployment, DeploymentExtension, Manifest, Pod, Spec, Volume};

#[derive(Default, Clone)]
pub enum Chains {
#[default]
Mainnet,
}

#[derive(Default, Deserialize)]
pub struct TempoDeploymentInput {
pub tempo: Tempo,
}

#[derive(Default, Deserialize)]
pub struct TempoDeployment {}

impl Deployment for TempoDeployment {
type Input = TempoDeploymentInput;
type Chains = Chains;

fn manifest(&self, chain: Chains, input: TempoDeploymentInput) -> eyre::Result<Manifest> {
let mut manifest = Manifest::new("tempo".to_string());

let tempo_pod = input.tempo.spec(chain)?;
manifest.add_spec("tempo".to_string(), tempo_pod);

Ok(manifest)
}
}

#[derive(Default, Deserialize)]
pub struct Tempo {}

impl ComputeResource for Tempo {
type Chains = Chains;

fn spec(&self, _chain: Chains) -> eyre::Result<Pod> {
let node = Spec::builder()
.image("ghcr.io/tempo-xyz/tempo")
.tag("1.0.1")
.volume(Volume {
name: "data".to_string(),
path: "/data".to_string(),
})
.arg("node")
.arg("-vvv")
.arg("--follow")
.arg2("--datadir", "/data")
.arg2("--port", "30303")
.arg2("--discovery.addr", "0.0.0.0")
.arg2("--discovery.port", "30303")
.arg("--http")
.arg2("--http.addr", "0.0.0.0")
.arg2(
"--http.port",
Arg::Port {
name: "http".to_string(),
preferred: 8545,
},
)
.arg2("--http.api", "eth,net,web3,txpool,trace")
.arg("--ws")
.arg2("--ws.addr", "0.0.0.0")
.arg2(
"--ws.port",
Arg::Port {
name: "ws".to_string(),
preferred: 8546,
},
)
.arg2("--ws.api", "eth,net,web3,txpool,trace")
.arg2(
"--metrics",
Arg::Port {
name: "metrics".to_string(),
preferred: 9000,
},
)
.with_babel(Babel::new(
"ethereum",
Arg::Ref {
name: "tempo-node".to_string(),
port: "http".to_string(),
},
));

Ok(Pod::default().with_spec("node", node))
}
}
1 change: 1 addition & 0 deletions crates/catalog/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ eyre.workspace = true
catalog-berachain.workspace = true
catalog-ethereum.workspace = true
catalog-polygon.workspace = true
catalog-tempo.workspace = true
2 changes: 2 additions & 0 deletions crates/catalog/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ use spec::{Dep, Deployment, Manifest};
pub use catalog_berachain::BerachainDeployment;
pub use catalog_ethereum::EthereumDeployment;
pub use catalog_polygon::PolygonDeployment;
pub use catalog_tempo::TempoDeployment;

pub fn apply(dep: Dep) -> eyre::Result<Manifest> {
match dep.module.as_str() {
"ethereum" => EthereumDeployment::default().apply(&dep),
"polygon" => PolygonDeployment::default().apply(&dep),
"berachain" => BerachainDeployment::default().apply(&dep),
"tempo" => TempoDeployment::default().apply(&dep),
_ => Err(eyre::eyre!("Unknown module: {}", dep.module)),
}
}
8 changes: 8 additions & 0 deletions examples/input_tempo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "tempo-mainnet",
"chain": "tempo.mainnet",
"module": "tempo",
"args": {
"tempo": {}
}
}
Loading