Skip to content
Draft
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: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ members = [
"hyperdrive/packages/homepage/homepage",
"hyperdrive/packages/hns-indexer/hns-indexer", "hyperdrive/packages/hns-indexer/get-block", "hyperdrive/packages/settings/settings", "hyperdrive/packages/hns-indexer/reset",
"hyperdrive/packages/hns-indexer/node-info", "hyperdrive/packages/hns-indexer/state",
"hyperdrive/packages/hypermap-cacher/hypermap-cacher", "hyperdrive/packages/hypermap-cacher/reset-cache", "hyperdrive/packages/hypermap-cacher/set-nodes",
"hyperdrive/packages/hypermap-cacher/start-providing", "hyperdrive/packages/hypermap-cacher/stop-providing",
"hyperdrive/packages/hypermap-cacher/binding-cacher", "hyperdrive/packages/hypermap-cacher/hypermap-cacher", "hyperdrive/packages/hypermap-cacher/reset-cache",
"hyperdrive/packages/hypermap-cacher/set-nodes", "hyperdrive/packages/hypermap-cacher/start-providing", "hyperdrive/packages/hypermap-cacher/stop-providing",
"hyperdrive/packages/sign/sign",
"hyperdrive/packages/spider/spider",
"hyperdrive/packages/terminal/terminal", "hyperdrive/packages/terminal/add-node-provider", "hyperdrive/packages/terminal/add-rpcurl-provider",
Expand Down
2 changes: 1 addition & 1 deletion hyperdrive/packages/app-store/chain/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ alloy-primitives = "0.8.15"
alloy-sol-types = "0.8.15"
anyhow = "1.0"
bincode = "1.3.3"
hyperware_process_lib = "2.1.0"
hyperware_process_lib = { git = "https://github.com/hyperware-ai/process_lib", rev = "e95ff8d" }
process_macros = "0.1"
rand = "0.8"
serde = { version = "1.0", features = ["derive"] }
Expand Down
2 changes: 1 addition & 1 deletion hyperdrive/packages/hns-indexer/hns-indexer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ anyhow = "1.0"
alloy-primitives = "0.8.15"
alloy-sol-types = "0.8.15"
hex = "0.4.3"
hyperware_process_lib = { version = "2.1.0", features = ["logging"] }
hyperware_process_lib = { git = "https://github.com/hyperware-ai/process_lib", rev = "e95ff8d" , features = ["logging"] }
process_macros = "0.1"
rmp-serde = "1.1.2"
serde = { version = "1.0", features = ["derive"] }
Expand Down
1 change: 1 addition & 0 deletions hyperdrive/packages/hypermap-cacher/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[workspace]
resolver = "2"
members = [
"binding-cacher",
"hypermap-cacher",
"reset-cache",
"set-nodes",
Expand Down
83 changes: 0 additions & 83 deletions hyperdrive/packages/hypermap-cacher/api/hypermap-cacher:sys-v0.wit

This file was deleted.

162 changes: 162 additions & 0 deletions hyperdrive/packages/hypermap-cacher/api/hypermap-cacher:sys-v1.wit
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
interface binding-cacher {
// Metadata associated with a batch of Ethereum logs.
record binding-logs-metadata {
chain-id: string,
from-block: string,
to-block: string,
time-created: string,
created-by: string,
signature: string,
}

// Represents an item in the manifest, detailing a single log cache file.
record binding-manifest-item {
metadata: binding-logs-metadata,
is-empty: bool,
file-hash: string,
file-name: string,
}

// The main manifest structure, listing all available log cache files.
// WIT does not support direct map types, so a list of key-value tuples is used.
record binding-manifest {
// The key is the filename of the log cache.
items: list<tuple<string, binding-manifest-item>>,
manifest-filename: string,
chain-id: string,
protocol-version: string,
}

record binding-get-logs-by-range-request {
from-block: u64,
to-block: option<u64>, // If None, signifies to the latest available/relevant cached block.
}

variant binding-get-logs-by-range-ok-response {
logs(tuple<u64, string>),
latest(u64),
}

// Defines the types of requests that can be sent to the Hypermap Cacher process.
variant binding-cacher-request {
get-manifest,
get-log-cache-content(string),
get-status,
get-logs-by-range(binding-get-logs-by-range-request),
start-providing,
stop-providing,
set-nodes(list<string>),
reset(option<list<string>>),
}

// Represents the operational status of the cacher.
record binding-cacher-status {
last-cached-block: u64,
chain-id: string,
protocol-version: string,
next-cache-attempt-in-seconds: option<u64>,
manifest-filename: string,
log-files-count: u32,
our-address: string,
is-providing: bool,
}

// Defines the types of responses the Hypermap Cacher process can send.
variant binding-cacher-response {
get-manifest(option<binding-manifest>),
get-log-cache-content(result<option<string>, string>),
get-status(binding-cacher-status),
get-logs-by-range(result<binding-get-logs-by-range-ok-response, string>),
start-providing(result<string, string>),
stop-providing(result<string, string>),
set-nodes(result<string, string>),
reset(result<string, string>),
rejected,
is-starting,
}
}

interface hypermap-cacher {
// Metadata associated with a batch of Ethereum logs.
record logs-metadata {
chain-id: string,
from-block: string,
to-block: string,
time-created: string,
created-by: string,
signature: string,
}

// Represents an item in the manifest, detailing a single log cache file.
record manifest-item {
metadata: logs-metadata,
is-empty: bool,
file-hash: string,
file-name: string,
}

// The main manifest structure, listing all available log cache files.
// WIT does not support direct map types, so a list of key-value tuples is used.
record manifest {
// The key is the filename of the log cache.
items: list<tuple<string, manifest-item>>,
manifest-filename: string,
chain-id: string,
protocol-version: string,
}

record get-logs-by-range-request {
from-block: u64,
to-block: option<u64>, // If None, signifies to the latest available/relevant cached block.
}

variant get-logs-by-range-ok-response {
logs(tuple<u64, string>),
latest(u64),
}

// Defines the types of requests that can be sent to the Hypermap Cacher process.
variant cacher-request {
get-manifest,
get-log-cache-content(string),
get-status,
get-logs-by-range(get-logs-by-range-request),
start-providing,
stop-providing,
set-nodes(list<string>),
reset(option<list<string>>),
}

// Represents the operational status of the cacher.
record cacher-status {
last-cached-block: u64,
chain-id: string,
protocol-version: string,
next-cache-attempt-in-seconds: option<u64>,
manifest-filename: string,
log-files-count: u32,
our-address: string,
is-providing: bool,
}

// Defines the types of responses the Hypermap Cacher process can send.
variant cacher-response {
get-manifest(option<manifest>),
get-log-cache-content(result<option<string>, string>),
get-status(cacher-status),
get-logs-by-range(result<get-logs-by-range-ok-response, string>),
start-providing(result<string, string>),
stop-providing(result<string, string>),
set-nodes(result<string, string>),
reset(result<string, string>),
rejected,
is-starting,
}
}

world hypermap-cacher-sys-v1 {
import sign;
import binding-cacher;
import hypermap-cacher;
include process-v1;
}
33 changes: 33 additions & 0 deletions hyperdrive/packages/hypermap-cacher/binding-cacher/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
[package]
name = "binding-cacher"
version = "0.1.0"
edition = "2021"
publish = false

[features]
simulation-mode = ["hyperware_process_lib/simulation-mode"]

[dependencies]
anyhow = "1.0"
alloy-primitives = "0.8.15"
alloy-sol-types = "0.8.15"
alloy = { version = "0.8.1", features = [
"json-rpc",
"rpc-client",
"rpc-types",
] }
chrono = "0.4.41"
hex = "0.4.3"
hyperware_process_lib = { git = "https://github.com/hyperware-ai/process_lib", rev = "e95ff8d", features = ["logging"] }
process_macros = "0.1.0"
rand = "0.8"
rmp-serde = "1.1.2"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
wit-bindgen = "0.42.1"

[lib]
crate-type = ["cdylib"]

[package.metadata.component]
package = "hyperware:process"
Loading