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

feat: add file-based input and output to faucet commands #6405

Merged
merged 2 commits into from
Jul 15, 2024

Conversation

hansieodendaal
Copy link
Contributor

@hansieodendaal hansieodendaal commented Jul 15, 2024

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

Breaking Changes

  • None
  • Requires data directory on base node to be deleted
  • Requires hard fork
  • Other - Please specify

- 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.
@hansieodendaal hansieodendaal requested a review from a team as a code owner July 15, 2024 05:40
Copy link

github-actions bot commented Jul 15, 2024

Test Results (CI)

    3 files    111 suites   35m 51s ⏱️
1 295 tests 1 294 ✅ 0 💤 1 ❌
3 673 runs  3 672 ✅ 0 💤 1 ❌

For more details on these failures, see this check.

Results for commit f9acc2c.

♻️ This comment has been updated with latest results.

@ghpbot-tari-project ghpbot-tari-project added P-acks_required Process - Requires more ACKs or utACKs P-reviews_required Process - Requires a review from a lead maintainer to be merged labels Jul 15, 2024
Copy link

github-actions bot commented Jul 15, 2024

Test Results (Integration tests)

 2 files  + 2  11 suites  +11   15m 3s ⏱️ + 15m 3s
35 tests +35  34 ✅ +34  0 💤 ±0  1 ❌ +1 
37 runs  +37  34 ✅ +34  0 💤 ±0  3 ❌ +3 

For more details on these failures, see this check.

Results for commit f9acc2c. ± Comparison against base commit 7d0281b.

♻️ This comment has been updated with latest results.

Copy link
Contributor Author

@hansieodendaal hansieodendaal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • User feedback for FaucetEncumberAggregateUtxo in the wrong scope
  • FaucetCreatePartyDetails can read the session ID from the supplied file, thus it is not needed as a command line argument.

@SWvheerden SWvheerden merged commit 8c6ea82 into tari-project:development Jul 15, 2024
12 of 16 checks passed
@hansieodendaal hansieodendaal deleted the ho_m_of_n_file_io branch July 15, 2024 10:26
sdbondi added a commit to sdbondi/tari that referenced this pull request Jul 22, 2024
* development: (93 commits)
  chore: fix build and osp (tari-project#6415)
  chore: refactor key manager names (tari-project#6411)
  fix: panic in from_base58 fn (tari-project#6414)
  fix: branch keys (tari-project#6413)
  chore: remove dependancy on ledger for common types (tari-project#6412)
  feat: count unique keys (tari-project#6401)
  feat!: fix key manager use of keys (tari-project#6407)
  refactor: remove metadata sig and use difference key branch for offset (tari-project#6400)
  feat: update ledger instructions (tari-project#6406)
  feat: add file-based input and output to faucet commands (tari-project#6405)
  chore: new release v1.0.0-pre.16 (tari-project#6404)
  feat: simplify leader sig generation (tari-project#6399)
  ci(fix): include macOS universal assets in release (tari-project#6402)
  fix: script dependance on party order (tari-project#6398)
  fix: claim n of m faucet (tari-project#6389)
  feat: add ffi features (tari-project#6390)
  chore: fix unwraps in memory key manager (tari-project#6396)
  docs: update hasher documentation (tari-project#6392)
  chore: fix ci (tari-project#6391)
  feat(miner): add SHA P2Pool mining related configuration and changes (tari-project#6370)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P-acks_required Process - Requires more ACKs or utACKs P-reviews_required Process - Requires a review from a lead maintainer to be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants