|
@@ -1,7 +1,5 @@
|
|
use futures::Future;
|
|
use futures::Future;
|
|
use nostr_rs_client::{Error as ClientError, Event, Pool};
|
|
use nostr_rs_client::{Error as ClientError, Event, Pool};
|
|
-use nostr_rs_rocksdb::RocksDb;
|
|
|
|
-use nostr_rs_storage_base::Storage;
|
|
|
|
use nostr_rs_types::{client::Subscribe, Request, Response};
|
|
use nostr_rs_types::{client::Subscribe, Request, Response};
|
|
use std::pin::Pin;
|
|
use std::pin::Pin;
|
|
use tokio::sync::mpsc;
|
|
use tokio::sync::mpsc;
|
|
@@ -43,7 +41,6 @@ async fn main() {
|
|
.expect("valid url");
|
|
.expect("valid url");
|
|
|
|
|
|
clients.send(Subscribe::default().into()).await;
|
|
clients.send(Subscribe::default().into()).await;
|
|
- let db = RocksDb::new("./db").expect("db");
|
|
|
|
|
|
|
|
loop {
|
|
loop {
|
|
if let Some((msg, relayed_by)) = clients.recv().await {
|
|
if let Some((msg, relayed_by)) = clients.recv().await {
|
|
@@ -51,8 +48,6 @@ async fn main() {
|
|
Event::Response(r) => match *r {
|
|
Event::Response(r) => match *r {
|
|
Response::Event(x) => {
|
|
Response::Event(x) => {
|
|
println!("{} => {:?}", relayed_by, x);
|
|
println!("{} => {:?}", relayed_by, x);
|
|
- let event = x.event;
|
|
|
|
- db.store(&event).expect("valid");
|
|
|
|
}
|
|
}
|
|
Response::EndOfStoredEvents(_) => {}
|
|
Response::EndOfStoredEvents(_) => {}
|
|
msg => {
|
|
msg => {
|