wallet/ now only dev-depends on core/

This commit is contained in:
Michael Vines 2019-03-16 17:43:39 -07:00
parent ad252fe4c5
commit e2c24481e4
15 changed files with 29 additions and 17 deletions

2
Cargo.lock generated
View File

@ -2135,6 +2135,8 @@ dependencies = [
"jsonrpc-http-server 10.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-http-server 10.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
"reqwest 0.9.11 (registry+https://github.com/rust-lang/crates.io-index)", "reqwest 0.9.11 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_derive 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_json 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)",
"solana-logger 0.13.0", "solana-logger 0.13.0",
"solana-metrics 0.13.0", "solana-metrics 0.13.0",

View File

@ -12,7 +12,10 @@ edition = "2018"
bincode = "1.1.2" bincode = "1.1.2"
bs58 = "0.2.0" bs58 = "0.2.0"
log = "0.4.2" log = "0.4.2"
jsonrpc-core = "10.1.0"
reqwest = "0.9.11" reqwest = "0.9.11"
serde = "1.0.89"
serde_derive = "1.0.88"
serde_json = "1.0.39" serde_json = "1.0.39"
solana-metrics = { path = "../metrics", version = "0.13.0" } solana-metrics = { path = "../metrics", version = "0.13.0" }
solana-netutil = { path = "../netutil", version = "0.13.0" } solana-netutil = { path = "../netutil", version = "0.13.0" }

View File

@ -1,4 +1,8 @@
pub mod client; pub mod client;
pub mod rpc_mock; pub mod rpc_mock;
pub mod rpc_request; pub mod rpc_request;
pub mod rpc_signature_status;
pub mod thin_client; pub mod thin_client;
#[macro_use]
extern crate serde_derive;

View File

@ -1,4 +1,4 @@
//! The `rpc_status` module defines transaction status codes //! The `rpc_signature_status` module defines transaction status codes
use jsonrpc_core::{Error, Result}; use jsonrpc_core::{Error, Result};
use std::str::FromStr; use std::str::FromStr;

View File

@ -21,7 +21,6 @@ use crate::crds_gossip_pull::CRDS_GOSSIP_PULL_CRDS_TIMEOUT_MS;
use crate::crds_value::{CrdsValue, CrdsValueLabel, Vote}; use crate::crds_value::{CrdsValue, CrdsValueLabel, Vote};
use crate::packet::{to_shared_blob, Blob, SharedBlob, BLOB_SIZE}; use crate::packet::{to_shared_blob, Blob, SharedBlob, BLOB_SIZE};
use crate::result::Result; use crate::result::Result;
use crate::rpc_service::RPC_PORT;
use crate::staking_utils; use crate::staking_utils;
use crate::streamer::{BlobReceiver, BlobSender}; use crate::streamer::{BlobReceiver, BlobSender};
use bincode::{deserialize, serialize}; use bincode::{deserialize, serialize};
@ -35,6 +34,7 @@ use solana_netutil::{bind_in_range, bind_to, find_available_port_in_range, multi
use solana_runtime::bloom::Bloom; use solana_runtime::bloom::Bloom;
use solana_sdk::hash::Hash; use solana_sdk::hash::Hash;
use solana_sdk::pubkey::Pubkey; use solana_sdk::pubkey::Pubkey;
use solana_sdk::rpc_port;
use solana_sdk::signature::{Keypair, KeypairUtil, Signable, Signature}; use solana_sdk::signature::{Keypair, KeypairUtil, Signable, Signature};
use solana_sdk::timing::{duration_as_ms, timestamp}; use solana_sdk::timing::{duration_as_ms, timestamp};
use solana_sdk::transaction::Transaction; use solana_sdk::transaction::Transaction;
@ -1436,8 +1436,8 @@ impl Node {
SocketAddr::new(gossip_addr.ip(), tpu_port), SocketAddr::new(gossip_addr.ip(), tpu_port),
SocketAddr::new(gossip_addr.ip(), tpu_via_blobs_port), SocketAddr::new(gossip_addr.ip(), tpu_via_blobs_port),
SocketAddr::new(gossip_addr.ip(), storage_port), SocketAddr::new(gossip_addr.ip(), storage_port),
SocketAddr::new(gossip_addr.ip(), RPC_PORT), SocketAddr::new(gossip_addr.ip(), rpc_port::DEFAULT_RPC_PORT),
SocketAddr::new(gossip_addr.ip(), RPC_PORT + 1), SocketAddr::new(gossip_addr.ip(), rpc_port::DEFAULT_RPC_PUBSUB_PORT),
0, 0,
); );
trace!("new ContactInfo: {:?}", info); trace!("new ContactInfo: {:?}", info);

View File

@ -1,6 +1,6 @@
use crate::rpc_service::RPC_PORT;
use bincode::serialize; use bincode::serialize;
use solana_sdk::pubkey::Pubkey; use solana_sdk::pubkey::Pubkey;
use solana_sdk::rpc_port;
use solana_sdk::signature::{Keypair, KeypairUtil, Signable, Signature}; use solana_sdk::signature::{Keypair, KeypairUtil, Signable, Signature};
use solana_sdk::timing::timestamp; use solana_sdk::timing::timestamp;
use std::cmp::{Ord, Ordering, PartialEq, PartialOrd}; use std::cmp::{Ord, Ordering, PartialEq, PartialOrd};
@ -151,8 +151,8 @@ impl ContactInfo {
let gossip_addr = Self::next_port(&bind_addr, 1); let gossip_addr = Self::next_port(&bind_addr, 1);
let tvu_addr = Self::next_port(&bind_addr, 2); let tvu_addr = Self::next_port(&bind_addr, 2);
let tpu_via_blobs_addr = Self::next_port(&bind_addr, 3); let tpu_via_blobs_addr = Self::next_port(&bind_addr, 3);
let rpc_addr = SocketAddr::new(bind_addr.ip(), RPC_PORT); let rpc_addr = SocketAddr::new(bind_addr.ip(), rpc_port::DEFAULT_RPC_PORT);
let rpc_pubsub_addr = SocketAddr::new(bind_addr.ip(), RPC_PORT + 1); let rpc_pubsub_addr = SocketAddr::new(bind_addr.ip(), rpc_port::DEFAULT_RPC_PUBSUB_PORT);
Self::new( Self::new(
pubkey, pubkey,
gossip_addr, gossip_addr,

View File

@ -56,7 +56,6 @@ pub mod rpc;
pub mod rpc_pubsub; pub mod rpc_pubsub;
pub mod rpc_pubsub_service; pub mod rpc_pubsub_service;
pub mod rpc_service; pub mod rpc_service;
pub mod rpc_status;
pub mod rpc_subscriptions; pub mod rpc_subscriptions;
pub mod service; pub mod service;
pub mod sigverify; pub mod sigverify;

View File

@ -2,12 +2,12 @@
use crate::cluster_info::ClusterInfo; use crate::cluster_info::ClusterInfo;
use crate::packet::PACKET_DATA_SIZE; use crate::packet::PACKET_DATA_SIZE;
use crate::rpc_status::RpcSignatureStatus;
use crate::storage_stage::StorageState; use crate::storage_stage::StorageState;
use bincode::{deserialize, serialize}; use bincode::{deserialize, serialize};
use bs58; use bs58;
use jsonrpc_core::{Error, ErrorCode, Metadata, Result}; use jsonrpc_core::{Error, ErrorCode, Metadata, Result};
use jsonrpc_derive::rpc; use jsonrpc_derive::rpc;
use solana_client::rpc_signature_status::RpcSignatureStatus;
use solana_drone::drone::request_airdrop_transaction; use solana_drone::drone::request_airdrop_transaction;
use solana_runtime::bank::{self, Bank}; use solana_runtime::bank::{self, Bank};
use solana_sdk::account::Account; use solana_sdk::account::Account;

View File

@ -1,12 +1,12 @@
//! The `pubsub` module implements a threaded subscription service on client RPC request //! The `pubsub` module implements a threaded subscription service on client RPC request
use crate::rpc_status::RpcSignatureStatus;
use crate::rpc_subscriptions::RpcSubscriptions; use crate::rpc_subscriptions::RpcSubscriptions;
use bs58; use bs58;
use jsonrpc_core::{Error, ErrorCode, Result}; use jsonrpc_core::{Error, ErrorCode, Result};
use jsonrpc_derive::rpc; use jsonrpc_derive::rpc;
use jsonrpc_pubsub::typed::Subscriber; use jsonrpc_pubsub::typed::Subscriber;
use jsonrpc_pubsub::{Session, SubscriptionId}; use jsonrpc_pubsub::{Session, SubscriptionId};
use solana_client::rpc_signature_status::RpcSignatureStatus;
use solana_sdk::account::Account; use solana_sdk::account::Account;
use solana_sdk::pubkey::Pubkey; use solana_sdk::pubkey::Pubkey;
use solana_sdk::signature::Signature; use solana_sdk::signature::Signature;

View File

@ -13,8 +13,6 @@ use std::sync::{Arc, RwLock};
use std::thread::{self, sleep, Builder, JoinHandle}; use std::thread::{self, sleep, Builder, JoinHandle};
use std::time::Duration; use std::time::Duration;
pub const RPC_PORT: u16 = 8899;
pub struct JsonRpcService { pub struct JsonRpcService {
thread_hdl: JoinHandle<()>, thread_hdl: JoinHandle<()>,
pub request_processor: Arc<RwLock<JsonRpcRequestProcessor>>, // Used only by tests... pub request_processor: Arc<RwLock<JsonRpcRequestProcessor>>, // Used only by tests...

View File

@ -1,11 +1,11 @@
//! The `pubsub` module implements a threaded subscription service on client RPC request //! The `pubsub` module implements a threaded subscription service on client RPC request
use crate::rpc_status::RpcSignatureStatus;
use bs58; use bs58;
use core::hash::Hash; use core::hash::Hash;
use jsonrpc_core::futures::Future; use jsonrpc_core::futures::Future;
use jsonrpc_pubsub::typed::Sink; use jsonrpc_pubsub::typed::Sink;
use jsonrpc_pubsub::SubscriptionId; use jsonrpc_pubsub::SubscriptionId;
use solana_client::rpc_signature_status::RpcSignatureStatus;
use solana_runtime::bank::{self, Bank}; use solana_runtime::bank::{self, Bank};
use solana_sdk::account::Account; use solana_sdk::account::Account;
use solana_sdk::pubkey::Pubkey; use solana_sdk::pubkey::Pubkey;

View File

@ -8,6 +8,7 @@ pub mod native_loader;
pub mod native_program; pub mod native_program;
pub mod packet; pub mod packet;
pub mod pubkey; pub mod pubkey;
pub mod rpc_port;
pub mod shortvec; pub mod shortvec;
pub mod signature; pub mod signature;
pub mod system_instruction; pub mod system_instruction;

5
sdk/src/rpc_port.rs Normal file
View File

@ -0,0 +1,5 @@
/// Default port number for JSON RPC API
pub const DEFAULT_RPC_PORT: u16 = 8899;
/// Default port number for JSON RPC pubsub
pub const DEFAULT_RPC_PUBSUB_PORT: u16 = 8900;

View File

@ -16,7 +16,6 @@ chrono = { version = "0.4.0", features = ["serde"] }
dirs = "1.0.5" dirs = "1.0.5"
log = "0.4.2" log = "0.4.2"
serde_json = "1.0.39" serde_json = "1.0.39"
solana = { path = "../core", version = "0.13.0" }
solana-budget-api = { path = "../programs/budget_api", version = "0.13.0" } solana-budget-api = { path = "../programs/budget_api", version = "0.13.0" }
solana-client = { path = "../client", version = "0.13.0" } solana-client = { path = "../client", version = "0.13.0" }
solana-drone = { path = "../drone", version = "0.13.0" } solana-drone = { path = "../drone", version = "0.13.0" }
@ -27,6 +26,7 @@ solana-vote-signer = { path = "../vote-signer", version = "0.13.0" }
[dev-dependencies] [dev-dependencies]
solana-budget-program = { path = "../programs/budget", version = "0.13.0" } solana-budget-program = { path = "../programs/budget", version = "0.13.0" }
solana = { path = "../core", version = "0.13.0" }
[features] [features]
cuda = ["solana/cuda"] cuda = ["solana/cuda"]

View File

@ -5,8 +5,6 @@ use clap::ArgMatches;
use log::*; use log::*;
use serde_json; use serde_json;
use serde_json::json; use serde_json::json;
use solana::rpc_service::RPC_PORT;
use solana::rpc_status::RpcSignatureStatus;
use solana_budget_api; use solana_budget_api;
use solana_budget_api::budget_transaction::BudgetTransaction; use solana_budget_api::budget_transaction::BudgetTransaction;
#[cfg(test)] #[cfg(test)]
@ -14,6 +12,7 @@ use solana_client::rpc_mock::{request_airdrop_transaction, MockRpcClient as RpcC
#[cfg(not(test))] #[cfg(not(test))]
use solana_client::rpc_request::RpcClient; use solana_client::rpc_request::RpcClient;
use solana_client::rpc_request::{get_rpc_request_str, RpcRequest}; use solana_client::rpc_request::{get_rpc_request_str, RpcRequest};
use solana_client::rpc_signature_status::RpcSignatureStatus;
#[cfg(not(test))] #[cfg(not(test))]
use solana_drone::drone::request_airdrop_transaction; use solana_drone::drone::request_airdrop_transaction;
use solana_drone::drone::DRONE_PORT; use solana_drone::drone::DRONE_PORT;
@ -21,6 +20,7 @@ use solana_sdk::bpf_loader;
use solana_sdk::hash::Hash; use solana_sdk::hash::Hash;
use solana_sdk::loader_transaction::LoaderTransaction; use solana_sdk::loader_transaction::LoaderTransaction;
use solana_sdk::pubkey::Pubkey; use solana_sdk::pubkey::Pubkey;
use solana_sdk::rpc_port::DEFAULT_RPC_PORT;
use solana_sdk::signature::{Keypair, KeypairUtil, Signature}; use solana_sdk::signature::{Keypair, KeypairUtil, Signature};
use solana_sdk::system_transaction::SystemTransaction; use solana_sdk::system_transaction::SystemTransaction;
use solana_sdk::timing::{DEFAULT_TICKS_PER_SLOT, NUM_TICKS_PER_SECOND}; use solana_sdk::timing::{DEFAULT_TICKS_PER_SLOT, NUM_TICKS_PER_SECOND};
@ -111,7 +111,7 @@ impl Default for WalletConfig {
id: Keypair::new(), id: Keypair::new(),
rpc_client: None, rpc_client: None,
rpc_host: None, rpc_host: None,
rpc_port: RPC_PORT, rpc_port: DEFAULT_RPC_PORT,
rpc_tls: false, rpc_tls: false,
} }
} }