Warning: though the MMGen installation process on Windows has become easier, it still requires patience, and the user experience is less than optimal. You're urged to use the prebuilt MMGenLive USB image instead. It's now the preferred way for all non-Linux users to run MMGen.
Enter your MSYS environment, create the directory /build
and move to it.
This is where you'll be unpacking and building archives:
$ mkdir /build
$ cd /build
If the machine you're installing on is online, you can download the various tarballs and zipped archives you need from the Internet exactly as described in the instructions below. If you're offline, you'll need to download them first on another machine and then transfer them to the install computer using a USB stick, for example.
In either case, you'll probably be downloading the archives to a folder
somewhere outside the root of your MSYS filesystem. To access it within MSYS,
use /c/
for drive C:
, /d/
for drive D:
and so forth. A full path to an
archive would thus look something like this:
/c/my_downloaded_archives/archive_name.tar.gz
.
Grab the v1.0.x tarball from openssl.org, unpack and build:
$ tar -xzf <path to openssl archive>/openssl-1.0.2j.tar.gz
$ cd openssl-1.0.2j
$ ./Configure mingw64 --openssldir=/usr
$ make
$ make install
The latest scrypt tarball available from Python at this writing (scrypt-0.8.0.tar.gz) has missing files and doesn't build, so grab the latest zipfile from the scrypt source repository, unzip and build:
$ cd /build
$ unzip <path to scrypt archive>/91d194b6a6bd.zip
$ cd mhallin-py-scrypt-91d194b6a6bd
Open the file setup.py
in your text editor. Change the line reading
from setuptools import setup, Extension
to read
from distutils.core import setup, Extension
Right before the line beginning with
scrypt_module = Extension(
add the following lines (with no indentation):
library_dirs = [r'c:\mingw64\x86_64-w4-mingw32\lib','/msys/lib']
includes = [r'c:\msys\include']
Save setup.py
, build and install:
$ python setup.py build --compiler=mingw32
$ python setup.py install
Now, to solve a problem with the interpreter not finding the scrypt extension module, we have to do this little fixup:
$ cd /mingw/opt/lib/python2.7/site-packages
$ unzip scrypt*.egg
Download the latest pycrypto tarball from the Python website and unpack it:
$ cd /build
$ tar -xzf <path to pycrypto archive>/pycrypto-2.6.1.tar.gz
$ cd pycrypto-2.6.1
Open the file setup.py
in your text editor. Remove exactly four spaces at
the beginning of this line:
self.__remove_extensions(["CryptoPublicKey._fastmath"])
to move it one level of indentation to the left. Save the file and exit the editor. Now build and install:
$ python setup.py build --compiler=mingw32
$ python setup.py install
Grab the latest python-ecdsa tarball, unpack and build:
$ cd /build
$ tar -xzf <path to ecdsa archive>/ecdsa-0.13.tar.gz
$ cd ecdsa-0.13
$ python setup.py install
Grab the latest ed25519ll tarball, unpack and build:
$ cd /build
$ tar -xzf <path to ed25519ll archive>/ed25519ll-0.6.tar.gz
$ cd ed25519ll-0.6
Open the file setup.py
in your text editor. Change the line reading
plat_name = get_platform().replace('-', '_')
to read
plat_name = 'win64'
Exit the editor and run:
$ python setup.py install
Grab the latest pysha3 tarball, unpack and build:
$ cd /build
$ tar -xzf <path to pysha3 archive>/pysha3-1.0.2.tar.gz
$ cd pysha3-1.0.2
$ python setup.py install
Grab the latest colorama tarball, unpack and build:
$ cd /build
$ tar -xzf <path to colorama archive>/colorama-0.3.7.tar.gz
$ cd colorama-0.3.7
$ python setup.py install
Grab the latest pexpect tarball, unpack and build:
$ cd /build
$ tar -xzf <path to pexpect archive>/pexpect-4.2.1.tar.gz
$ cd pexpect-4.2.1
$ python setup.py install
Grab the latest SDelete zip archive, unzip and copy sdelete.exe
to
your execution path (c:\windows
, for example).
Libsecp256k1 requires GNU autotools to build, and they're not included in the MinGW-64 distribution for some reason, so you'll have to retrieve and unpack them yourself. You'll need these archives:
Unpack them in your /mingw directory and fix up some filenames:
$ cd /mingw
$ tar -xzf <path to>/autoconf2.5-2.68-1-mingw32-bin.tar.lzma
$ tar -xzf <path to>/automake1.11-1.11.1-1-mingw32-bin.tar.lzma
$ tar -xzf <path to>/libtool-2.4-1-mingw32-bin.tar.lzma
$ cd bin
$ cp autoconf-* autoconf
$ cp automake-* automake
$ cp aclocal-* aclocal
$ cp autoreconf-* autoreconf
Now get the latest libsecp256k1 zip archive from GitHub, unpack, build and install:
$ cd /build
$ unzip.exe <path to libsecp256k1 archive>/master.zip
$ cd secp256k1-master
$ ./autogen.sh
$ ./configure
$ make
$ make install
Get the zip archive of the latest stable version from GitHub, unpack and install:
$ cd /build
$ unzip.exe <path to mmgen archive>/stable_mswin.zip
$ cd mmgen-stable_mswin
$ python setup.py build --compiler=mingw32
$ sudo ./setup.py install
After first installing and starting the Bitcoin daemon, you may then run the MMGen test suite to make sure your installation's working:
$ test/test.py -s