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: export transaction #6111

Merged
merged 2 commits into from Feb 2, 2024

Conversation

SWvheerden
Copy link
Collaborator

Description

Exports a transaction from the wallet to a json file

Motivation and Context

This is the first step in allowing cold wallets to spend outputs while staying offline

How Has This Been Tested?

manual and unit test

@SWvheerden SWvheerden requested a review from a team as a code owner January 31, 2024 11:51
Copy link

Test Results (CI)

1 264 tests   1 264 ✅  13m 57s ⏱️
   39 suites      0 💤
    1 files        0 ❌

Results for commit 0fb0e78.

@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 Jan 31, 2024
Copy link

Test Results (Integration tests)

29 tests   29 ✅  12m 9s ⏱️
11 suites   0 💤
 2 files     0 ❌

Results for commit 0fb0e78.

Copy link
Contributor

@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.

I cannot get this to work either by entering a command

minotari_console_wallet.exe --base-path . --command "export-tx 2444085111639818228 my_test_tx.txt"  --config %cd%\config\config.toml --log-config %cd%\config\log4rs_console_wallet.yml

or

minotari_console_wallet.exe --base-path . --command "export-tx --tx-id 2444085111639818228 --outfile my_test_tx.txt"  --config %cd%\config\config.toml --log-config %cd%\config\log4rs_console_wallet.yml

or by passing a script

export-tx 2444085111639818228 my_test_tx.txt

or

export-tx --tx-id 2444085111639818228 --outfile my_test_tx.txt

@SWvheerden
Copy link
Collaborator Author

SWvheerden commented Feb 2, 2024

You have to run it with:

minotari_console_wallet --command-mode-auto-exit export-tx 17000381040930570644 --output-file pie.txt

@SWvheerden
Copy link
Collaborator Author

Running without file name to print to console
Screenshot 2024-02-02 at 13 58 03

@SWvheerden
Copy link
Collaborator Author

Running this:

./minotari_console_wallet  --command-mode-auto-exit export-tx 16507527571654191849 --output-file pie.txt

gives you this output:



⠀⠀⠀⠀⠀⣠⣶⣿⣿⣿⣿⣶⣦⣀                                                         
⠀⢀⣤⣾⣿⡿⠋⠀⠀⠀⠀⠉⠛⠿⣿⣿⣶⣤⣀⠀⠀⠀⠀⠀⠀⢰⣿⣾⣾⣾⣾⣾⣾⣾⣾⣾⣿⠀⠀⠀⣾⣾⣾⡀⠀⠀⠀⠀⢰⣾⣾⣾⣾⣿⣶⣶⡀⠀⠀⠀⢸⣾⣿⠀
⠀⣿⣿⣿⣿⣿⣶⣶⣤⣄⡀⠀⠀⠀⠀⠀⠉⠛⣿⣿⠀⠀⠀⠀⠀⠈⠉⠉⠉⠉⣿⣿⡏⠉⠉⠉⠉⠀⠀⣰⣿⣿⣿⣿⠀⠀⠀⠀⢸⣿⣿⠉⠉⠉⠛⣿⣿⡆⠀⠀⢸⣿⣿⠀
⠀⣿⣿⠀⠀⠀⠈⠙⣿⡿⠿⣿⣿⣿⣶⣶⣤⣤⣿⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣿⡇⠀⠀⠀⠀⠀⢠⣿⣿⠃⣿⣿⣷⠀⠀⠀⢸⣿⣿⣀⣀⣀⣴⣿⣿⠃⠀⠀⢸⣿⣿⠀
⠀⣿⣿⣤⠀⠀⠀⢸⣿⡟⠀⠀⠀⠀⠀⠉⣽⣿⣿⠟⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣿⡇⠀⠀⠀⠀⠀⣿⣿⣿⣤⣬⣿⣿⣆⠀⠀⢸⣿⣿⣿⣿⣿⡿⠟⠉⠀⠀⠀⢸⣿⣿⠀
⠀⠀⠙⣿⣿⣤⠀⢸⣿⡟⠀⠀⠀⣠⣾⣿⡿⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣿⡇⠀⠀⠀⠀⣾⣿⣿⠿⠿⠿⢿⣿⣿⡀⠀⢸⣿⣿⠙⣿⣿⣿⣄⠀⠀⠀⠀⢸⣿⣿⠀
⠀⠀⠀⠀⠙⣿⣿⣼⣿⡟⣀⣶⣿⡿⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣿⡇⠀⠀⠀⣰⣿⣿⠃⠀⠀⠀⠀⣿⣿⣿⠀⢸⣿⣿⠀⠀⠙⣿⣿⣷⣄⠀⠀⢸⣿⣿⠀
⠀⠀⠀⠀⠀⠀⠙⣿⣿⣿⣿⠛⠀                                                          
⠀⠀⠀⠀⠀⠀⠀⠀⠙⠁⠀                                                            
Console Wallet

Enter wallet passphrase: 
Feb 02 14:00:08.355 [warn] Fixing permissions on directory /var/folders/47/s77gktfj4gj65ddlms6xrghm0000gn/T/.tmpSWt9cV
Minotari Console Wallet running... (Command mode started)
==============
Command Runner
==============

1. ExportTx(ExportTxArgs { tx_id: 16507527571654191849, output_file: Some("pie.txt") })

Minotari Console Wallet running... (Command mode completed)

Shutting down wallet... Done.

And creates this file:

pie.txt

Copy link
Contributor

@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.

ACK

@ghpbot-tari-project ghpbot-tari-project removed the P-reviews_required Process - Requires a review from a lead maintainer to be merged label Feb 2, 2024
@hansieodendaal
Copy link
Contributor

I tested the wrong exe, sorry about that

@SWvheerden SWvheerden merged commit 70d5ad3 into tari-project:development Feb 2, 2024
13 of 14 checks passed
@SWvheerden SWvheerden deleted the sw_export_import branch February 2, 2024 12:39
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants