Skip to content

Commit fdd2e05

Browse files
committed
chore: move blockchain module into event-svc crate
it will require a db connection so this avoids circular deps, plus it doesn't need to be in the validation crate
1 parent 69c12a8 commit fdd2e05

12 files changed

Lines changed: 239 additions & 126 deletions

File tree

Cargo.lock

Lines changed: 227 additions & 116 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ members = [
4242
# e.g. anyhow's backtrace feature.
4343

4444
ahash = "0.8"
45+
alloy = { version = "0.4", features = ["k256", "provider-http", "rpc-types"] }
4546
anyhow = { version = "1" }
4647
arrow = { version = "54", features = ["prettyprint"] }
4748
arrow-array = "54"

event-svc/Cargo.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ repository.workspace = true
88
publish = false
99

1010
[dependencies]
11+
# will probably need contract and signer-local features for self anchoring
12+
alloy.workspace = true
1113
anyhow.workspace = true
1214
async-trait.workspace = true
1315
bytes.workspace = true
@@ -29,10 +31,14 @@ itertools.workspace = true
2931
multihash-codetable.workspace = true
3032
multihash-derive.workspace = true
3133
multihash.workspace = true
34+
lru.workspace = true
35+
once_cell.workspace = true
3236
prometheus-client.workspace = true
3337
recon.workspace = true
38+
reqwest.workspace = true
3439
serde.workspace = true
3540
serde_ipld_dagcbor.workspace = true
41+
ssi.workspace = true
3642
sqlx.workspace = true
3743
thiserror.workspace = true
3844
tokio.workspace = true
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ const BLOCK_CACHE_SIZE: usize = 50;
6060

6161
type Result<T> = std::result::Result<T, Error>;
6262

63-
#[derive(Debug)]
6463
/// Http client to interact with EIP chains
6564
pub struct HttpEthRpc {
6665
chain_id: caip2::ChainId,
File renamed without changes.

event-svc/src/event/validator/event.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ use std::sync::Arc;
22

33
use ceramic_core::{Cid, EventId, NodeId};
44
use ceramic_event::unvalidated;
5-
use ceramic_validation::eth_rpc;
65
use ipld_core::ipld::Ipld;
76
use recon::ReconItem;
87
use tokio::try_join;
98

9+
use crate::blockchain::eth_rpc;
1010
use crate::event::validator::ChainInclusionProvider;
1111
use crate::store::EventAccess;
1212
use crate::{

event-svc/src/event/validator/time.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use ceramic_core::ssi::caip2;
55
use ceramic_event::unvalidated;
66
use tracing::warn;
77

8-
use ceramic_validation::eth_rpc::{self, ChainInclusion, HttpEthRpc};
8+
use crate::blockchain::eth_rpc::{self, ChainInclusion, HttpEthRpc};
99

1010
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1111
pub struct Timestamp(u64);

event-svc/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
//! The Event Service provides an API for ingesting and querying Ceramic Events.
22
#![warn(missing_docs)]
33

4+
mod blockchain;
45
mod error;
56
mod event;
67
pub mod store;
78
#[cfg(test)]
89
mod tests;
910

10-
pub use ceramic_validation::eth_rpc;
11+
pub use blockchain::eth_rpc;
1112
pub use error::Error;
1213
pub use event::ChainInclusionProvider;
1314
pub use event::{BlockStore, EventService, UndeliveredEventReview};

0 commit comments

Comments
 (0)