Skip to content

Commit

Permalink
Run cargo fix and update readme to remove RocksDB reference
Browse files Browse the repository at this point in the history
  • Loading branch information
haardikk21 committed Dec 10, 2023
1 parent 7b7b20f commit e26c5ac
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 26 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ There are a few things Teleport is currently capable of, and a lot more it is no

- [x] Start a libp2p gossip node and connect to other peers
- [x] Broadcast Gossip Messages to enable features like posting casts
- [-] Do pubsub peer discovery over gossipsub (partial support)
- [-] Do PubSub peer discovery over GossipSub (partial support)

A lot is still left to do:

Expand All @@ -27,7 +27,7 @@ Persistent Storage, handling received messages from peers, and historical data s

- Rust
- Protobufs Compiler (`brew install protobuf` or `apt install -y protobuf-compiler`)
- RocksDB binaries ([Instructions here](https://github.com/facebook/rocksdb/blob/master/INSTALL.md))
- SQLx CLI (`cargo install sqlx-cli`)

## Prost Patch

Expand Down
17 changes: 7 additions & 10 deletions lib/hub/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,12 @@ pub mod storage;
pub mod sync;
pub mod validation;

use ethers::providers::Middleware;


use teleport_common::protobufs::generated::hub_service_server::HubServiceServer;
use teleport_common::protobufs::generated::{cast_add_body, CastId, FarcasterNetwork, PeerIdProto};
use teleport_common::protobufs::{
self,
generated::{HashScheme, SignatureScheme},
};
use teleport_common::time::get_farcaster_time;
use teleport_common::protobufs::generated::{FarcasterNetwork, PeerIdProto};


//use crate::{HubOptions};
use std::fs::{self, canonicalize};
use std::path::PathBuf;
Expand Down Expand Up @@ -90,7 +87,7 @@ async fn main() {

// tokio::time::sleep(std::time::Duration::from_secs(0)).await;

let state = gossip_node.get_state().await.unwrap();
let _state = gossip_node.get_state().await.unwrap();

tokio::time::sleep(std::time::Duration::from_secs(150)).await;

Expand Down Expand Up @@ -128,13 +125,13 @@ fn start(args: teleport_cli::start::StartCommand) {

peer_id = PeerId::random();

let rpc_auth: String;
let _rpc_auth: String;
if args.debugging_options.rpc_auth.is_some() {
} else if std::env::var("RPC_AUTH").is_ok() {
} else {
}

let rpc_rate_limit: i32;
let _rpc_rate_limit: i32;
if args.networking_options.rpc_rate_limit.is_some() {
} else {
}
Expand Down
20 changes: 10 additions & 10 deletions lib/hub/src/p2p/event_loop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ impl EventLoop {
let validator = Validator::new(&message);
match validator.validate() {
Ok(_) => {
let db = self.state.db.as_mut().unwrap();
let _db = self.state.db.as_mut().unwrap();
}
Err(err) => {
println!("Failed to validate message: {:?}", err);
Expand Down Expand Up @@ -299,31 +299,31 @@ impl EventLoop {
SwarmEvent::ConnectionEstablished {
peer_id,
connection_id,
endpoint,
num_established,
concurrent_dial_errors,
established_in,
endpoint: _,
num_established: _,
concurrent_dial_errors: _,
established_in: _,
} => println!("Connection established: {:?}", (peer_id, connection_id)),
SwarmEvent::ConnectionClosed {
peer_id,
connection_id,
endpoint,
num_established,
cause,
endpoint: _,
num_established: _,
cause: _,
} => {
println!("Connection closed: {:?}", (peer_id, connection_id))
}
SwarmEvent::IncomingConnection {
connection_id,
local_addr,
send_back_addr,
send_back_addr: _,
} => {
println!("Incoming connection: {:?}", (connection_id, local_addr))
}
SwarmEvent::IncomingConnectionError {
connection_id,
local_addr,
send_back_addr,
send_back_addr: _,
error,
} => {
println!(
Expand Down
6 changes: 3 additions & 3 deletions lib/hub/src/p2p/gossip_node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use libp2p::{
},
gossipsub::{self, Message as GossipSubMessage, MessageAuthenticity, MessageId},
identify, identity, noise, ping,
swarm::{derive_prelude::Either, SwarmBuilder, SwarmEvent},
swarm::{SwarmBuilder},
Multiaddr, PeerId, Swarm, Transport,
};
use prost::Message;
Expand All @@ -23,11 +23,11 @@ use teleport_common::{
};
use teleport_storage::Store;
use tokio::spawn;
use void::Void;


use super::{
event_loop::{EventLoop, EventLoopState},
gossip_behaviour::{GossipBehaviour, GossipBehaviourEvent},
gossip_behaviour::{GossipBehaviour},
};

const MULTI_ADDR_LOCAL_HOST: &str = "/ip4/127.0.0.1";
Expand Down
2 changes: 1 addition & 1 deletion lib/hub/src/sync/trienode.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use std::collections::HashMap;
use teleport_storage::Store;


enum TrieNodeLike {
Serialized(SerializedTrieNode),
Expand Down

0 comments on commit e26c5ac

Please sign in to comment.