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

Add ridcully network as default #2388

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
2 changes: 1 addition & 1 deletion applications/tari_base_node/osx/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ if [ ! "$(uname)" == "Darwin" ]; then
fi

DATA_DIR=${1:-"$HOME/.tari"}
NETWORK=rincewind
NETWORK=ridcully

banner Installing and setting up your Tari Base Node
if [ ! -d "$DATA_DIR/$NETWORK" ]; then
Expand Down
2 changes: 1 addition & 1 deletion applications/tari_base_node/osx/post-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ wget -qO - https://api.ipify.org; echo
torsocks wget -qO - https://api.ipify.org; echo

DATA_DIR=${1:-"$HOME/.tari"}
NETWORK=rincewind
NETWORK=ridcully

banner Installing and setting up your Tari Base Node
if [ ! -d "$DATA_DIR/$NETWORK" ]; then
Expand Down
5 changes: 1 addition & 4 deletions applications/tari_base_node/src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1783,10 +1783,7 @@ impl Parser {
println!("Emoji ID: {}", emoji_id);
println!();
// TODO: Pass the network in as a var
let qr_link = format!(
"tari://rincewind/pubkey/{}",
&wallet_node_identity.public_key().to_hex()
);
let qr_link = format!("tari://ridcully/pubkey/{}", &wallet_node_identity.public_key().to_hex());
let code = QrCode::new(qr_link).unwrap();
let image = code
.render::<unicode::Dense1x2>()
Expand Down
4 changes: 2 additions & 2 deletions base_layer/core/src/base_node/validators/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use super::{header_iter::HeaderIter, ChainBalanceValidator, HeaderValidator};
use crate::{
blocks::{BlockHeader, BlockHeaderValidationError},
chain_storage::DbTransaction,
consensus::{ConsensusManagerBuilder, Network},
consensus::{consensus_constants::ConsensusConstantsBuilder, ConsensusManagerBuilder, Network},
proof_of_work::PowError,
test_helpers::create_mem_db,
transactions::{
Expand All @@ -36,7 +36,7 @@ use crate::{
},
txn_schema,
validation::{Validation, ValidationError},
};use crate::consensus::consensus_constants::ConsensusConstantsBuilder;
};
use tari_crypto::tari_utilities::{epoch_time::EpochTime, Hashable};
use tari_test_utils::unpack_enum;

Expand Down
3 changes: 2 additions & 1 deletion base_layer/core/src/blocks/genesis_block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,8 @@ pub fn get_ridcully_genesis_block_raw() -> Block {
prev_hash: vec![
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
],
timestamp: 1_603_843_200.into(), // 10/28/2020 @ 12:00am (UTC)
//timestamp: 1_603_843_200.into(), // 10/28/2020 @ 12:00am (UTC)
timestamp: 1_603_782_277.into(), //todo remove and swop to top.
output_mr: from_hex("dcc44f39b65e5e1e526887e7d56f7b85e2ea44bd29bc5bc195e6e015d19e1c06").unwrap(),
range_proof_mr: from_hex("e4d7dab49a66358379a901b9a36c10f070aa9d7bdc8ae752947b6fc4e55d255f").unwrap(),
kernel_mr: from_hex("589bc62ac5d9139f921c68b8075c32d8d130024acaf3196d1d6a89df601e2bcf").unwrap(),
Expand Down
2 changes: 1 addition & 1 deletion common/config/presets/tari-sample.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#peer_database = "~/.tari/peers"

[base_node]
network = "rincewind"
network = "ridcully"

[base_node.rincewind]
db_type = "lmdb"
Expand Down
2 changes: 0 additions & 2 deletions common/config/presets/windows.toml
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@ db_type = "lmdb"
#num_mining_threads = 1

# The relative path to store persistent data
data_dir="rincewind"

# When first logging onto the Tari network, you need to find a few peers to bootstrap the process. In the absence of
# any servers, this is a little more challenging than usual. Our best strategy is just to try and connect to the peers
Expand Down Expand Up @@ -286,7 +285,6 @@ db_type = "lmdb"
#num_mining_threads = 1

# The relative path to store persistent data
data_dir="rincewind"

# When first logging onto the Tari network, you need to find a few peers to bootstrap the process. In the absence of
# any servers, this is a little more challenging than usual. Our best strategy is just to try and connect to the peers
Expand Down
482 changes: 29 additions & 453 deletions common/config/tari_config_sample.toml

Large diffs are not rendered by default.

89 changes: 89 additions & 0 deletions common/src/configuration/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,63 @@ pub fn default_config(bootstrap: &ConfigBootstrap) -> Config {
cfg.set_default("base_node.localnet.peer_seeds", Vec::<String>::new())
.unwrap();

//---------------------------------- Ridcully Defaults --------------------------------------------//

cfg.set_default("base_node.ridcully.db_type", "lmdb").unwrap();
cfg.set_default("base_node.ridcully.orphan_storage_capacity", 720)
.unwrap();
cfg.set_default("base_node.ridcully.orphan_db_clean_out_threshold", 0)
.unwrap();
cfg.set_default("base_node.ridcully.pruning_horizon", 0).unwrap();
cfg.set_default("base_node.ridcully.pruned_mode_cleanup_interval", 50)
.unwrap();
cfg.set_default("base_node.ridcully.peer_seeds", Vec::<String>::new())
.unwrap();
cfg.set_default("base_node.ridcully.block_sync_strategy", "ViaBestChainMetadata")
.unwrap();
cfg.set_default(
"base_node.ridcully.data_dir",
default_subdir("ridcully/", Some(&bootstrap.base_path)),
)
.unwrap();
cfg.set_default(
"base_node.ridcully.tor_identity_file",
default_subdir("ridcully/tor.json", Some(&bootstrap.base_path)),
)
.unwrap();
cfg.set_default(
"base_node.ridcully.wallet_identity_file",
default_subdir("ridcully/wallet-identity.json", Some(&bootstrap.base_path)),
)
.unwrap();
cfg.set_default(
"base_node.ridcully.wallet_tor_identity_file",
default_subdir("ridcully/wallet-tor.json", Some(&bootstrap.base_path)),
)
.unwrap();
cfg.set_default(
"base_node.ridcully.identity_file",
default_subdir("ridcully/node_id.json", Some(&bootstrap.base_path)),
)
.unwrap();
cfg.set_default(
"base_node.ridcully.public_address",
format!("{}/tcp/18141", local_ip_addr),
)
.unwrap();

cfg.set_default("base_node.ridcully.grpc_enabled", false).unwrap();
cfg.set_default("base_node.ridcully.grpc_address", "127.0.0.1:18142")
.unwrap();
cfg.set_default("base_node.ridcully.grpc_wallet_address", "127.0.0.1:18143")
.unwrap();
cfg.set_default("base_node.ridcully.enable_mining", false).unwrap();
cfg.set_default("base_node.ridcully.enable_wallet", true).unwrap();
cfg.set_default("base_node.ridcully.num_mining_threads", 1).unwrap();

cfg.set_default("base_node.ridcully.peer_seeds", Vec::<String>::new())
.unwrap();

set_transport_defaults(&mut cfg);
set_merge_mining_defaults(&mut cfg);

Expand All @@ -212,6 +269,20 @@ fn set_merge_mining_defaults(cfg: &mut Config) {
.unwrap();
cfg.set_default("merge_mining_proxy.rincewind.monerod_password", "")
.unwrap();

cfg.set_default(
"merge_mining_proxy.ridcully.monerod_url",
"http://192.110.160.146:38081",
)
.unwrap();
cfg.set_default("merge_mining_proxy.ridcully.proxy_host_address", "127.0.0.1:7878")
.unwrap();
cfg.set_default("merge_mining_proxy.ridcully.monerod_use_auth", "false")
.unwrap();
cfg.set_default("merge_mining_proxy.ridcully.monerod_username", "")
.unwrap();
cfg.set_default("merge_mining_proxy.ridcully.monerod_password", "")
.unwrap();
}

fn set_transport_defaults(cfg: &mut Config) {
Expand Down Expand Up @@ -252,6 +323,24 @@ fn set_transport_defaults(cfg: &mut Config) {
cfg.set_default("base_node.rincewind.socks5_listener_address", "/ip4/0.0.0.0/tcp/18199")
.unwrap();
cfg.set_default("base_node.rincewind.socks5_auth", "none").unwrap();
// ridcully
// Default transport for ridcully is tcp
cfg.set_default("base_node.ridcully.transport", "tcp").unwrap();
cfg.set_default("base_node.ridcully.tcp_listener_address", "/ip4/0.0.0.0/tcp/18189")
.unwrap();

cfg.set_default("base_node.ridcully.tor_control_address", "/ip4/127.0.0.1/tcp/9051")
.unwrap();
cfg.set_default("base_node.ridcully.tor_control_auth", "none").unwrap();
cfg.set_default("base_node.ridcully.tor_forward_address", "/ip4/127.0.0.1/tcp/0")
.unwrap();
cfg.set_default("base_node.ridcully.tor_onion_port", "18141").unwrap();

cfg.set_default("base_node.ridcully.socks5_proxy_address", "/ip4/0.0.0.0/tcp/9150")
.unwrap();
cfg.set_default("base_node.ridcully.socks5_listener_address", "/ip4/0.0.0.0/tcp/18199")
.unwrap();
cfg.set_default("base_node.ridcully.socks5_auth", "none").unwrap();
}

fn get_local_ip() -> Option<Multiaddr> {
Expand Down