Commit graph

96 commits

Author SHA1 Message Date
30b94db2f8
mmgen-tool tw{export,import}: support editing of comments fields 2022-07-23 11:55:32 +00:00
a51352d5b7
new classes: TwJSON.Import, TwJSON.Export 2022-06-11 16:11:02 +00:00
0514ec24c5
new commands: mmgen-tool twexport, mmgen-tool twimport
- create a compact JSON dump of the MMGen tracking wallet with `twexport`

- recreate a working tracking wallet with updated balances from the dump in
  just a few minutes with `twimport`

- the import operation leverages the `scantxoutset` RPC call to selectively
  rescan only required blocks, reducing block rescan time to typically just
  a few seconds

- to recover historical transactions for viewing with `mmgen-tool txhist`,
  a full blockchain rescan may be performed on the recreated wallet using
  `mmgen-tool rescan_blockchain`

- supported coins: BTC, BCH, LTC
2022-05-28 19:44:11 +00:00
15f4e1405f
minor changes and fixes 2022-05-28 19:41:43 +00:00
e7ac7fd206
mmgen-addrimport: reimplement --rescan using scantxoutset
Details:

    $ mmgen-addrimport --help
2022-05-26 16:08:26 +00:00
5488c51353
new command: mmgen-tool rescan_address
- updates an address balance using the `scantxoutset` RPC call
2022-05-26 16:07:21 +00:00
c96833c5a2
new command: mmgen-tool rescan_blockchain 2022-05-26 16:07:21 +00:00
cd2e2240c3
new command: mmgen-tool resolve_address 2022-05-26 16:07:21 +00:00
3823e8cdc9
minor fixes and cleanups 2022-05-26 16:07:20 +00:00
c8f4e0c050
support Litecoin Core v0.21.2 2022-05-26 16:07:20 +00:00
7d2165641f
new feature: transaction history via mmgen-tool txhist
Display nicely formatted info about all transactions known to the tracking
wallet.

Interactive mode presents the user with an interface similar to `mmgen-tool
twview` or `mmgen-txcreate -i`, providing various sort, filter, column format
and printing options.

`--coin=ltc` and `--coin=bch` are also supported.  Use of `--rpc-backend=aio`
speeds up operation significantly under Linux.

Usage examples:

    # Non-interactive mode, tabular output:
    $ mmgen-tool txhist

    # Non-interactive mode, full output:
    $ mmgen-tool txhist detail=1

    # Show only transactions newer than 100000 blocks from chain tip:
    $ mmgen-tool txhist sinceblock=-100000

    # Interactive mode:
    $ mmgen-tool txhist interactive=1

Testing/demo:

    $ test/test.py -n -X bob_txhist1 regtest
    $ test/test.py -Se regtest:bob_txhist1
    $ test/test.py -Se regtest:bob_txhist2
    $ test/test.py -Se regtest:bob_txhist3
    $ test/test.py -Se regtest:bob_txhist4
    $ test/test.py -Se regtest:bob_txhist_interactive
2022-05-23 16:30:09 +00:00
310f6f59c5
minor changes and fixes 2022-05-23 16:28:56 +00:00
9e91b0dbc5
test.py regtest: update miner addr for deterministic testing 2022-05-23 16:28:54 +00:00
09ab734ab3
mmgen-msg: support verification and display of exported JSON data
Usage:

    $ mmgen-msg verify signatures.json

Testing:

    $ test/unit_tests.py -v msg
2022-04-28 11:00:52 +00:00
1ba11a71c1
support Bitcoin Core v23.0.0 2022-04-25 15:14:43 +00:00
4821fc203c
mmgen-msg: add export command
- export signature data relevant for a third-party verifier to JSON
2022-04-23 14:38:34 +00:00
d817931c04
mmgen-msg: support display of unsigned message files 2022-03-30 15:49:45 +00:00
7a72deed9f
daemon.py: for test suite, use separate dir trees for each network 2022-03-30 15:49:44 +00:00
e5cf3b6ec8
message signing: user-level support
Usage information:

    $ mmgen-msg --help

Testing:

    $ test/test.py -e regtest
2022-03-28 13:51:25 +00:00
152901143c
relocate module: regtest -> base_proto.bitcoin.regtest 2022-02-10 12:51:41 +00:00
9649f5b723
modularize wallet classes
- all code has been relocated from `wallet.py` to individual modules under
  `wallet`, with each wallet type having its own module

- the fully rewritten initialization code can be found in `__init__.py` and
  `base.py`
2022-02-08 13:03:32 +00:00
41376eb515
new MMGenSystemExit exception; remove rdie(), ydie() 2022-02-05 13:32:56 +00:00
c205d2f7a6
test.py: remove superfluous calls to pexpect.read() 2022-02-05 13:32:55 +00:00
2061d109cc
test.py: always check output when spawned script exits with non-zero value 2022-02-05 13:32:55 +00:00
b9c96c5215
avoid use of globals() wherever practicable 2022-02-03 20:40:40 +00:00
59bffb59b2
CoinProtocol.Base: skip loading of .amt module via 'need_amt=False' 2022-01-29 11:25:03 +00:00
341ee2c741
modularize the 'mmgen-tool' utility
- each command group now has its own module under the `tool` directory
- only modules required by a given command are loaded
- code used only by the command-line tool has been relocated to `main_tool.py`
2022-01-24 19:33:02 +00:00
5545a011b0
minor fixes and cleanups 2022-01-24 19:30:12 +00:00
4819c97f8a
util.py: move file utilities to fileutil.py 2022-01-21 11:23:46 +00:00
54e9799989
test suite: minor cleanups 2022-01-19 11:43:52 +00:00
b995cbf71e
permit execution of tests with optimization set
- all tests except object tests now run with PYTHONOPTIMIZE=2
2022-01-19 11:43:52 +00:00
32c522c039
overhaul public key and address generation code
- pubkey generation code has been rewritten and moved from addr.py to
  keygen.py
- address generation code has been rewritten and moved from addr.py to
  addrgen.py
- keygen/addrgen classes now present a consistent API across all pubkey and
  address types
- key/address operations and related data objects now use bytes internally
  instead of hex strings
- pubkey generator backends are now selected using the `--keygen-backend`
  option
- for Monero pubkeys, the new `nacl` backend has replaced `ed25519ll_djbec`
  as the default
- a minimal unit test has been added

Examples:

    # Generate a random Monero keypair using the unoptimized 'ed25519' backend:
    $ mmgen-tool --coin=xmr --keygen-backend=3 randpair

    # Generate an LTC Bech32 address list from the default wallet using the
    # 'python-ecdsa' backend:
    $ mmgen-addrgen --coin=ltc --type=bech32 --keygen-backend=2 1-10

Testing:

    # Run the minimal unit test:
    $ test/unit_tests_py gen

    # Compare BTC Segwit addresses from default 'libsecp256k1' backend to
    # 'pycoin' library, with edge cases and 10,000 random rounds:
    $ test/gentest.py --type=segwit 1:pycoin 10000

    # Test all configured Monero backends against 'moneropy', with edge cases
    # and 10 random rounds:
    $ test/gentest.py --coin=xmr all:moneropy 10

    # Test the 'nacl' and 'ed25519ll_djbec' backends against each other, with
    # edge cases and 1000 random rounds:
    $ test/gentest.py --coin=xmr 1:2 1000

    # Test the speed of the Monero 'nacl' backend using 10,000 rounds:
    $ test/gentest.py --coin=xmr 1 10000

    # Same for Zcash:
    $ test/gentest.py --coin=zec --type=zcash_z 1 10000
2022-01-15 14:00:12 +00:00
0138a6fa49
whitespace, cleanups, minor fixes 2022-01-15 14:00:09 +00:00
e0352568db
addr.py: move AddrList and related classes to addrlist.py
- also move PasswordList to passwdlist.py
- add a minimal unit test

Testing:

    $ test/unit_tests.py addrlist
2022-01-15 14:00:08 +00:00
012fea543f
addr.py: move address file-related methods to new AddrFile class
- AddrFile subclasses: KeyAddrFile,KeyFile,PasswordFile
2022-01-15 14:00:07 +00:00
1a896d9af9
update copyright dates 2022-01-04 19:51:22 +00:00
53145cbc9f
test.py: minor fixes 2021-10-10 20:18:16 +00:00
328db384d2
test.py: daemon start/stop fixes 2021-10-08 16:44:56 +00:00
2660a3591b
test.py: fixes for --pexpect-spawn 2021-10-07 13:12:10 +00:00
4453aaf355
minor fixes and cleanups 2021-10-07 13:12:10 +00:00
8e739e787a
test.py regtest: enable deterministic testing
Follow-up to commit 08fc25d86

Testing:

    $ export MMGEN_TEST_SUITE_DETERMINISTIC=1
    $ script -c 'test/test.py -ne regtest' -O run1
    $ script -c 'test/test.py -ne regtest' -O run2
    $ scripts/gendiff.py run1 run2 > run.diff

Erratum:

    The phrase “and the non-deterministic behavior of Bitcoin Core’s regtest
    implementation” in the notes to commit 08fc25d86 is incorrect and should
    be disregarded.
2021-10-06 13:22:34 +00:00
d99c75216d
minor fixes and cleanups 2021-10-06 13:22:33 +00:00
ae3c65ec81
regtest: return daemon datadir to its former location under MMGen datadir
Affected coins: BTC,LTC,BCH

Fixes a regression introduced by commit `ca8b4dc31` on Aug 5.

During this period, use of the `mmgen-regtest` script would have overwritten
the user bitcoin/litecoin.conf and regtest dir.  Other files in the daemon
datadir were unaffected.
2021-10-05 11:57:33 +00:00
54d123fdc0
scripts/traceback_run.py -> scripts/exec_wrapper.py 2021-10-03 17:40:01 +00:00
0493f8077b
test suite: use getrand() instead of os.urandom() 2021-10-02 17:54:12 +00:00
6692a43d59
f-strings, whitespace (test files) [44 files patched] 2021-09-29 21:17:57 +00:00
b400b26029
test suite: improve handling of BOGUS_SEND environment var 2021-09-26 21:16:20 +00:00
d75ffea985
test suite: whitespace 2021-09-26 21:16:18 +00:00
188df57e81
test.py: add 'no_traceback' opt to spawn() 2021-06-24 17:15:23 +00:00
ecf489af0e
minor fixes and cleanups 2021-06-08 11:46:05 +00:00