Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add file-based input and output to faucet commands (tari-projec…
…t#6405) Description --- In this PR the following functionality were implemented: - Added file-based I/O to faucet commands - Combined faucet script and metadata signature generation steps - Safe-guarded faucet commands: - wallet will exit immediately afterwards; - faucet commands will only be allowed in command mode. The screen output running the m-of-n spend scenario is shown below. **Step 1 - FaucetGenerateSessionInfo** ``` faucet-generate-session-info --fee-per-gram 5 --commitment b8b0ad44a4ac05d7c383ac6615c0ed7b14d0f25de42210e89f3191e605865361 --output-hash 7018f30e8d6bbdce7d79709db9854589b0b645ed25624bc7a6b1be43a2eded26 --recipient-address f48yg4or3d7AsKhVD5124wSzjEE7A1ZbANhyCsJJdmKF8jcfZCcoWiGRxeyauriwPPTMswxnpdUfdWtQ4qkaDgwPrsk --verify-unspent-outputs Initializing logging according to "node_04\\config\\log4rs_console_wallet.yml" Minotari Console Wallet running... (Command mode started) ============== Command Runner ============== 1. FaucetGenerateSessionInfo(FaucetGenerateSessionInfoArgs { fee_per_gram: MicroMinotari(5), commitment: "b8b0ad44a4ac05d7c383ac6615c0ed7b14d0f25de42210e89f3191e605865361", output_hash: "7018f30e8d6bbdce7d79709db9854589b0b645ed25624bc7a6b1be43a2eded26", recipient_address: Dual(DualAddress { network: Esmeralda, features: TariAddressFeatures(3), public_view_key: 5a658abfa39fb6828b3c267fdfabc4b764aab155d816dfac774649a83649071e, public_spend_key: 7cf45a38904b23ca76ecd95aee5c1742fc1bf6fc0ef8cd6ee2ee28540f9edb40 }), verify_unspent_outputs: true }) Concluded step 1 'faucet-generate-session-info' Your session ID is: 'MakczWU9X2RgPXdz' Your session's output directory is: '<user>\AppData\Local\tari_faucets\MakczWU9X2RgPXdz' Session info saved to: '<user>\AppData\Local\tari_faucets\MakczWU9X2RgPXdz\step_1_session_info.json' Send 'step_1_session_info.json' to parties for step 2 Minotari Console Wallet running... (Command mode completed) Shutting down wallet... Done. ``` **Step 2 - FaucetCreatePartyDetails** ``` faucet-create-party-details --input-file "<user>\AppData\Local\tari_faucets\step_1_session_info.json" --alias alice Initializing logging according to "node_02\\config\\log4rs_console_wallet.yml" Minotari Console Wallet running... (Command mode started) ============== Command Runner ============== 1. FaucetCreatePartyDetails(FaucetCreatePartyDetailsArgs { session_id: "MakczWU9X2RgPXdz", input_file: " <user>\\AppData\\Local\\tari_faucets\\step_1_session_info.json", alias: "alice" }) Concluded step 2 'faucet-create-party-details' Your session's output directory is <user>\AppData\Local\tari_faucets\MakczWU9X2RgPXdz' Session info file '<user>\AppData\Local\tari_faucets\step_1_session_info.json' moved to '<user>\AppData\Local\tari_faucets\MakczWU9X2RgPXdz\step_1_session_info.json' Send 'step_2_for_leader_from_alice.json' to leader for step 3 Minotari Console Wallet running... (Command mode completed) Shutting down wallet... Done. ``` **Step 3 - FaucetEncumberAggregateUtxo** ``` faucet-encumber-aggregate-utxo --session-id MakczWU9X2RgPXdz --input-file-names=step_2_for_leader_from_alice.json Initializing logging according to "node_04\\config\\log4rs_console_wallet.yml" Minotari Console Wallet running... (Command mode started) ============== Command Runner ============== 1. FaucetEncumberAggregateUtxo(FaucetEncumberAggregateUtxoArgs { session_id: "MakczWU9X2RgPXdz", input_file_names: ["step_2_for_leader_from_alice.json"] }) Concluded step 3 'faucet-encumber-aggregate-utxo' Send 'step_3_for_parties.json' to parties for step 4 Minotari Console Wallet running... (Command mode completed) Shutting down wallet... Done. ``` **Step 4 - FaucetCreateInputOutputSigs** ``` faucet-create-input-output-sigs --session-id MakczWU9X2RgPXdz Initializing logging according to "node_02\\config\\log4rs_console_wallet.yml" Minotari Console Wallet running... (Command mode started) ============== Command Runner ============== 1. FaucetCreateInputOutputSigs(FaucetCreateInputOutputSigArgs { session_id: "MakczWU9X2RgPXdz" }) Concluded step 4 'faucet-create-input-output-sigs' Send 'step_4_for_leader_from_alice.json' to leader for step 5 Minotari Console Wallet running... (Command mode completed) Shutting down wallet... Done. ``` **Step 5 - FaucetSpendAggregateUtxo** ``` faucet-spend-aggregate-utxo --session-id MakczWU9X2RgPXdz --input-file-names=step_4_for_leader_from_alice.json Initializing logging according to "node_04\\config\\log4rs_console_wallet.yml" Minotari Console Wallet running... (Command mode started) ============== Command Runner ============== 1. FaucetSpendAggregateUtxo(FaucetSpendAggregateUtxoArgs { session_id: "MakczWU9X2RgPXdz", input_file_names: ["step_4_for_leader_from_alice.json"] }) Concluded step 5 'faucet-spend-aggregate-utxo' Minotari Console Wallet running... (Command mode completed) Shutting down wallet... Done. ``` Motivation and Context --- Manual inputs are cumbersome and prone to errors. How Has This Been Tested? --- System-level testing What process can a PR reviewer use to test or verify this change? --- Review code changes Perform system-level testing <!-- Checklist --> <!-- 1. Is the title of your PR in the form that would make nice release notes? The title, excluding the conventional commit tag, will be included exactly as is in the CHANGELOG, so please think about it carefully. --> Breaking Changes --- - [x] None - [ ] Requires data directory on base node to be deleted - [ ] Requires hard fork - [ ] Other - Please specify <!-- Does this include a breaking change? If so, include this line as a footer --> <!-- BREAKING CHANGE: Description what the user should do, e.g. delete a database, resync the chain -->
- Loading branch information