Skip to content

Commit

Permalink
Implement Rpc in Fullnode
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyera Eulberg committed Aug 15, 2018
1 parent b112134 commit dee3ad1
Show file tree
Hide file tree
Showing 4 changed files with 232 additions and 222 deletions.
4 changes: 0 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,6 @@ path = "src/bin/keygen.rs"
name = "solana-wallet"
path = "src/bin/wallet.rs"

[[bin]]
name = "solana-json-rpc"
path = "src/bin/json-rpc.rs"

[badges]
codecov = { repository = "solana-labs/solana", branch = "master", service = "github" }

Expand Down
83 changes: 0 additions & 83 deletions src/bin/json-rpc.rs

This file was deleted.

13 changes: 12 additions & 1 deletion src/fullnode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use entry::Entry;
use ledger::read_ledger;
use ncp::Ncp;
use packet::BlobRecycler;
use rpc::{JsonRpcService, RPC_PORT};
use rpu::Rpu;
use service::Service;
use signature::{Keypair, KeypairUtil};
Expand Down Expand Up @@ -190,7 +191,7 @@ impl Fullnode {
let tick_duration = None;
// TODO: To light up PoH, uncomment the following line:
//let tick_duration = Some(Duration::from_millis(1000));

// let node_info = node.data.clone();
let bank = Arc::new(bank);
let mut thread_hdls = vec![];
let rpu = Rpu::new(
Expand All @@ -201,6 +202,11 @@ impl Fullnode {
);
thread_hdls.extend(rpu.thread_hdls());

let mut rpc_addr = node.data.contact_info.ncp;
rpc_addr.set_port(RPC_PORT);
let rpc_service = JsonRpcService::new(bank.clone(), rpc_addr);
thread_hdls.extend(rpc_service.thread_hdls());

let blob_recycler = BlobRecycler::default();
let window =
window::new_window_from_entries(ledger_tail, entry_height, &node.data, &blob_recycler);
Expand Down Expand Up @@ -292,6 +298,11 @@ impl Fullnode {
);
thread_hdls.extend(rpu.thread_hdls());

let mut rpc_addr = node.data.contact_info.ncp;
rpc_addr.set_port(RPC_PORT);
let rpc_service = JsonRpcService::new(bank.clone(), rpc_addr);
thread_hdls.extend(rpc_service.thread_hdls());

let blob_recycler = BlobRecycler::default();
let window =
window::new_window_from_entries(ledger_tail, entry_height, &node.data, &blob_recycler);
Expand Down
Loading

0 comments on commit dee3ad1

Please sign in to comment.