diff --git a/README.md b/README.md index 48136c0..e57f3e6 100644 --- a/README.md +++ b/README.md @@ -109,7 +109,8 @@ docker run --name zebra-node --network zcash-network -p 18232:18232 qedit/zebra- Here are the 3 options (No parameters will default to the first configuration) ```bash -docker run --network zcash-network -e ZCASH_NODE_ADDRESS=127.0.0.1 -e ZCASH_NODE_PORT=18232 -e ZCASH_NODE_PROTOCOL=http zcash_tx_tool -docker run --network zcash-network -e ZCASH_NODE_ADDRESS=zebra-node -e ZCASH_NODE_PORT=18232 -e ZCASH_NODE_PROTOCOL=http zcash_tx_tool -docker run --network zcash-network -e ZCASH_NODE_ADDRESS= -e ZCASH_NODE_PORT=18232 -e ZCASH_NODE_PROTOCOL=http zcash_tx_tool +docker run -it --network zcash-network -e ZCASH_NODE_ADDRESS=127.0.0.1 -e ZCASH_NODE_PORT=18232 -e ZCASH_NODE_PROTOCOL=http zcash_tx_tool +docker run -it --network zcash-network -e ZCASH_NODE_ADDRESS=zebra-node -e ZCASH_NODE_PORT=18232 -e ZCASH_NODE_PROTOCOL=http zcash_tx_tool +docker run -it --network zcash-network -e ZCASH_NODE_ADDRESS= -e ZCASH_NODE_PORT=18232 -e ZCASH_NODE_PROTOCOL=http zcash_tx_tool ``` +The '-it' parameter was added to allow the demo to be interactive. diff --git a/src/commands/test.rs b/src/commands/test.rs index f1f8a12..50891fd 100644 --- a/src/commands/test.rs +++ b/src/commands/test.rs @@ -12,6 +12,7 @@ use crate::components::rpc_client::reqwest::ReqwestRpcClient; use crate::prelude::*; use crate::components::wallet::Wallet; use crate::config::AppConfig; +use std::io::{self, Write}; /// Run the E2E test @@ -61,6 +62,8 @@ impl Runnable for TestCmd { let mut balances = TestBalances::get(&mut wallet); print_balances("=== Initial balances ===", balances); + pause(); + // --------------------- Shield miner's reward --------------------- let shielding_tx = create_shield_coinbase_tx(miner, coinbase_txid, &mut wallet); @@ -69,6 +72,8 @@ impl Runnable for TestCmd { let expected_delta = TestBalances::new(500_000_000 /*coinbase_reward*/, 0); balances = check_balances("=== Balances after shielding ===", balances, expected_delta, &mut wallet); + pause(); + // --------------------- Create transfer --------------------- let amount_to_transfer_1: i64 = 2; @@ -78,9 +83,18 @@ impl Runnable for TestCmd { let expected_delta = TestBalances::new(-amount_to_transfer_1, amount_to_transfer_1); check_balances("=== Balances after transfer ===", balances, expected_delta, &mut wallet); + + pause(); } } +fn pause() { + print!("Press Enter to continue the demo..."); + io::stdout().flush().unwrap(); + let mut input = String::new(); + io::stdin().read_line(&mut input).unwrap(); +} + fn prepare_test(config: &Reader, wallet: &mut Wallet, rpc_client: &mut ReqwestRpcClient) -> TxId { wallet.reset(); sync_from_height(config.chain.nu5_activation_height, wallet, rpc_client);