From 36a192da0a4a6ee6fc399d9cff85340e20e7a5f2 Mon Sep 17 00:00:00 2001 From: The MMGen Project Date: Sun, 21 May 2023 11:09:51 +0000 Subject: [PATCH] modified: Altcoin-and-Forkcoin-Support.md modified: Install-MMGen-on-Microsoft-Windows.md modified: Test-Suite.md --- Altcoin-and-Forkcoin-Support.md | 36 +++--- Install-MMGen-on-Microsoft-Windows.md | 154 +++++++++++++------------- Test-Suite.md | 5 + 3 files changed, 97 insertions(+), 98 deletions(-) diff --git a/Altcoin-and-Forkcoin-Support.md b/Altcoin-and-Forkcoin-Support.md index 02845cd..db7023a 100644 --- a/Altcoin-and-Forkcoin-Support.md +++ b/Altcoin-and-Forkcoin-Support.md @@ -4,7 +4,7 @@ #### [Ethereum (ETH), Ethereum Classic (ETC) and ERC20 Tokens](#a_eth) * [Install the Ethereum dependencies](#a_ed) -* [Install and run Geth, Parity or OpenEthereum](#a_oe) +* [Install and run Geth or Parity](#a_geth) * [Transacting and other basic operations](#a_tx) * [Creating and deploying ERC20 tokens](#a_dt) @@ -37,16 +37,15 @@ From the MMGen repository root, type: $ python3 -m pip install --no-deps --user -r eth-requirements.txt ``` -#### Install and run Geth, Parity or OpenEthereum +#### Install and run Geth or Parity -MMGen can use either Go-Ethereum (Geth) or OpenEthereum to communicate with -the Ethereum network. For information on installing Geth or OE on your -system, visit the the Geth [Github repo][ge], or the OpenEthereum [wiki][ow] -or [Github repo][og]. On Arch Linux systems, Go-Ethereum and OpenEthereum are -packages and may be installed with `pacman`. +MMGen uses Go-Ethereum (Geth) to communicate with the Ethereum network. For +information on installing Geth on your system, visit the the Geth [Github +repo][ge]. On Arch Linux systems, Go-Ethereum is a package and may be installed +with `pacman`. -Note that Ethereum daemons are not used for transaction signing, so you -needn’t install them on your offline machine. +Note that the Ethereum daemon is not used for transaction signing, so you +needn’t install it on your offline machine. For Geth, the following command-line options are required: @@ -54,19 +53,18 @@ For Geth, the following command-line options are required: --http --http.api=eth,web3,txpool --http.port=8745 ``` -Geth and OE have dropped support for Ethereum Classic, but MMGen supports -transacting ETC via the legacy [Parity][pd] daemon. Invoke Parity with -`--chain=classic --jsonrpc-port=8645`. Other command-line options are the -same as for OpenEthereum. +Geth has dropped support for Ethereum Classic, but MMGen supports transacting +ETC via the legacy [Parity][pd] daemon. Invoke Parity with `--chain=classic +--jsonrpc-port=8645`. -If you’re running OE or Parity on a different machine from MMGen, add the -following options to the daemon command line: +If you’re running Parity on a different machine from MMGen, add the following +options to the command line: ```text --jsonrpc-hosts=all --jsonrpc-interface= ``` -To run OE or Parity offline, use `--mode=offline`, otherwise `--mode=active`. +To run Parity offline, use `--mode=offline`, otherwise `--mode=active`. MMGen can also be used with Parity’s light client mode, which queries other nodes on the network for blockchain data. Add the `--light` option to the @@ -74,7 +72,7 @@ Parity command line and read the applicable note in the [Transacting](#a_tx) section below. You may require other options as well. Invoke your daemon with the `--help` -switch for more complete information. +option for more complete information. #### Transacting and other basic operations @@ -88,7 +86,7 @@ Basic operations with ETH, ETC and ERC20 tokens work as described in the * Addresses and other hexadecimal values are given without the leading `0x`. * Fees are expressed in Gas price, e.g. `12G` for 12 Gwei or `1000M` for 1000 Mwei. This works at both the command line and interactive prompt. -* When using OpenEthereum in light client mode, the `--cached-balances` option +* When using Parity in light client mode, the `--cached-balances` option will greatly speed up operations of the `mmgen-txcreate`, `mmgen-txdo` and `mmgen-tool twview` commands by reducing network queries to a minimum. If your account balances have changed, they may be refreshed interactively within @@ -349,8 +347,6 @@ received only minimal testing, or no testing at all. At startup you’ll be informed of the level of your selected coin’s support reliability as deemed by the MMGen Project. -[ow]: https://openethereum.github.io/wiki -[og]: https://github.com/openethereum/openethereum/releases [pd]: https://github.com/openethereum/parity-ethereum/releases/tag/v2.7.2 [y]: https://github.com/ethereum/pyethereum [P]: https://pypi.org/project/pip diff --git a/Install-MMGen-on-Microsoft-Windows.md b/Install-MMGen-on-Microsoft-Windows.md index 2ff4ced..e5ef7a2 100644 --- a/Install-MMGen-on-Microsoft-Windows.md +++ b/Install-MMGen-on-Microsoft-Windows.md @@ -4,20 +4,19 @@ #### [Install MSYS2 and MMGen](#a_m) * [1. Install MSYS2](#a_ms) -* [2. Set up PowerShell as your MSYS2 terminal](#a_ps) -* [3. Upgrade MSYS2](#a_ug) -* [Online users](#a_ug1) -* [Offline install](#a_ug2) -* [4. Install MSYS2 MMGen dependencies](#a_md) -* [Offline install](#a_md1) -* [5. Set up your environment](#a_ev) -* [6. Install the Python ECDSA library (offline install only)](#a_ec) -* [7. Install the standalone scrypt package (required for strong password hashing)](#a_sc) -* [8. Clone and copy the secp256k1 library (offline install only)](#a_se) -* [9. Install MMGen](#a_mm) -* [10. Install Python Ethereum dependencies (Ethereum users only)](#a_pe) -* [11. Install and launch your coin daemons](#a_cd) -* [12. You’re done!](#a_do) +* [2. Upgrade MSYS2](#a_ug) + * [Online users](#a_ug1) + * [Offline install](#a_ug2) +* [3. Install MSYS2 MMGen dependencies](#a_md) + * [Offline install](#a_md1) +* [4. Set up your environment](#a_ev) +* [5. Install the Python ECDSA library (offline install only)](#a_ec) +* [6. Install the standalone scrypt package (required for strong password hashing)](#a_sc) +* [7. Clone and copy the secp256k1 library (offline install only)](#a_se) +* [8. Install MMGen](#a_mm) +* [9. Install Python Ethereum dependencies (Ethereum users only)](#a_pe) +* [10. Install and launch your coin daemons](#a_cd) +* [11. You’re done!](#a_do) #### [Keeping your installation up to date](#a_u) * [MSYS2](#a_us) @@ -26,17 +25,13 @@ ## Introduction MMGen is supported on Microsoft Windows via [MSYS2][mh], which provides a -Unix-like command-line environment within Windows. Windows 7 and later versions -are supported. +Unix-like command-line environment within Windows. Windows 8.1 and later +versions are supported. MSYS2 is the successor project to MinGW-64 and the earlier MSYS, bringing many improvements such as package management and support for Python 3. The MSYS2 project page is located [here][mp] and its wiki [here][mw]. -*Note: an [older version][ov] of MMGen can be run under MinGW-64 and MSYS, but -its use is deprecated. Installation instructions for MMGen under MinGW-64 and -MSYS are archived [here][di] for historical interest only.* - Before you get started, just a reminder that MMGen must be installed on two computers, one online and one offline, if you want to use it securely. All operations involving private data—wallet generation, address generation and @@ -61,20 +56,10 @@ Download the MSYS2 executable installer for your architecture from the [MSYS2 homepage][mh], but ignore the installation instructions there. Run the installer, accepting all defaults. At the end of the installation, -uncheck “Run MSYS2 now” and click Finish. - -### 2. Set up PowerShell as your MSYS2 terminal - -MMGen is incompatible with the terminal provided by the MSYS2 project. However, -it works just fine with Windows’ native PowerShell. - -Drag or copy a PowerShell icon to the desktop, rename it to “MSYS2”, then right -click the icon and select Properties. After the existing path in the Target -text window, append a space followed by the text `C:\\msys64\usr\bin\bash.exe ---login` - -Save your changes and double click the icon to launch your MSYS2-enabled -PowerShell. From now on, all your work will be done in this terminal. +uncheck ‘Run MSYS2 now’ and click ‘Finish’. From the Start menu, drag the +‘MSYS2 UCRT64’ icon to the desktop. This is the icon you will use to launch +all MSYS2 terminal sessions from now on. Double-click the icon to launch the +terminal. Note that the root of your MSYS2 installation is located in `C:\\msys64`, so the following commands, for example, will produce a listing of the same directory: @@ -96,9 +81,9 @@ $ ls 'C:\\msys64\etc' # the path as seen by Windows $ pacman -Syu ``` -> Exit and restart the terminal. If you’re using modified mirror lists, they -> may have been overwritten by the update operation, in which case you should -> restore them from your modified versions. +> Exit and restart the MSYS2 terminal. If you’re using modified mirror lists, +> they may have been overwritten by the update operation, in which case you +> should restore them from your modified versions. > Now complete upgrading the system: @@ -158,7 +143,7 @@ $ ls /var/lib/pacman/sync $ pacman -Sup > urls.txt ``` -> This command may cause your MSYS terminal window to close. If so, just +> This command may cause your MSYS2 terminal window to close. If so, just > reopen another one. > The command's output is now saved in the file `urls.txt` (this redirection @@ -207,25 +192,25 @@ specifically required by MMGen. Install the MMGen requirements and their dependencies: ```text -$ pacman -S tar git vim autoconf automake-wrapper autogen libtool cygrunsrv \ - mingw-w64-x86_64-python-build \ - mingw-w64-x86_64-python-wheel \ - mingw-w64-x86_64-python-pip \ - mingw-w64-x86_64-libltdl \ - mingw-w64-x86_64-gcc \ - mingw-w64-x86_64-make \ - mingw-w64-x86_64-pcre \ - mingw-w64-x86_64-libsodium \ - mingw-w64-x86_64-python-pynacl \ - mingw-w64-x86_64-python-cryptography \ - mingw-w64-x86_64-python-pycryptodome \ - mingw-w64-x86_64-python-six \ - mingw-w64-x86_64-python-pexpect \ - mingw-w64-x86_64-python-gmpy2 \ - mingw-w64-x86_64-python-pysocks \ - mingw-w64-x86_64-python-requests \ - mingw-w64-x86_64-python-aiohttp \ - mingw-w64-x86_64-python-pyreadline3 +pacman -S tar git vim autoconf automake-wrapper autogen libtool cygrunsrv \ + mingw-w64-ucrt-x86_64-python-build \ + mingw-w64-ucrt-x86_64-python-wheel \ + mingw-w64-ucrt-x86_64-python-pip \ + mingw-w64-ucrt-x86_64-libltdl \ + mingw-w64-ucrt-x86_64-gcc \ + mingw-w64-ucrt-x86_64-make \ + mingw-w64-ucrt-x86_64-pcre \ + mingw-w64-ucrt-x86_64-libsodium \ + mingw-w64-ucrt-x86_64-python-pynacl \ + mingw-w64-ucrt-x86_64-python-cryptography \ + mingw-w64-ucrt-x86_64-python-pycryptodome \ + mingw-w64-ucrt-x86_64-python-six \ + mingw-w64-ucrt-x86_64-python-pexpect \ + mingw-w64-ucrt-x86_64-python-gmpy2 \ + mingw-w64-ucrt-x86_64-python-pysocks \ + mingw-w64-ucrt-x86_64-python-requests \ + mingw-w64-ucrt-x86_64-python-aiohttp \ + mingw-w64-ucrt-x86_64-python-pyreadline3 ``` ### 5. Set up your environment @@ -243,12 +228,13 @@ Open your shell’s runtime configuration file in a text editor: $ nano ~/.bashrc ``` -Add the following two lines to the end of the file (if this is a Bitcoin-only -installation, you may omit the Litecoin and Bitcoin Cash Node components of the -path): +Add the following lines to the end of the file (if this is a Bitcoin-only +installation, you may omit the non-Bitcoin components of `daemon_paths`): ```bash -export PATH="$HOMEPATH/.local/bin:/mingw64/bin:$PATH:/c/Program Files/Bitcoin/daemon:/c/Program Files/Litecoin/daemon:/c/Program Files/Bitcoin-Cash-Node/daemon" +win_home="/${HOMEDRIVE/:}${HOMEPATH//\\//}" +daemon_paths="/c/Program Files/Bitcoin/daemon:/c/Program Files/Litecoin/daemon:/c/Program Files/Bitcoin-Cash-Node/daemon:/c/Program Files/Geth" +export PATH="$win_home/.local/bin:$PATH:$daemon_paths" export PYTHONUTF8=1 ``` @@ -284,11 +270,24 @@ $ git clone https://github.com/holgern/py-scrypt.git Copy the cloned repo to your offline machine. -On both online and offline machines, enter the repo root and install: +Enter the repo root and edit the file ‘setup.py’, adding the following lines +before the line beginning with `elif sys.platform.startswith('win32'):`, making +sure to preserve indentation: + +```text +elif os.environ.get('MSYSTEM') == 'UCRT64': + define_macros = [] + includes = [] + libraries = ['crypto'] + CFLAGS.append('-O2') +``` + +Save ‘setup.py’. Now build and install: ```text $ cd py-scrypt -$ python3 setup.py install --user +$ python3 -m build --no-isolation +$ python3 -m pip install --user dist/*.whl ``` ### 8. Clone and copy the secp256k1 library (offline install only) @@ -326,8 +325,8 @@ Enter the repo directory, build and install: ```text $ cd mmgen $ git checkout stable_msys2 # See 'Note' below -$ python3 setup.py build --compiler=unix -$ python3 setup.py install --user +$ python3 -m build --no-isolation +$ python3 -m pip install --user dist/*.whl ``` **Note:** if you want to use features that have appeared since the latest @@ -340,8 +339,9 @@ install or run on MSYS2. Installation or runtime issues may also arise due to missing dependencies or installation steps not yet covered in the documentation. -Note that MMGen has a test suite. Refer to the [Test Suite][ts] wiki page for -details. +**Install Note:** The `--force` and `--no-deps` options also come in handy on +occasion. Note that MMGen has a test suite. Refer to the [Test Suite][ts] +wiki page for details. ### 10. Install Python Ethereum dependencies (Ethereum users only) @@ -379,17 +379,16 @@ about adding to the Windows path, since your `PATH` variable was taken care of in [Step 5](#a_ev). Note that the daemons must be installed on both your online and offline machines. -To transact ETH, ETC or ERC20 tokens you’ll need the latest Geth, OpenEthereum -or Parity (for Ethereum Classic) binary. See the -[**Altcoin-and-Forkcoin-Support**][pl] page for information on downloading and -launching these daemons. The `parity.exe`, `openethereum.exe` and `ethkey.exe` -binaries should be copied to `/usr/local/bin`. For Geth, download and run the -Windows installer and add `/c/Program Files/Geth` to the end of the `PATH` -variable in your `~/.bashrc` file: +To transact ETH, ETC or ERC20 tokens you’ll need the latest Geth or Parity (for +Ethereum Classic) binary. See the [**Altcoin-and-Forkcoin-Support**][pl] page +for information on downloading and launching these daemons. The `parity.exe` +and `ethkey.exe` binaries should be copied to `/usr/local/bin`. For Geth, +download and run the Windows installer and add `/c/Program Files/Geth` to the +end of the `PATH` variable in your `~/.bashrc` file: Please note that Ethereum daemons perform rather poorly under Windows due to threading limitations. Unless you have very fast hardware, transacting and -syncing the blockchain might be painfully slow. +syncing the blockchain could be painfully slow. ### 12. You’re done! @@ -435,8 +434,8 @@ $ git pull $ git checkout stable_msys2 # See 'Note' to step 9 $ rm -rf dist build *egg-info $ rm -rf /mingw64/lib/python*/site-packages/{mmgen,MMGen}* -$ python3 setup.py build --compiler=unix -$ python3 setup.py install --user --force +$ python3 -m build --no-isolation +$ python3 -m pip install --user dist/*.whl $ rm -rf dist build *egg-info ``` @@ -449,7 +448,6 @@ continue from the `git checkout stable_msys2` step. [mw]: https://github.com/msys2/msys2/wiki [ov]: https://gitlab.com/MMGen/mmgen/-/releases/tag/v0.9.8 [sd]: https://download.sysinternals.com/files/SDelete.zip -[og]: https://github.com/openethereum/openethereum/releases [mr]: https://gitlab.com/MMGen/mmgen/-/releases [di]: Deprecated-MSWin-Installation [ib]: Install-Bitcoind diff --git a/Test-Suite.md b/Test-Suite.md index 772e6ba..45aa643 100644 --- a/Test-Suite.md +++ b/Test-Suite.md @@ -55,7 +55,12 @@ $ export CORE_REPO_ROOT=/path/to/bitcoin/core/repo Install Pycoin: ```text +# online install: $ python3 -m pip install --user pycoin + +# offline install: +$ python3 -m pip download pycoin # online +$ python3 -m pip install --user --no-build-isolation pycoin-*.tar.gz # offline ``` CD to the MMGen repository root and build without installing: