Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: move peer dbs into sub folders #4147

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion applications/tari_base_node/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,18 @@ pub struct BaseNodeConfig {

impl Default for BaseNodeConfig {
fn default() -> Self {
let p2p = P2pConfig {
datastore_path: PathBuf::from("peer_db/base_node"),
..Default::default()
};
Self {
override_from: None,
network: Network::LocalNet,
grpc_address: Some("/ip4/127.0.0.1/tcp/18142".parse().unwrap()),
identity_file: PathBuf::from("config/base_node_id.json"),
use_libtor: false,
tor_identity_file: PathBuf::from("config/tor_id.json"),
p2p: P2pConfig::default(),
p2p,
db_type: DatabaseType::Lmdb,
lmdb: Default::default(),
data_dir: PathBuf::from("data/base_node"),
Expand Down
8 changes: 4 additions & 4 deletions applications/tari_validator_node/src/comms.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@ pub async fn build_service_and_comms_stack(
) -> Result<(ServiceHandles, SubscriptionFactory), ExitError> {
let (publisher, peer_message_subscriptions) = pubsub_connector(100, 50);

let mut transport_config = config.validator_node.p2p.transport.clone();
transport_config.tor.identity = load_from_json(&config.validator_node.tor_identity_file)
let mut p2p_config = config.validator_node.p2p.clone();
p2p_config.transport.tor.identity = load_from_json(&config.validator_node.tor_identity_file)
.map_err(|e| ExitError::new(ExitCode::ConfigError, e))?;

let mut handles = StackBuilder::new(shutdown.clone())
.add_initializer(P2pInitializer::new(
config.validator_node.p2p.clone(),
p2p_config.clone(),
config.peer_seeds.clone(),
// TODO: configurable
Network::Dibbler,
Expand All @@ -73,7 +73,7 @@ pub async fn build_service_and_comms_stack(

let comms = setup_p2p_rpc(config, comms, &handles, mempool, db_factory, asset_processor);

let comms = spawn_comms_using_transport(comms, transport_config)
let comms = spawn_comms_using_transport(comms, p2p_config.transport.clone())
.await
.map_err(|e| ExitError::new(ExitCode::ConfigError, format!("Could not spawn using transport: {}", e)))?;

Expand Down
7 changes: 6 additions & 1 deletion applications/tari_validator_node/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ impl ValidatorNodeConfig {

impl Default for ValidatorNodeConfig {
fn default() -> Self {
let p2p = P2pConfig {
datastore_path: PathBuf::from("peer_db/validator_node"),
..Default::default()
};

Self {
override_from: None,
identity_file: PathBuf::from("validator_node_id.json"),
Expand All @@ -98,7 +103,7 @@ impl Default for ValidatorNodeConfig {
data_dir: PathBuf::from("/data/validator_node"),
committee_management_confirmation_time: 10,
committee_management_polling_interval: 5,
p2p: P2pConfig::default(),
p2p,
grpc_address: Some("/ip4/127.0.0.1/tcp/18144".parse().unwrap()),
}
}
Expand Down
6 changes: 5 additions & 1 deletion base_layer/wallet/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,13 @@ pub struct WalletConfig {

impl Default for WalletConfig {
fn default() -> Self {
let p2p = P2pConfig {
datastore_path: PathBuf::from("peer_db/wallet"),
..Default::default()
};
Self {
override_from: None,
p2p: Default::default(),
p2p,
transaction_service_config: Default::default(),
output_manager_service_config: Default::default(),
buffer_size: 100,
Expand Down