diff --git a/.circleci/config.yml b/.circleci/config.yml index 41bbab02f5..3161fe743a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -31,6 +31,9 @@ commands: - run: name: Build miner command: cargo build --release --bin tari_miner + - run: + name: Build wallet FFI + command: cargo build --release --package tari_wallet_ffi - run: name: Run cucumber scenarios no_output_timeout: 20m diff --git a/base_layer/core/tests/chain_storage_tests/chain_backend.rs b/base_layer/core/tests/chain_storage_tests/chain_backend.rs index 6ace36eb98..a3de96d2c6 100644 --- a/base_layer/core/tests/chain_storage_tests/chain_backend.rs +++ b/base_layer/core/tests/chain_storage_tests/chain_backend.rs @@ -33,7 +33,7 @@ use tari_test_utils::paths::create_temporary_data_path; use crate::helpers::database::create_orphan_block; #[test] -fn lmdb_insert_contains_delete_and_fetch_orphan() { +fn test_lmdb_insert_contains_delete_and_fetch_orphan() { let network = Network::LocalNet; let consensus = ConsensusManagerBuilder::new(network).build(); let mut db = create_test_db(); @@ -63,7 +63,7 @@ fn lmdb_insert_contains_delete_and_fetch_orphan() { } #[test] -fn lmdb_file_lock() { +fn test_lmdb_file_lock() { // Create temporary test folder let temp_path = create_temporary_data_path(); diff --git a/base_layer/core/tests/chain_storage_tests/chain_storage.rs b/base_layer/core/tests/chain_storage_tests/chain_storage.rs index 55bd23d082..2b7e872425 100644 --- a/base_layer/core/tests/chain_storage_tests/chain_storage.rs +++ b/base_layer/core/tests/chain_storage_tests/chain_storage.rs @@ -75,7 +75,7 @@ use crate::helpers::{ }; #[test] -fn fetch_nonexistent_header() { +fn test_fetch_nonexistent_header() { let network = Network::LocalNet; let _consensus_manager = ConsensusManagerBuilder::new(network).build(); let store = create_test_blockchain_db(); @@ -84,7 +84,7 @@ fn fetch_nonexistent_header() { } #[test] -fn insert_and_fetch_header() { +fn test_insert_and_fetch_header() { let network = Network::LocalNet; let _consensus_manager = ConsensusManagerBuilder::new(network).build(); let store = create_test_blockchain_db(); @@ -110,7 +110,7 @@ fn insert_and_fetch_header() { } #[test] -fn insert_and_fetch_orphan() { +fn test_insert_and_fetch_orphan() { let network = Network::LocalNet; let consensus_manager = ConsensusManagerBuilder::new(network).build(); let store = create_test_blockchain_db(); @@ -127,7 +127,7 @@ fn insert_and_fetch_orphan() { } #[test] -fn store_and_retrieve_block() { +fn test_store_and_retrieve_block() { let (db, blocks, _, _) = create_new_blockchain(Network::LocalNet); let hash = blocks[0].hash(); // Check the metadata @@ -144,7 +144,7 @@ fn store_and_retrieve_block() { } #[test] -fn add_multiple_blocks() { +fn test_add_multiple_blocks() { // Create new database with genesis block let network = Network::LocalNet; let consensus_manager = ConsensusManagerBuilder::new(network).build(); @@ -201,7 +201,7 @@ fn test_checkpoints() { #[test] #[allow(clippy::identity_op)] -fn rewind_to_height() { +fn test_rewind_to_height() { let _ = env_logger::builder().is_test(true).try_init(); let network = Network::LocalNet; let (mut db, mut blocks, mut outputs, consensus_manager) = create_new_blockchain(network); @@ -277,7 +277,7 @@ fn test_coverage_chain_storage() { } #[test] -fn rewind_past_horizon_height() { +fn test_rewind_past_horizon_height() { let network = Network::LocalNet; let block0 = genesis_block::get_esmeralda_genesis_block(); let consensus_manager = ConsensusManagerBuilder::new(network).with_block(block0.clone()).build(); @@ -320,7 +320,7 @@ fn rewind_past_horizon_height() { } #[test] -fn handle_tip_reorg() { +fn test_handle_tip_reorg() { // GB --> A1 --> A2(Low PoW) [Main Chain] // \--> B2(Highest PoW) [Forked Chain] // Initially, the main chain is GB->A1->A2. B2 has a higher accumulated PoW and when B2 is added the main chain is @@ -388,7 +388,7 @@ fn handle_tip_reorg() { #[test] #[allow(clippy::identity_op)] #[allow(clippy::too_many_lines)] -fn handle_reorg() { +fn test_handle_reorg() { // GB --> A1 --> A2 --> A3 -----> A4(Low PoW) [Main Chain] // \--> B2 --> B3(?) --> B4(Medium PoW) [Forked Chain 1] // \-----> C4(Highest PoW) [Forked Chain 2] @@ -561,7 +561,7 @@ fn handle_reorg() { #[test] #[allow(clippy::too_many_lines)] -fn reorgs_should_update_orphan_tips() { +fn test_reorgs_should_update_orphan_tips() { // Create a main chain GB -> A1 -> A2 // Create an orphan chain GB -> B1 // Add a block B2 that forces a reorg to B2 @@ -810,7 +810,7 @@ fn reorgs_should_update_orphan_tips() { } #[test] -fn handle_reorg_with_no_removed_blocks() { +fn test_handle_reorg_with_no_removed_blocks() { // GB --> A1 // \--> B2 (?) --> B3) // Initially, the main chain is GB->A1 with orphaned blocks B3. When B2 arrives late and is @@ -883,7 +883,7 @@ fn handle_reorg_with_no_removed_blocks() { } #[test] -fn handle_reorg_failure_recovery() { +fn test_handle_reorg_failure_recovery() { // GB --> A1 --> A2 --> A3 -----> A4(Low PoW) [Main Chain] // \--> B2 --> B3(double spend - rejected by db) [Forked Chain 1] // \--> B2 --> B3'(validation failed) [Forked Chain 1] @@ -1002,7 +1002,7 @@ fn handle_reorg_failure_recovery() { } #[test] -fn store_and_retrieve_blocks() { +fn test_store_and_retrieve_blocks() { let validators = Validators::new( MockValidator::new(true), MockValidator::new(true), @@ -1064,7 +1064,7 @@ fn store_and_retrieve_blocks() { #[test] #[allow(clippy::identity_op)] -fn store_and_retrieve_blocks_from_contents() { +fn test_store_and_retrieve_blocks_from_contents() { let network = Network::LocalNet; let (mut db, mut blocks, mut outputs, consensus_manager) = create_new_blockchain(network); @@ -1102,7 +1102,7 @@ fn store_and_retrieve_blocks_from_contents() { } #[test] -fn restore_metadata_and_pruning_horizon_update() { +fn test_restore_metadata_and_pruning_horizon_update() { // Perform test let validators = Validators::new( MockValidator::new(true), @@ -1177,7 +1177,7 @@ fn restore_metadata_and_pruning_horizon_update() { } static EMISSION: [u64; 2] = [10, 10]; #[test] -fn invalid_block() { +fn test_invalid_block() { let factories = CryptoFactories::default(); let network = Network::LocalNet; let consensus_constants = ConsensusConstantsBuilder::new(network) @@ -1278,7 +1278,7 @@ fn invalid_block() { } #[test] -fn orphan_cleanup_on_block_add() { +fn test_orphan_cleanup_on_block_add() { let network = Network::LocalNet; let consensus_manager = ConsensusManagerBuilder::new(network).build(); let validators = Validators::new( @@ -1345,7 +1345,7 @@ fn orphan_cleanup_on_block_add() { } #[test] -fn horizon_height_orphan_cleanup() { +fn test_horizon_height_orphan_cleanup() { let network = Network::LocalNet; let block0 = genesis_block::get_esmeralda_genesis_block(); let consensus_manager = ConsensusManagerBuilder::new(network).with_block(block0.clone()).build(); @@ -1405,7 +1405,7 @@ fn horizon_height_orphan_cleanup() { #[test] #[allow(clippy::too_many_lines)] -fn orphan_cleanup_on_reorg() { +fn test_orphan_cleanup_on_reorg() { // Create Main Chain let network = Network::LocalNet; let factories = CryptoFactories::default(); @@ -1541,7 +1541,7 @@ fn orphan_cleanup_on_reorg() { } #[test] -fn orphan_cleanup_delete_all_orphans() { +fn test_orphan_cleanup_delete_all_orphans() { let path = create_temporary_data_path(); let network = Network::LocalNet; let consensus_manager = ConsensusManagerBuilder::new(network).build(); @@ -1644,7 +1644,7 @@ fn orphan_cleanup_delete_all_orphans() { } #[test] -fn fails_validation() { +fn test_fails_validation() { let network = Network::LocalNet; let factories = CryptoFactories::default(); let consensus_constants = ConsensusConstantsBuilder::new(network).build(); @@ -1755,8 +1755,7 @@ mod malleability { // This test hightlights that the "version" field is not being included in the input hash // so a consensus change is needed for the input to include it #[test] - #[ignore] - fn version() { + fn test_version() { check_input_malleability(|block: &mut Block| { let input = &mut block.body.inputs_mut()[0]; let mod_version = match input.version { @@ -1768,7 +1767,7 @@ mod malleability { } #[test] - fn spent_output() { + fn test_spent_output() { check_input_malleability(|block: &mut Block| { // to modify the spent output, we will substitue it for a copy of a different output // we will use one of the outputs of the current transaction @@ -1789,7 +1788,7 @@ mod malleability { } #[test] - fn input_data() { + fn test_input_data() { check_input_malleability(|block: &mut Block| { block.body.inputs_mut()[0] .input_data @@ -1799,7 +1798,7 @@ mod malleability { } #[test] - fn script_signature() { + fn test_script_signature() { check_input_malleability(|block: &mut Block| { let input = &mut block.body.inputs_mut()[0]; input.script_signature = ComSignature::default(); @@ -1811,7 +1810,7 @@ mod malleability { use super::*; #[test] - fn version() { + fn test_version() { check_output_malleability(|block: &mut Block| { let output = &mut block.body.outputs_mut()[0]; let mod_version = match output.version { @@ -1823,7 +1822,7 @@ mod malleability { } #[test] - fn features() { + fn test_features() { check_output_malleability(|block: &mut Block| { let output = &mut block.body.outputs_mut()[0]; output.features.maturity += 1; @@ -1831,7 +1830,7 @@ mod malleability { } #[test] - fn commitment() { + fn test_commitment() { check_output_malleability(|block: &mut Block| { let output = &mut block.body.outputs_mut()[0]; let mod_commitment = &output.commitment + &output.commitment; @@ -1840,7 +1839,7 @@ mod malleability { } #[test] - fn proof() { + fn test_proof() { check_witness_malleability(|block: &mut Block| { let output = &mut block.body.outputs_mut()[0]; let mod_proof = RangeProof::from_hex(&(output.proof.to_hex() + "00")).unwrap(); @@ -1849,7 +1848,7 @@ mod malleability { } #[test] - fn script() { + fn test_script() { check_output_malleability(|block: &mut Block| { let output = &mut block.body.outputs_mut()[0]; let mut script_bytes = output.script.to_bytes(); @@ -1862,8 +1861,7 @@ mod malleability { // This test hightlights that the "sender_offset_public_key" field is not being included in the output hash // so a consensus change is needed for the output to include it #[test] - #[ignore] - fn sender_offset_public_key() { + fn test_sender_offset_public_key() { check_output_malleability(|block: &mut Block| { let output = &mut block.body.outputs_mut()[0]; @@ -1874,7 +1872,7 @@ mod malleability { } #[test] - fn metadata_signature() { + fn test_metadata_signature() { check_witness_malleability(|block: &mut Block| { let output = &mut block.body.outputs_mut()[0]; output.metadata_signature = ComSignature::default(); @@ -1882,7 +1880,7 @@ mod malleability { } #[test] - fn covenant() { + fn test_covenant() { check_output_malleability(|block: &mut Block| { let output = &mut block.body.outputs_mut()[0]; let mod_covenant = covenant!(absolute_height(@uint(42))); @@ -1901,7 +1899,7 @@ mod malleability { // the "features" field has only a constant value at the moment, so no malleability test possible #[test] - fn fee() { + fn test_fee() { check_kernel_malleability(|block: &mut Block| { let kernel = &mut block.body.kernels_mut()[0]; kernel.fee += MicroTari::from(1); @@ -1909,7 +1907,7 @@ mod malleability { } #[test] - fn lock_height() { + fn test_lock_height() { check_kernel_malleability(|block: &mut Block| { let kernel = &mut block.body.kernels_mut()[0]; kernel.lock_height += 1; @@ -1917,7 +1915,7 @@ mod malleability { } #[test] - fn excess() { + fn test_excess() { check_kernel_malleability(|block: &mut Block| { let kernel = &mut block.body.kernels_mut()[0]; let mod_excess = &kernel.excess + &kernel.excess; @@ -1926,7 +1924,7 @@ mod malleability { } #[test] - fn excess_sig() { + fn test_excess_sig() { check_kernel_malleability(|block: &mut Block| { let kernel = &mut block.body.kernels_mut()[0]; // "gerate_keys" should return a group of random keys, different from the ones in the field @@ -1939,7 +1937,7 @@ mod malleability { #[allow(clippy::identity_op)] #[test] -fn fetch_deleted_position_block_hash() { +fn test_fetch_deleted_position_block_hash() { // Create Main Chain let network = Network::LocalNet; let (mut store, mut blocks, mut outputs, consensus_manager) = create_new_blockchain(network); diff --git a/infrastructure/storage/tests/lmdb.rs b/infrastructure/storage/tests/lmdb.rs index 38441e39e0..45740521c7 100644 --- a/infrastructure/storage/tests/lmdb.rs +++ b/infrastructure/storage/tests/lmdb.rs @@ -118,7 +118,7 @@ fn insert_all_users(name: &str) -> (Vec, LMDBDatabase) { } #[test] -fn single_thread() { +fn test_single_thread() { { let users = load_users(); let env = init("single_thread").unwrap(); @@ -136,7 +136,7 @@ fn single_thread() { } #[test] -fn multi_thread() { +fn test_multi_thread() { { let users_arc = Arc::new(load_users()); let env = init("multi_thread").unwrap(); @@ -167,7 +167,7 @@ fn multi_thread() { } #[test] -fn transactions() { +fn test_transactions() { { let (users, db) = insert_all_users("transactions"); // Test the `exists` and value retrieval functions @@ -186,7 +186,7 @@ fn transactions() { /// Simultaneous writes in different threads #[test] #[allow(clippy::same_item_push)] -fn multi_thread_writes() { +fn test_multi_thread_writes() { { let env = init("multi-thread-writes").unwrap(); let mut threads = Vec::new(); @@ -220,7 +220,7 @@ fn multi_thread_writes() { /// Multiple write transactions in a single thread #[test] -fn multi_writes() { +fn test_multi_writes() { { let env = init("multi-writes").unwrap(); for i in 0..2 { @@ -241,7 +241,7 @@ fn multi_writes() { } #[test] -fn pair_iterator() { +fn test_pair_iterator() { { let (users, db) = insert_all_users("pair_iterator"); let res = db.for_each::(|pair| { @@ -256,7 +256,7 @@ fn pair_iterator() { } #[test] -fn exists_and_delete() { +fn test_exists_and_delete() { { let (_, db) = insert_all_users("delete"); assert!(db.contains_key(&525u64).unwrap()); @@ -267,7 +267,7 @@ fn exists_and_delete() { } #[test] -fn lmdb_resize_on_create() { +fn test_lmdb_resize_on_create() { let db_env_name = "resize"; { let path = get_path(db_env_name); diff --git a/integration_tests/config/config.toml b/integration_tests/config/config.toml deleted file mode 100644 index 569d3b05c8..0000000000 --- a/integration_tests/config/config.toml +++ /dev/null @@ -1,380 +0,0 @@ -######################################################################################################################## -# # -# Common Configuration Options # -# # -######################################################################################################################## - -[common] -#override_from="dibbler" -#base_path="/.tari" -#data_dir="data" - -[auto_update] -# This interval in seconds to check for software updates. Setting this to 0 disables checking. -check_interval = 300 - -[dibbler.auto_update] -# Customize the hosts that are used to check for updates. These hosts must contain update information in DNS TXT records. -update_uris = ["updates.dibbler.taripulse.com"] -# Customize the location of the update SHA hashes and maintainer-signed signature. -# "auto_update.hashes_url" = "https://
/hashes.txt" -# "auto_update.hashes_sig_url" = "https://
/hashes.txt.sig" - -[metrics] -# server_bind_address = "127.0.0.1:5577" -# push_endpoint = http://localhost:9091/metrics/job/base-node -# Configuration options for dibbler testnet - -[dibbler.p2p.seeds] -dns_seeds = ["seeds.dibbler.tari.com"] -peer_seeds = [ - # 333388d1cbe3e2bd17453d052f - "c2eca9cf32261a1343e21ed718e79f25bfc74386e9305350b06f62047f519347::/onion3/6yxqk2ybo43u73ukfhyc42qn25echn4zegjpod2ccxzr2jd5atipwzqd:18141", - # 555575715a49fc242d756e52ca - "42fcde82b44af1de95a505d858cb31a422c56c4ac4747fbf3da47d648d4fc346::/onion3/2l3e7ysmihc23zybapdrsbcfg6omtjtfkvwj65dstnfxkwtai2fawtyd:18141", - # 77771f53be07fab4be5f1e1ff7 - "50e6aa8f6c50f1b9d9b3d438dfd2a29cfe1f3e3a650bd9e6b1e10f96b6c38f4d::/onion3/7s6y3cz5bnewlj5ypm7sekhgvqjyrq4bpaj5dyvvo7vxydj7hsmyf5ad:18141", - # 9999016f1f3a6162dddf5a45aa - "36a9df45e1423b5315ffa7a91521924210c8e1d1537ad0968450f20f21e5200d::/onion3/v24qfheti2rztlwzgk6v4kdbes3ra7mo3i2fobacqkbfrk656e3uvnid:18141", - # bbbb8358387d81c388fadb4649 - "be128d570e8ec7b15c101ee1a56d6c56dd7d109199f0bd02f182b71142b8675f::/onion3/ha422qsy743ayblgolui5pg226u42wfcklhc5p7nbhiytlsp4ir2syqd:18141", - # eeeeb0a943ed143e613a135392 - "3e0321c0928ca559ab3c0a396272dfaea705efce88440611a38ff3898b097217::/onion3/sl5ledjoaisst6d4fh7kde746dwweuge4m4mf5nkzdhmy57uwgtb7qqd:18141", - # 66664a0f95ce468941bb9de228 - "b0f797e7413b39b6646fa370e8394d3993ead124b8ba24325c3c07a05e980e7e::/ip4/35.177.93.69/tcp/18189", - # 22221bf814d5e524fce9ba5787 - "0eefb45a4de9484eca74846a4f47d2c8d38e76be1fec63b0112bd00d297c0928::/ip4/13.40.98.39/tcp/18189", - # 4444a0efd8388739d563bdd979 - "544ed2baed414307e119d12894e27f9ddbdfa2fd5b6528dc843f27903e951c30::/ip4/13.40.189.176/tcp/18189" -] - -######################################################################################################################## -# # -# Base Node Configuration Options # -# # -######################################################################################################################## - -# If you are not running a Tari Base node, you can simply leave everything in this section commented out. Base nodes -# help maintain the security of the Tari token and are the surest way to preserve your privacy and be 100% sure that -# no-one is cheating you out of your money. - -[base_node] -# Selected network -network = "dibbler" -# The socket to expose for the gRPC base node server -grpc_address = "/ip4/127.0.0.1/tcp/18142" - -# Spin up and use a built-in Tor instance. This only works on macos/linux and you must comment out tor_control_address below. -# This requires that the base node was built with the optional "libtor" feature flag. -#use_libtor = true - -[dibbler.base_node] -# A path to the file that stores your node identity and secret key -identity_file = "config/base_node_id_dibbler.json" - -[base_node.p2p] -# The node's publicly-accessible hostname. This is the host name that is advertised on the network so that -# peers can find you. -# _NOTE_: If using the `tor` transport type, public_address will be ignored and an onion address will be -# automatically configured -public_address = "/ip4/172.2.3.4/tcp/18189" - -# Optionally bind an additional TCP socket for inbound Tari P2P protocol commms. -# Use cases include: -# - allowing wallets to locally connect to their base node, rather than through tor, when used in conjunction with `tor_proxy_bypass_addresses` -# - multiple P2P addresses, one public over DNS and one private over TOR -# - a "bridge" between TOR and TCP-only nodes -# auxiliary_tcp_listener_address = "/ip4/127.0.0.1/tcp/9998" - -[base_node.p2p.transport] -# -------------- Transport configuration -------------- -# Use TCP to connect to the Tari network. This transport can only communicate with TCP/IP addresses, so peers with -# e.g. tor onion addresses will not be contactable. -#transport = "tcp" -# The address and port to listen for peer connections over TCP. -tcp.listener_address = "/ip4/0.0.0.0/tcp/18189" -# Configures a tor proxy used to connect to onion addresses. All other traffic uses direct TCP connections. -# This setting is optional however, if it is not specified, this node will not be able to connect to nodes that -# only advertise an onion address. -tcp.tor_socks_address = "/ip4/127.0.0.1/tcp/36050" -tcp.tor_socks_auth = "none" - -# # Configures the node to run over a tor hidden service using the Tor proxy. This transport recognises ip/tcp, -# # onion v2, onion v3 and dns addresses. -#type = "tor" -# Address of the tor control server -tor.control_address = "/ip4/127.0.0.1/tcp/9051" -# Authentication to use for the tor control server -tor.control_auth = "none" # or "password=xxxxxx" -# The onion port to use. -tor.onion_port = 18141 -# When these peer addresses are encountered when dialing another peer, the tor proxy is bypassed and the connection is made -# directly over TCP. /ip4, /ip6, /dns, /dns4 and /dns6 are supported. -tor.proxy_bypass_addresses = [] -#tor.proxy_bypass_addresses = ["/dns4/my-foo-base-node/tcp/9998"] -# When using the tor transport and set to true, outbound TCP connections bypass the tor proxy. Defaults to false for better privacy -tor.proxy_bypass_for_outbound_tcp = false - -# Use a SOCKS5 proxy transport. This transport recognises any addresses supported by the proxy. -#type = "socks5" -# The address of the SOCKS5 proxy -# Traffic will be forwarded to tcp.listener_address -socks.proxy_address = "/ip4/127.0.0.1/tcp/9050" -socks.auth = "none" # or "username_password=username:xxxxxxx" - -[base_node.p2p.dht] -auto_join = true -database_url = "base_node_dht.db" -# do we allow test addresses to be accepted like 127.0.0.1 -allow_test_addresses = false - -[base_node.p2p.dht.saf] - -[base_node.lmdb] -#init_size_bytes = 1000000 -#grow_size_bytes = 1600000 -#resize_threshold_bytes = 1600000 - -[base_node.storage] -# Sets the pruning horizon. -#pruning_horizon = 0 -# Set to true to record all reorgs. Recorded reorgs can be viewed using the list-reorgs command. -track_reorgs = true - -######################################################################################################################## -# # -# Wallet Configuration Options # -# # -######################################################################################################################## - -[wallet] -# Override common.network for wallet -override_from = "dibbler" - -# The relative folder to store your local key data and transaction history. DO NOT EVER DELETE THIS FILE unless you -# a) have backed up your seed phrase and -# b) know what you are doing! -db_file = "wallet/wallet.dat" - -# The socket to expose for the gRPC wallet server. This value is ignored if grpc_enabled is false. -grpc_address = "/ip4/127.0.0.1/tcp/18143" - -# Console wallet password -# Should you wish to start your console wallet without typing in your password, the following options are available: -# 1. Start the console wallet with the --password=secret argument, or -# 2. Set the environment variable TARI_WALLET_PASSWORD=secret before starting the console wallet, or -# 3. Set the "password" key in this [wallet] section of the config -# password = "secret" - -# WalletNotify -# Allows you to execute a script or program when these transaction events are received by the console wallet: -# - transaction received -# - transaction sent -# - transaction cancelled -# - transaction mined but unconfirmed -# - transaction mined and confirmed -# An example script is available here: applications/tari_console_wallet/src/notifier/notify_example.sh -# notify = "/path/to/script" - -# This is the timeout period that will be used to monitor TXO queries to the base node (default = 60). Larger values -# are needed for wallets with many (>1000) TXOs to be validated. -#base_node_query_timeout = 180 -# The amount of seconds added to the current time (Utc) which will then be used to check if the message has -# expired or not when processing the message (default = 10800). -#saf_expiry_duration = 10800 -# This is the number of block confirmations required for a transaction to be considered completely mined and -# confirmed. (default = 3) -#transaction_num_confirmations_required = 3 -# This is the timeout period that will be used for base node broadcast monitoring tasks (default = 60) -#transaction_broadcast_monitoring_timeout = 180 -# This is the timeout period that will be used for chain monitoring tasks (default = 60) -#transaction_chain_monitoring_timeout = 60 -# This is the timeout period that will be used for sending transactions directly (default = 20) -#transaction_direct_send_timeout = 180 -# This is the timeout period that will be used for sending transactions via broadcast mode (default = 60) -#transaction_broadcast_send_timeout = 180 -# This is the size of the event channel used to communicate transaction status events to the wallet's UI. A busy console -# wallet doing thousands of bulk payments or used for stress testing needs a fairly big size (>10000) (default = 1000). -#transaction_event_channel_size = 25000 -# This is the size of the event channel used to communicate base node events to the wallet. A busy console -# wallet doing thousands of bulk payments or used for stress testing needs a fairly big size (>3000) (default = 250). -#base_node_event_channel_size = 3500 -# This is the size of the event channel used to communicate output manager events to the wallet. A busy console -# wallet doing thousands of bulk payments or used for stress testing needs a fairly big size (>3000) (default = 250). -#output_manager_event_channel_size = 3500 -# This is the size of the event channel used to communicate base node update events to the wallet. A busy console -# wallet doing thousands of bulk payments or used for stress testing needs a fairly big size (>300) (default = 50). -#base_node_update_publisher_channel_size = 500 -# If a large amount of tiny valued uT UTXOs are used as inputs to a transaction, the fee may be larger than -# the transaction amount. Set this value to `false` to allow spending of "dust" UTXOs for small valued -# transactions (default = true). -#prevent_fee_gt_amount = false -# This option specifies the transaction routing mechanism as being directly between wallets, making -# use of store and forward or using any combination of these. -# (options: "DirectOnly", "StoreAndForwardOnly", DirectAndStoreAndForward". default: "DirectAndStoreAndForward"). -#transaction_routing_mechanism = "DirectAndStoreAndForward" - -# When running the console wallet in command mode, use these values to determine what "stage" and timeout to wait -# for sent transactions. -# The stages are: -# - "DirectSendOrSaf" - The transaction was initiated and was accepted via Direct Send or Store And Forward. -# - "Negotiated" - The recipient replied and the transaction was negotiated. -# - "Broadcast" - The transaction was broadcast to the base node mempool. -# - "MinedUnconfirmed" - The transaction was successfully detected as mined but unconfirmed on the blockchain. -# - "Mined" - The transaction was successfully detected as mined and confirmed on the blockchain. - -# The default values are: "Broadcast", 300 -#command_send_wait_stage = "Broadcast" -#command_send_wait_timeout = 300 - -# The base nodes that the wallet should use for service requests and tracking chain state. -# base_node_service_peers = ["public_key::net_address", ...] -# base_node_service_peers = ["e856839057aac496b9e25f10821116d02b58f20129e9b9ba681b830568e47c4d::/onion3/exe2zgehnw3tvrbef3ep6taiacr6sdyeb54be2s25fpru357r4skhtad:18141"] - -# Configuration for the wallet's base node service -# The refresh interval, defaults to 10 seconds -#base_node_service_refresh_interval = 30 -# The maximum age of service requests in seconds, requests older than this are discarded -#base_node_service_request_max_age = 180 - -#[base_node.transport.tor] -#control_address = "/ip4/127.0.0.1/tcp/9051" -#control_auth_type = "none" # or "password" -# Required for control_auth_type = "password" -#control_auth_password = "super-secure-password" - -[wallet.p2p] - -[wallet.p2p.transport] -# # Configures the node to run over a tor hidden service using the Tor proxy. This transport recognises ip/tcp, -# # onion v2, onion v3 and dns addresses. -type = "tor" -# Address of the tor control server -tor.control_address = "/ip4/127.0.0.1/tcp/9051" -# Authentication to use for the tor control server -tor.control_auth = "none" # or "password=xxxxxx" -# The onion port to use. -tor.onion_port = 18141 -# When these peer addresses are encountered when dialing another peer, the tor proxy is bypassed and the connection is made -# directly over TCP. /ip4, /ip6, /dns, /dns4 and /dns6 are supported. -tor.proxy_bypass_addresses = [] -# When using the tor transport and set to true, outbound TCP connections bypass the tor proxy. Defaults to false for better privacy -tor.proxy_bypass_for_outbound_tcp = false - -[dibbler.wallet] -network = "dibbler" - - - -######################################################################################################################## -# # -# Miner Configuration Options # -# # -######################################################################################################################## - -[miner] -# Number of mining threads -# Default: number of logical CPU cores -#num_mining_threads=8 - -# GRPC address of base node -#base_node_grpc_address = "127.0.0.1:18142" - -# GRPC address of console wallet -#wallet_grpc_address = "127.0.0.1:18143" - -# Start mining only when base node is bootstrapped -# and current block height is on the tip of network -# Default: true -#mine_on_tip_only=true - -# Will check tip with node every N seconds and restart mining -# if height already taken and option `mine_on_tip_only` is set -# to true -# Default: 30 seconds -#validate_tip_timeout_sec=30 - -# Stratum Mode configuration -# mining_pool_address = "miningcore.tari.com:3052" -# mining_wallet_address = "YOUR_WALLET_PUBLIC_KEY" -# mining_worker_name = "worker1" - -######################################################################################################################## -# # -# Merge Mining Configuration Options # -# # -######################################################################################################################## - -[merge_mining_proxy] -#override_from = "dibbler" -monerod_url = [# stagenet - "http://stagenet.xmr-tw.org:38081", - "http://stagenet.community.xmr.to:38081", - "http://monero-stagenet.exan.tech:38081", - "http://xmr-lux.boldsuck.org:38081", - "http://singapore.node.xmr.pm:38081", -] -base_node_grpc_address = "/ip4/127.0.0.1/tcp/18142" -console_wallet_grpc_address = "/ip4/127.0.0.1/tcp/18143" - -# Address of the tari_merge_mining_proxy application -listener_address = "/ip4/127.0.0.1/tcp/18081" - -# In sole merged mining, the block solution is usually submitted to the Monero blockchain -# (monerod) as well as to the Tari blockchain, then this setting should be "true". With pool -# merged mining, there is no sense in submitting the solution to the Monero blockchain as the -# pool does that, then this setting should be "false". (default = true). -submit_to_origin = true - -# The merge mining proxy can either wait for the base node to achieve initial sync at startup before it enables mining, -# or not. If merge mining starts before the base node has achieved initial sync, those Tari mined blocks will not be -# accepted. (Default value = true; will wait for base node initial sync). -#wait_for_initial_sync_at_startup = true - -# Monero auth params -monerod_username = "" -monerod_password = "" -monerod_use_auth = false - -#[dibbler.merge_mining_proxy] -# Put any network specific settings here - - - -######################################################################################################################## -# # -# Validator Node Configuration Options # -# # -######################################################################################################################## - -[validator_node] - -phase_timeout = 30 - -# If set to false, there will be no scanning at all. -scan_for_assets = true -# How often do we want to scan the base layer for changes. -new_asset_scanning_interval = 10 -# If set then only the specific assets will be checked. -# assets_allow_list = [""] - - -constitution_auto_accept = false -constitution_management_polling_interval_in_seconds = 10 -constitution_management_polling_interval = 5 -constitution_management_confirmation_time = 50 -######################################################################################################################## -# # -# Collectibles Configuration Options # -# # -######################################################################################################################## - -[collectibles] -# GRPC address of validator node -#validator_node_grpc_address = "/ip4/127.0.0.1/tcp/18144" - -# GRPC address of base node -#base_node_grpc_address = "/ip4/127.0.0.1/tcp/18142" - -# GRPC address of wallet -#wallet_grpc_address = "/ip4/127.0.0.1/tcp/18143" diff --git a/integration_tests/cucumber.js b/integration_tests/cucumber.js index 544030439c..5b5dd3baf7 100644 --- a/integration_tests/cucumber.js +++ b/integration_tests/cucumber.js @@ -1,8 +1,7 @@ module.exports = { - default: - "--tags 'not @long-running and not @wallet-ffi and not @broken' --fail-fast", + default: "--tags 'not @long-running and not @wallet-ffi and not @broken' ", none: " ", - ci: "--tags '@critical and not @long-running and not @broken ' --fail-fast", + ci: "--tags '@critical and not @long-running and not @broken '", critical: "--format @cucumber/pretty-formatter --tags @critical", "non-critical": "--tags 'not @critical and not @long-running and not @broken'", diff --git a/integration_tests/features/BaseNodeAutoUpdate.feature b/integration_tests/features/BaseNodeAutoUpdate.feature deleted file mode 100644 index bc05149f8f..0000000000 --- a/integration_tests/features/BaseNodeAutoUpdate.feature +++ /dev/null @@ -1,15 +0,0 @@ -# Copyright 2022 The Tari Project -# SPDX-License-Identifier: BSD-3-Clause - -@auto_update -Feature: AutoUpdate - - @broken - Scenario: Auto update finds a new update on base node - Given I have a node NODE_A with auto update enabled - Then NODE_A has a new software update - - @broken - Scenario: Auto update ignores update with invalid signature on base node - Given I have a node NODE_A with auto update configured with a bad signature - Then NODE_A does not have a new software update diff --git a/integration_tests/features/BaseNodeConnectivity.feature b/integration_tests/features/BaseNodeConnectivity.feature index 37300e227a..4dbd112c14 100644 --- a/integration_tests/features/BaseNodeConnectivity.feature +++ b/integration_tests/features/BaseNodeConnectivity.feature @@ -21,13 +21,11 @@ Feature: Base Node Connectivity Then SEED_A is connected to WALLET_A Scenario: Base node lists heights - Given I have 1 seed nodes - And I have a base node N1 connected to all seed nodes + Given I have a seed node N1 When I mine 5 blocks on N1 Then node N1 lists heights 1 to 5 Scenario: Base node lists headers - Given I have 1 seed nodes - And I have a base node BN1 connected to all seed nodes + Given I have a seed node BN1 When I mine 5 blocks on BN1 Then node BN1 lists headers 1 to 5 with correct heights diff --git a/integration_tests/features/WalletAutoUpdate.feature b/integration_tests/features/WalletAutoUpdate.feature deleted file mode 100644 index 2a9d89c000..0000000000 --- a/integration_tests/features/WalletAutoUpdate.feature +++ /dev/null @@ -1,15 +0,0 @@ -# Copyright 2022 The Tari Project -# SPDX-License-Identifier: BSD-3-Clause - -@auto_update -Feature: AutoUpdate - - @broken - Scenario: Auto update finds a new update on wallet - Given I have a wallet WALLET with auto update enabled - Then WALLET has a new software update - - @broken - Scenario: Auto update ignores update with invalid signature on wallet - Given I have a wallet WALLET with auto update configured with a bad signature - Then WALLET does not have a new software update diff --git a/integration_tests/helpers/config.js b/integration_tests/helpers/config.js index a3396eb31d..51ae68f4a7 100644 --- a/integration_tests/helpers/config.js +++ b/integration_tests/helpers/config.js @@ -84,6 +84,9 @@ function baseEnvs(peerSeeds = [], forceSyncPeers = [], _committee = []) { ["localnet.base_node.p2p.dht.flood_ban_max_msg_count"]: "100000", ["localnet.base_node.p2p.dht.database_url"]: "localnet/dht.db", ["localnet.p2p.seeds.dns_seeds_use_dnssec"]: "false", + ["localnet.base_node.lmdb.init_size_bytes"]: 16000000, + ["localnet.base_node.lmdb.grow_size_bytes"]: 16000000, + ["localnet.base_node.lmdb.resize_threshold_bytes"]: 1024, ["localnet.wallet.identity_file"]: "walletid.json", ["localnet.wallet.contacts_auto_ping_interval"]: "5", @@ -101,9 +104,7 @@ function baseEnvs(peerSeeds = [], forceSyncPeers = [], _committee = []) { ["merge_mining_proxy.monerod_use_auth"]: false, ["merge_mining_proxy.monerod_username"]: "", ["merge_mining_proxy.monerod_password"]: "", - // ["localnet.base_node.storage_db_init_size"]: 100000000, - // ["localnet.base_node.storage.db_resize_threshold"]: 10000000, - // ["localnet.base_node.storage.db_grow_size"]: 20000000, + ["merge_mining_proxy.wait_for_initial_sync_at_startup"]: false, ["miner.num_mining_threads"]: "1", ["miner.mine_on_tip_only"]: true, diff --git a/integration_tests/package-lock.json b/integration_tests/package-lock.json index 2dd066682e..403f326a61 100644 --- a/integration_tests/package-lock.json +++ b/integration_tests/package-lock.json @@ -9,13 +9,18 @@ "version": "1.0.0", "license": "ISC", "dependencies": { + "@grpc/grpc-js": "^1.2.3", + "@grpc/proto-loader": "^0.5.5", "archiver": "^5.3.1", "axios": "^0.21.4", "clone-deep": "^4.0.1", "csv-parser": "^3.0.0", "dateformat": "^3.0.3", + "fs": "^0.0.1-security", "glob": "^7.2.3", + "grpc-promise": "^1.4.0", "json5": "^2.2.1", + "path": "^0.12.7", "sha3": "^2.1.3", "tari_crypto": "v0.14.0", "utf8": "^3.0.0", @@ -2332,6 +2337,11 @@ } } }, + "node_modules/fs": { + "version": "0.0.1-security", + "resolved": "https://registry.npmjs.org/fs/-/fs-0.0.1-security.tgz", + "integrity": "sha512-3XY9e1pP0CVEUCdj5BmfIZxRBTSDycnbqhIOGec9QYtmVH2fbLpj86CFWkrNOkt/Fvty4KZG5lTglL9j/gJ87w==" + }, "node_modules/fs-constants": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", @@ -3119,6 +3129,15 @@ "node": ">=6" } }, + "node_modules/path": { + "version": "0.12.7", + "resolved": "https://registry.npmjs.org/path/-/path-0.12.7.tgz", + "integrity": "sha512-aXXC6s+1w7otVF9UletFkFcDsJeO7lSZBPUQhtb5O0xJe8LtYhj/GxldoL09bBj9+ZmE2hNoHqQSFMN5fikh4Q==", + "dependencies": { + "process": "^0.11.1", + "util": "^0.10.3" + } + }, "node_modules/path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", @@ -3187,6 +3206,14 @@ "node": ">=6.0.0" } }, + "node_modules/process": { + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", + "integrity": "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==", + "engines": { + "node": ">= 0.6.0" + } + }, "node_modules/process-nextick-args": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", @@ -3832,6 +3859,14 @@ "resolved": "https://registry.npmjs.org/utf8/-/utf8-3.0.0.tgz", "integrity": "sha512-E8VjFIQ/TyQgp+TZfS6l8yp/xWppSAHzidGiRrqe4bK4XP9pTRyKFgGJpO3SN7zdX4DeomTrwaseCHovfpFcqQ==" }, + "node_modules/util": { + "version": "0.10.4", + "resolved": "https://registry.npmjs.org/util/-/util-0.10.4.tgz", + "integrity": "sha512-0Pm9hTQ3se5ll1XihRic3FDIku70C+iHUdT/W926rSgHV5QgXsYbKZN8MSC3tJtSkhuROzvsQjAaFENRXr+19A==", + "dependencies": { + "inherits": "2.0.3" + } + }, "node_modules/util-arity": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/util-arity/-/util-arity-1.1.0.tgz", @@ -3843,6 +3878,11 @@ "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" }, + "node_modules/util/node_modules/inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha512-x00IRNXNy63jwGkJmzPigoySHbaqpNuzKbBOmzK+g2OdZpQ9w+sxCN+VSB3ja7IAge2OP2qpfxTjeNcyjmW1uw==" + }, "node_modules/uuid": { "version": "3.4.0", "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", @@ -5778,6 +5818,11 @@ "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.8.tgz", "integrity": "sha512-1x0S9UVJHsQprFcEC/qnNzBLcIxsjAV905f/UkQxbclCsoTWlacCNOpQa/anodLl2uaEKFhfWOvM2Qg77+15zA==" }, + "fs": { + "version": "0.0.1-security", + "resolved": "https://registry.npmjs.org/fs/-/fs-0.0.1-security.tgz", + "integrity": "sha512-3XY9e1pP0CVEUCdj5BmfIZxRBTSDycnbqhIOGec9QYtmVH2fbLpj86CFWkrNOkt/Fvty4KZG5lTglL9j/gJ87w==" + }, "fs-constants": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", @@ -6405,6 +6450,15 @@ "callsites": "^3.0.0" } }, + "path": { + "version": "0.12.7", + "resolved": "https://registry.npmjs.org/path/-/path-0.12.7.tgz", + "integrity": "sha512-aXXC6s+1w7otVF9UletFkFcDsJeO7lSZBPUQhtb5O0xJe8LtYhj/GxldoL09bBj9+ZmE2hNoHqQSFMN5fikh4Q==", + "requires": { + "process": "^0.11.1", + "util": "^0.10.3" + } + }, "path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", @@ -6449,6 +6503,11 @@ "fast-diff": "^1.1.2" } }, + "process": { + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", + "integrity": "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==" + }, "process-nextick-args": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", @@ -6956,6 +7015,21 @@ "resolved": "https://registry.npmjs.org/utf8/-/utf8-3.0.0.tgz", "integrity": "sha512-E8VjFIQ/TyQgp+TZfS6l8yp/xWppSAHzidGiRrqe4bK4XP9pTRyKFgGJpO3SN7zdX4DeomTrwaseCHovfpFcqQ==" }, + "util": { + "version": "0.10.4", + "resolved": "https://registry.npmjs.org/util/-/util-0.10.4.tgz", + "integrity": "sha512-0Pm9hTQ3se5ll1XihRic3FDIku70C+iHUdT/W926rSgHV5QgXsYbKZN8MSC3tJtSkhuROzvsQjAaFENRXr+19A==", + "requires": { + "inherits": "2.0.3" + }, + "dependencies": { + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha512-x00IRNXNy63jwGkJmzPigoySHbaqpNuzKbBOmzK+g2OdZpQ9w+sxCN+VSB3ja7IAge2OP2qpfxTjeNcyjmW1uw==" + } + } + }, "util-arity": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/util-arity/-/util-arity-1.1.0.tgz",