diff --git a/doc/wiki/install-linux/Install-Bitcoind.md b/doc/wiki/install-linux/Install-Bitcoind.md index 240dfe1e..33150078 100644 --- a/doc/wiki/install-linux/Install-Bitcoind.md +++ b/doc/wiki/install-linux/Install-Bitcoind.md @@ -1,59 +1,68 @@ -#### Note: +## Installing the Bitcoin daemon -> The bitcoin daemon on the **offline computer** is used solely to sign -> transactions and runs without a blockchain. Thus even a low-powered computer -> such as a netbook will suffice as your offline machine. -> -> The bitcoin daemon on the **online computer** requires a complete and -> up-to-date blockchain for tracking addresses. Since its work is more CPU and -> disk intensive, a more powerful computer is recommended here. You'll also -> need plenty of free disk space for the rapidly growing blockchain (~30GB at -> the time of writing). -> -> Two blockchain operations are especially resource-intensive: **synchronizing -> the blockchain** and **importing existing addresses with balances**. If you -> synchronize often (once a week, for example) and take care to import your -> addresses **before** spending into them, then it's possible to use a -> low-powered netbook as your online machine. +The bitcoin daemon on the **offline computer** is used solely to sign +transactions and runs without a blockchain. Thus even a low-powered computer +such as a netbook will suffice as your offline machine. -#### Download: +The bitcoin daemon on the **online computer** requires a complete and +up-to-date blockchain for tracking addresses. Since its work is more CPU and +disk intensive, a more powerful computer is recommended here. You'll also +need plenty of free disk space for the rapidly growing blockchain (~100GB at +the time of writing). + +Two blockchain operations are especially resource-intensive: **synchronizing +the blockchain** and **importing existing addresses with balances**. If you +synchronize often (once a week, for example) and take care to import your +addresses **before** spending into them, then it's possible to use a +low-powered netbook as your online machine. + +### Download: > Go to the Bitcoin Core [main download page][01]. Choose the 32-bit or 64-bit -> versions appropriate for your respective computers. +> versions appropriate for your online and offline computers. -#### Install: +### Install (both online and offline computers): -> **On both the online and offline computers:** +> **Windows users:** -> Windows users: run the Windows installer. Linux users: unpack the tar archive -> and copy the bitcoind executable in bin/ to your execution path or just run it -> in place. +>> Run the Windows installer. When it's finished, determine where it installed +>> 'bitcoind.exe' (probably in `C:\Program Files\Bitcoin\daemon`) and append +>> that path to your [PATH variable][05]. -#### Run: +> **Linux users:** + +>> Unpack the tar archive and copy the bitcoind executable in bin/ to your +>> execution path or just run it in place. + +### Run (both Windows and Linux): > **On the online computer:** -> Open a terminal and start bitcoind with the command: +>> Open a terminal and start bitcoind with the command: $ bitcoind -daemon -> Warning: If you already have Bitcoin Core installed, **move your existing -> wallet.dat out of harm's way** before starting bitcoind. The new wallet -> now created will be used as your **tracking wallet**. +>> Warning: If you're using an existing Bitcoin Core installation, **move your +>> wallet.dat out of harm's way** before starting bitcoind. The new wallet now +>> created will be used as your **tracking wallet**. -> If you're connected to the Internet, bitcoind will begin downloading and -> verifying the blockchain. This can take from several hours to several days -> (depending on the speed of your computer) if you're downloading the blockchain -> from scratch. +>> If you're connected to the Internet, bitcoind will begin downloading and +>> verifying the blockchain. This can take from several hours to several days +>> (depending on the speed of your computer) for an initial download. > **On the offline computer:** -> Open a terminal and start bitcoind with the command: +>> Open a terminal and start bitcoind with the command: $ bitcoind -daemon -maxconnections=0 -listen=0 -> Note that in the absence of a blockchain the daemon starts very quickly and -> uses practically no CPU once running. +>> Note that in the absence of a blockchain the offline daemon starts very +>> quickly and uses practically no CPU once running. + +>> *Note for Windows users:* Under Windows, the bitcoind daemon doesn't fork to +>> run as a background process, so you'll have to run it in a separate terminal +>> window [01]: https://bitcoin.org/en/download [bd]: https://bitcoin.org/bin/blockchain/ +[05]: Editing-the-user-path-in-Windows diff --git a/doc/wiki/install-mswin/Install-Bitcoind.md b/doc/wiki/install-mswin/Install-Bitcoind.md index 240dfe1e..33150078 100644 --- a/doc/wiki/install-mswin/Install-Bitcoind.md +++ b/doc/wiki/install-mswin/Install-Bitcoind.md @@ -1,59 +1,68 @@ -#### Note: +## Installing the Bitcoin daemon -> The bitcoin daemon on the **offline computer** is used solely to sign -> transactions and runs without a blockchain. Thus even a low-powered computer -> such as a netbook will suffice as your offline machine. -> -> The bitcoin daemon on the **online computer** requires a complete and -> up-to-date blockchain for tracking addresses. Since its work is more CPU and -> disk intensive, a more powerful computer is recommended here. You'll also -> need plenty of free disk space for the rapidly growing blockchain (~30GB at -> the time of writing). -> -> Two blockchain operations are especially resource-intensive: **synchronizing -> the blockchain** and **importing existing addresses with balances**. If you -> synchronize often (once a week, for example) and take care to import your -> addresses **before** spending into them, then it's possible to use a -> low-powered netbook as your online machine. +The bitcoin daemon on the **offline computer** is used solely to sign +transactions and runs without a blockchain. Thus even a low-powered computer +such as a netbook will suffice as your offline machine. -#### Download: +The bitcoin daemon on the **online computer** requires a complete and +up-to-date blockchain for tracking addresses. Since its work is more CPU and +disk intensive, a more powerful computer is recommended here. You'll also +need plenty of free disk space for the rapidly growing blockchain (~100GB at +the time of writing). + +Two blockchain operations are especially resource-intensive: **synchronizing +the blockchain** and **importing existing addresses with balances**. If you +synchronize often (once a week, for example) and take care to import your +addresses **before** spending into them, then it's possible to use a +low-powered netbook as your online machine. + +### Download: > Go to the Bitcoin Core [main download page][01]. Choose the 32-bit or 64-bit -> versions appropriate for your respective computers. +> versions appropriate for your online and offline computers. -#### Install: +### Install (both online and offline computers): -> **On both the online and offline computers:** +> **Windows users:** -> Windows users: run the Windows installer. Linux users: unpack the tar archive -> and copy the bitcoind executable in bin/ to your execution path or just run it -> in place. +>> Run the Windows installer. When it's finished, determine where it installed +>> 'bitcoind.exe' (probably in `C:\Program Files\Bitcoin\daemon`) and append +>> that path to your [PATH variable][05]. -#### Run: +> **Linux users:** + +>> Unpack the tar archive and copy the bitcoind executable in bin/ to your +>> execution path or just run it in place. + +### Run (both Windows and Linux): > **On the online computer:** -> Open a terminal and start bitcoind with the command: +>> Open a terminal and start bitcoind with the command: $ bitcoind -daemon -> Warning: If you already have Bitcoin Core installed, **move your existing -> wallet.dat out of harm's way** before starting bitcoind. The new wallet -> now created will be used as your **tracking wallet**. +>> Warning: If you're using an existing Bitcoin Core installation, **move your +>> wallet.dat out of harm's way** before starting bitcoind. The new wallet now +>> created will be used as your **tracking wallet**. -> If you're connected to the Internet, bitcoind will begin downloading and -> verifying the blockchain. This can take from several hours to several days -> (depending on the speed of your computer) if you're downloading the blockchain -> from scratch. +>> If you're connected to the Internet, bitcoind will begin downloading and +>> verifying the blockchain. This can take from several hours to several days +>> (depending on the speed of your computer) for an initial download. > **On the offline computer:** -> Open a terminal and start bitcoind with the command: +>> Open a terminal and start bitcoind with the command: $ bitcoind -daemon -maxconnections=0 -listen=0 -> Note that in the absence of a blockchain the daemon starts very quickly and -> uses practically no CPU once running. +>> Note that in the absence of a blockchain the offline daemon starts very +>> quickly and uses practically no CPU once running. + +>> *Note for Windows users:* Under Windows, the bitcoind daemon doesn't fork to +>> run as a background process, so you'll have to run it in a separate terminal +>> window [01]: https://bitcoin.org/en/download [bd]: https://bitcoin.org/bin/blockchain/ +[05]: Editing-the-user-path-in-Windows diff --git a/doc/wiki/install-mswin/Install-MMGen-and-Its-Dependencies-on-Microsoft-Windows.md b/doc/wiki/install-mswin/Install-MMGen-and-Its-Dependencies-on-Microsoft-Windows.md index 2087ae40..6177224f 100644 --- a/doc/wiki/install-mswin/Install-MMGen-and-Its-Dependencies-on-Microsoft-Windows.md +++ b/doc/wiki/install-mswin/Install-MMGen-and-Its-Dependencies-on-Microsoft-Windows.md @@ -1,120 +1,186 @@ -***Warning: the MMGen installation process on Windows is not for the faint of -heart, success is not guaranteed and the user experience is less than optimal. +***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][20] USB image instead. It's now the preferred way for all non-Linux users to run MMGen.*** -##### Note: The following instructions assume you'll be unpacking all archives to `C:\`, the root directory on most Windows installations. If you choose to unpack to another location, the `cd` commands must be adjusted accordingly. +### 1. Create the build directory: -#### 1. Install the Python interpreter: +Enter your MSYS environment, create the directory `/build` and move to it. +This is where you'll be unpacking and building archives: -Grab the [Windows 32-bit installer][09] and run it, accepting the defaults. -Add the Python base and Scripts directories to your [path][08], e.g. -`C:\Python27;C:\Python27\Scripts`. + $ mkdir /build + $ cd /build -#### 2. Build OpenSSL: +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. -Grab the [latest tarball][06] from the [openssl.org download page][05] and unpack -it. At the MSYS prompt, run: +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`. - $ cd /c/openssl-1.0.1g - $ ./config --openssldir=/usr +### 2. Build OpenSSL: + +Grab the v1.0.x [tarball][06] from openssl.org, unpack and build: + + $ tar -xzf /openssl-1.0.2j.tar.gz + $ cd openssl-1.0.2j + $ ./Configure mingw64 --openssldir=/usr $ make $ make install -#### 3. Build the Scrypt Python module: +### 3. Build the Scrypt Python module: -Grab the [latest tarball][07] from python.org and unpack it. At the MSYS prompt, -run: +The latest scrypt tarball available from [Python][07] at this writing +(scrypt-0.8.0.tar.gz) has missing files and doesn't build, so grab the latest +[zipfile][07z] from the scrypt source repository, unzip and build: - $ cd /c/scrypt-0.6.1 + $ cd /build + $ unzip /91d194b6a6bd.zip + $ cd mhallin-py-scrypt-91d194b6a6bd -Open `setup.py` in your text editor and make the following changes: +Open the file `setup.py` in your text editor. Change the line reading -> Change the line: + from setuptools import setup, Extension - library_dirs = ['c:\OpenSSL-Win32\lib\MinGW'] +to read -> to read: + from distutils.core import setup, Extension - library_dirs = ['c:\msys\lib','c:\WINDOWS\system32'] +Right before the line beginning with -> Change the line: + scrypt_module = Extension( - includes = ['c:\OpenSSL-Win32\include'] +add the following lines (with no indentation): -> to read: + library_dirs = [r'c:\mingw64\x86_64-w4-mingw32\lib','/msys/lib'] + includes = [r'c:\msys\include'] - includes = ['c:\msys\include'] - -Save the file. At the MSYS prompt, run: +Save `setup.py`, build and install: $ python setup.py build --compiler=mingw32 - -Ignore the warning messages at the end and run: - $ python setup.py install -#### 4. Install the Pycrypto Python module: +Now, to solve a problem with the interpreter not finding the scrypt extension +module, we have to do this little fixup: -Source code is available from the [Pycrypto home page][00], but it appears to -build only with MS Visual Studio, not MinGW. Until this situation is fixed, -you can install the precompiled binaries available from [Voidspace][01]. -Download and run the [Windows installer][02], accepting the defaults. + $ cd /mingw/opt/lib/python2.7/site-packages + $ unzip scrypt*.egg -#### 5. Install the ecdsa Python module: +### 4. Build the pycrypto Python module: -Grab the [tarball][03] and unpack it. At the MSYS prompt, run: +Download the latest pycrypto [tarball][02] from the Python website and unpack it: - $ cd /c/ecdsa-0.11 + $ cd /build + $ tar -xzf /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 -#### 6. Install the bitcoin-python Python module: +### 5. Install the ecdsa Python module: -Grab the [tarball][04] and unpack it. At the MSYS prompt, run: +Grab the latest python-ecdsa [tarball][03], unpack and build: - $ cd /c/bitcoin-python-0.3 - $ cp -a src/bitcoinrpc /c/Python27/Lib/site-packages - -This is a workaround for a dependency issue with the package's setup script. -If your Python is installed in a different location, you'll have to adjust the -destination path accordingly. - -#### 7. Install the colorama Python module (optional but recommended): - -Grab the [tarball][14] and unpack it. At the MSYS prompt, run: - - $ cd /c/colorama-0.3.3 + $ cd /build + $ tar -xzf /ecdsa-0.13.tar.gz + $ cd ecdsa-0.13 $ python setup.py install -#### 8. Install MMGen: +### 6. Install the colorama Python module: -Get the [zip archive][10b] from GitHub and unpack it. At the MSYS prompt, run: +Grab the latest colorama [tarball][14], unpack and build: - $ cd /c/mmgen-stable_mswin + $ cd /build + $ tar -xzf /colorama-0.3.7.tar.gz + $ cd colorama-0.3.7 + $ python setup.py install + +### 7. Install the pexpect Python module (needed for test suite): + +Grab the latest pexpect [tarball][15], unpack and build: + + $ cd /build + $ tar -xzf /pexpect-4.2.1.tar.gz + $ cd pexpect-4.2.1 + $ python setup.py install + +### 8. Install sdelete utility (needed for secure wallet deletion): + +Grab the latest SDelete [zip archive][16], unzip and copy `sdelete.exe` to +your execution path (`c:\windows`, for example). + +### 9. Build libsecp256k1: + +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: + +> * [autoconf][31] +> * [automake][32] +> * [libtool][33] + +Unpack them in your /mingw directory and fix up some filenames: + + $ cd /mingw + $ tar -xzf /autoconf2.5-2.68-1-mingw32-bin.tar.lzma + $ tar -xzf /automake1.11-1.11.1-1-mingw32-bin.tar.lzma + $ tar -xzf /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][11] from GitHub, unpack, build and +install: + + $ cd /build + $ unzip.exe /master.zip + $ cd secp256k1-master + $ ./autogen.sh + $ ./configure + $ make + $ make install + +### 10. Install MMGen: + +Get the [zip archive][10] of the latest stable version from GitHub, unpack and install: + + $ cd /build + $ unzip.exe /stable_mswin.zip + $ cd mmgen-stable_mswin + $ python setup.py build --compiler=mingw32 $ sudo ./setup.py install -Type: +If you wish, you may run the MMGen test suite to make sure your installation's +working: - $ echo $PATH + $ test/test.py -s -The `C:\Python27;C:\Python27\Scripts` you added to your path in Step 1 of this -page should be included in your PATH variable. If not, then exit MSYS and open -a new MSYS window to update your path. - -[00]: https://www.dlitz.net/software/pycrypto/ -[01]: http://www.voidspace.org.uk/python/modules.shtml#pycrypto -[02]: http://www.voidspace.org.uk/downloads/pycrypto26/pycrypto-2.6.win32-py2.7.exe) -[03]: https://pypi.python.org/pypi/ecdsa -[04]: https://pypi.python.org/pypi/bitcoin-python/0.3 -[09]: https://www.python.org/ftp/python/2.7.6/python-2.7.6.msi -[08]: Editing-the-user-path-in-Windows +[02]: https://pypi.python.org/packages/60/db/645aa9af249f059cc3a368b118de33889219e0362141e75d4eaf6f80f163/pycrypto-2.6.1.tar.gz#md5=55a61a054aa66812daf5161a0d5d7eda +[03]: https://pypi.python.org/packages/f9/e5/99ebb176e47f150ac115ffeda5fedb6a3dbb3c00c74a59fd84ddf12f5857/ecdsa-0.13.tar.gz#md5=1f60eda9cb5c46722856db41a3ae6670 +[06]: https://www.openssl.org/source/openssl-1.0.2j.tar.gz [07]: https://pypi.python.org/pypi/scrypt/ -[06]: http://www.openssl.org/source/openssl-1.0.1g.tar.gz -[05]: http://www.openssl.org/source/ -[10]: https://github.com/mmgen/mmgen/archive/master.zip -[10b]: https://github.com/mmgen/mmgen/archive/stable_mswin.zip -[11]: http://slproweb.com/download/Win32OpenSSL-1_0_1f.exe -[12]: http://www.openssl.org/related/binaries.html -[13]: Getting-Started-with-MMGen -[14]: https://pypi.python.org/pypi/colorama +[07z]: https://bitbucket.org/mhallin/py-scrypt/get/91d194b6a6bd.zip +[10]: https://github.com/mmgen/mmgen/archive/stable_mswin.zip +[14]: https://pypi.python.org/packages/f0/d0/21c6449df0ca9da74859edc40208b3a57df9aca7323118c913e58d442030/colorama-0.3.7.tar.gz#md5=349d2b02618d3d39e5c6aede36fe3c1a +[15]: https://pypi.python.org/packages/e8/13/d0b0599099d6cd23663043a2a0bb7c61e58c6ba359b2656e6fb000ef5b98/pexpect-4.2.1.tar.gz#md5=3694410001a99dff83f0b500a1ca1c95 +[16]: https://download.sysinternals.com/files/SDelete.zip [20]: https://github.com/mmgen/MMGenLive +[11]: https://github.com/bitcoin-core/secp256k1/archive/master.zip +[31]: https://sourceforge.net/projects/mingw/files/MinGW/Extension/autoconf/autoconf2.5/autoconf2.5-2.68-1/autoconf2.5-2.68-1-mingw32-bin.tar.lzma +[32]: https://sourceforge.net/projects/mingw/files/MinGW/Extension/automake/automake1.11/automake1.11-1.11.1-1/automake1.11-1.11.1-1-mingw32-bin.tar.lzma +[33]: https://sourceforge.net/projects/mingw/files/MinGW/Extension/libtool/libtool-2.4-1/libtool-2.4-1-mingw32-bin.tar.lzma diff --git a/doc/wiki/install-mswin/Install-MMGen-on-Microsoft-Windows.md b/doc/wiki/install-mswin/Install-MMGen-on-Microsoft-Windows.md index 5fd61c81..40849941 100644 --- a/doc/wiki/install-mswin/Install-MMGen-on-Microsoft-Windows.md +++ b/doc/wiki/install-mswin/Install-MMGen-on-Microsoft-Windows.md @@ -1,20 +1,21 @@ -***Warning: the MMGen installation process on Windows is not for the faint of -heart, success is not guaranteed and the user experience is less than optimal. -You're urged to use the prebuilt [MMGenLive][00] USB image instead. It's now +***Warning: though the MMGen installation process on Windows is now easier, +it still requires patience, and the user experience is less than optimal. +You're urged to use the prebuilt [MMGenLive][20] USB image instead. It's now the preferred way for all non-Linux users to run MMGen.*** Install MMGen on Windows by completing the following three steps: -> 1. [Install MinGW and MSYS][01], if you haven't already; -> 2. [Install MMGen's dependencies (excluding the bitcoin daemons) and -> MMGen itself][02]; and -> 3. [Install the offline and online bitcoin daemons (bitcoind)][07]. +>> 1. Install MinGW and MSYS ([WinXP][03]|[>=Win7][01]), if you haven't already; +>> 2. Install MMGen's dependencies (excluding the bitcoin daemons) and MMGen itself ([WinXP][04]|[>=Win7][02]); and +>> 3. [Install the offline and online bitcoin daemons (bitcoind)][07]. -Congratulations, your MMGen installation is now complete! Now move on to -[**Getting Started with MMGen**][08]. +Congratulations, your MMGen installation is now complete! Now you can +proceed to [**Getting Started with MMGen**][08]. -[01]: Install-MinGW-and-MSYS-on-Microsoft-Windows +[01]: Install-MinGW-64-and-MSYS-on-Microsoft-Windows [02]: Install-MMGen-and-Its-Dependencies-on-Microsoft-Windows +[03]: Install-MinGW-and-MSYS-on-Windows-XP +[04]: Install-MMGen-and-Its-Dependencies-on-Windows-XP [07]: Install-Bitcoind [08]: Getting-Started-with-MMGen -[00]: https://github.com/mmgen/MMGenLive +[20]: https://github.com/mmgen/MMGenLive diff --git a/doc/wiki/using-mmgen/Getting-Started-with-MMGen.md b/doc/wiki/using-mmgen/Getting-Started-with-MMGen.md index ba149710..8af8b7f9 100644 --- a/doc/wiki/using-mmgen/Getting-Started-with-MMGen.md +++ b/doc/wiki/using-mmgen/Getting-Started-with-MMGen.md @@ -1,18 +1,18 @@ ## Table of Contents -#### Basic Operations -* Generate a wallet -* Generate addresses -* Import addresses -* Create a transaction -* Sign a transaction -* Send a transaction +#### Basic Operations +* Generate a wallet +* Generate addresses +* Import addresses +* Create a transaction +* Sign a transaction +* Send a transaction -#### Additional Features -* Using the mnemonic and seed features -* Mnemonics and seeds: additional information -* Incognito wallets - * Hidden incognito wallets +#### Additional Features +* Using the mnemonic and seed features +* Mnemonics and seeds: additional information +* Incognito wallets + * Hidden incognito wallets The following primer presupposes you have MMGen installed on two computers, one offline and one online. However, if you have an online computer and a few @@ -38,22 +38,23 @@ this primer are fake and for purposes of illustration only. The up arrow (for repeating commands) and tab key (or Ctrl-I) (for completing commands and filenames) will speed up your work at the command line greatly. -### Basic Operations +### Basic Operations -#### Generate a wallet (offline computer): +#### Generate a wallet (offline computer): *NOTE: Beginning with v0.8.8, MMGen supports a “default wallet” feature. After creating your wallet, MMGen will prompt you to make it your default. If you answer 'y', the wallet will be stored in your MMGen data directory and used for all future commands that require a wallet or other seed source.* -*If you don't want your MMGen wallet stored in your MMGen data directory, then -you may not to want to use this feature. Otherwise, it's recommended, as it -saves you from having to type your wallet on the command line.* +*You may not want this feature if you plan to store your MMGen wallet in another +location than your MMGen data directory. Otherwise, it's recommended, as it +frees you from having to type your wallet on the command line.* *The following examples suppose that you've chosen to use a default wallet. -Bear in mind that if you hadn't, the wallet would need to be specified as an -argument to all commands where it's relevant.* +Bear in mind that in the absence of a default wallet, the path to a wallet file +or other seed source needs to be included in all commands where it's +applicable.* On your offline computer, generate a wallet: @@ -83,7 +84,7 @@ printed out on paper. It can also be exported to more compact forms, the seed file and mnemonic (discussed below). These formats are short enough to be written out by hand or memorized. -#### Generate addresses (offline computer): +#### Generate addresses (offline computer): Now generate ten addresses with your just-created wallet: @@ -149,7 +150,7 @@ of lines as well. Save the file, copy it onto a USB stick and transfer it to your online computer. -#### Import addresses (online computer): +#### Import addresses (online computer): On your online computer, go to your bitcoind data directory and move any existing 'wallet.dat' file out of harm’s way. Start bitcoind and let it @@ -193,7 +194,7 @@ after the transactions have been confirmed: 89ABCDEF:4 Storage 3 0.4 TOTAL: 1 BTC -#### Create a transaction (online computer): +#### Create a transaction (online computer): Now that you have some BTC under MMGen’s control, you’re ready to create a transaction. Note that transactions are harmless until they’re signed and @@ -245,11 +246,11 @@ After quitting the menu with 'q', you’ll see the following prompt: Enter a range or space-separated list of outputs to spend: -Here you must choose outputs of sufficient value to cover the send amount of 0.1 -BTC, plus the transaction fee. By the way, MMGen calculates fees automatically -using bitcoind’s 'estimatefee' RPC call, which makes things very convenient. If -you want to increase the fee a bit for speedier confirmation, use the -`--tx-fee-adj` option. Type `mmgen-txcreate --help` for details. +Here you must choose unspent outputs of sufficient value to cover the send +amount of 0.1 BTC, plus the transaction fee. By the way, MMGen calculates fees +automatically using bitcoind’s 'estimatefee' RPC call, which makes things very +convenient. If you want to increase the fee a bit for speedier confirmation, +use the `--tx-fee-adj` option. Type `mmgen-txcreate --help` for details. Output #2 is worth 0.2 BTC, which is sufficient, so let’s choose it. After several more prompts and confirmations, your transaction will be saved: @@ -262,7 +263,7 @@ amount. As you can see, MMGen gives you complete control over your transaction inputs and change addresses. This feature will be appreciated by privacy-conscious users. -#### Sign a transaction (offline computer): +#### Sign a transaction (offline computer): Now transfer the the raw transaction file to your offline computer and sign it using your default wallet: @@ -273,7 +274,7 @@ using your default wallet: Note that the signed transaction file has a new extension, '.sigtx'. -#### Send a transaction (online computer): +#### Send a transaction (online computer): Now you’re ready for the final step: broadcasting the transaction to the network. Copy the signed transaction file to your online computer, start @@ -305,9 +306,9 @@ Some of MMGen’s more advanced features are discussed below. Others are documented in the help screens of the individual MMGen commands: display these by invoking the desired command with the `-h` or `--help` switch. -### Additional Features +### Additional Features -#### Using the mnemonic and seed features: +#### Using the mnemonic and seed features: Continuing our example above, generate a mnemonic from the default wallet: @@ -386,7 +387,7 @@ Or you can do the same thing with 'mmgen-tool': $ mmgen-tool str2id6 'XnyC NfPH piuW dQ2d nM47 VU' 0fe02f -#### Mnemonics and seeds: additional information +#### Mnemonics and seeds: additional information MMGen commands that take mnemonic and seed data may receive the data from a prompt instead of a file. Just omit the file name and specify the input format: @@ -407,7 +408,7 @@ using the `-d` option. For example, on a Linux system you can use ensuring that no trace of this sensitive data remains once your computer’s been powered down. -#### Incognito wallets +#### Incognito wallets An incognito format wallet is indistinguishable from random data, allowing you to hide your wallet at an offset within a random-data-filled file or partition. @@ -485,7 +486,7 @@ MMGen wallet, mnemonic or seed file to generate addresses and sign transactions: ... Signed transaction written to file FABCDE[0.3].sigtx -##### Hidden incognito wallets +##### Hidden incognito wallets With the `-o hincog` option, incognito wallet data can be created and hidden at a specified offset in a file or partition in a single convenient operation, with diff --git a/mmgen/color.py b/mmgen/color.py index 97d31d6b..b1bdcc1a 100644 --- a/mmgen/color.py +++ b/mmgen/color.py @@ -54,7 +54,7 @@ def magenta(s): return clr_mag+s+clr_reset def init_color(enable_color=True): global clr_red,clr_grn,clr_grnbg,clr_yel,clr_cya,clr_blu,clr_pnk,clr_orng,clr_gry,clr_mag,clr_reset if enable_color: - clr_red = _red + clr_red = _red clr_grn = _grn clr_grnbg = _grnbg clr_yel = _yel diff --git a/mmgen/globalvars.py b/mmgen/globalvars.py index 072407f0..1f24d6be 100755 --- a/mmgen/globalvars.py +++ b/mmgen/globalvars.py @@ -36,13 +36,13 @@ class g(object): sys.exit(ev) # Variables - these might be altered at runtime: - version = '0.8.8' - release_date = 'November 2016' + version = '0.8.9rc1' + release_date = 'December 2016' proj_name = 'MMGen' prog_name = os.path.basename(sys.argv[0]) author = 'Philemon' - email = '' + email = '' Cdates = '2013-2016' user_entropy = '' diff --git a/mmgen/term.py b/mmgen/term.py index 4512a37f..fe2e2577 100755 --- a/mmgen/term.py +++ b/mmgen/term.py @@ -195,8 +195,6 @@ def _get_terminal_size_mswin(): msg(yellow('Warning: could not get terminal size. Using fallback dimensions.')) return 80,25 -def mswin_dummy_flush(fd,termconst): pass - def set_terminal_vars(): global get_char,kb_hold_protect,get_terminal_size if _platform == 'linux': @@ -205,11 +203,9 @@ def set_terminal_vars(): if os.getenv('MMGEN_PEXPECT_POPEN_SPAWN'): get_char,kb_hold_protect = _get_keypress_unix_stub,_kb_hold_protect_unix_raw get_terminal_size = _get_terminal_size_linux -# myflush = termios.tcflush # call: myflush(sys.stdin, termios.TCIOFLUSH) else: get_char = (_get_keypress_mswin_raw,_get_keypress_mswin)[g.hold_protect] kb_hold_protect = (_kb_hold_protect_mswin_raw,_kb_hold_protect_mswin)[g.hold_protect] if os.getenv('MMGEN_PEXPECT_POPEN_SPAWN'): get_char = _get_keypress_mswin_emu get_terminal_size = _get_terminal_size_mswin -# myflush = mswin_dummy_flush diff --git a/mmgen/test.py b/mmgen/test.py index b2f15819..e544388b 100755 --- a/mmgen/test.py +++ b/mmgen/test.py @@ -26,12 +26,16 @@ from binascii import hexlify from mmgen.common import * def cleandir(d): + from shutil import rmtree try: files = os.listdir(d) except: return msg(green("Cleaning directory '%s'" % d)) for f in files: - os.unlink(os.path.join(d,f)) + try: + os.unlink(os.path.join(d,f)) + except: + rmtree(os.path.join(d,f)) def getrandnum(n): return int(hexlify(os.urandom(n)),16) def getrandhex(n): return hexlify(os.urandom(n)) diff --git a/mmgen/tx.py b/mmgen/tx.py index 66b20cfd..ec77d378 100755 --- a/mmgen/tx.py +++ b/mmgen/tx.py @@ -272,13 +272,14 @@ class MMGenTX(MMGenObject): ask_write=ask_write, ask_write_default_yes=ask_write_default_yes) - def write_to_file(self,add_desc='',ask_write=True,ask_write_default_yes=False): + def write_to_file(self,add_desc='',ask_write=True,ask_write_default_yes=False,ask_tty=True): if ask_write == False: ask_write_default_yes=True self.format() fn = '%s[%s].%s' % (self.txid,self.send_amt,self.ext) write_data_to_file(fn,self.fmt_data,self.desc+add_desc, ask_write=ask_write, + ask_tty=ask_tty, ask_write_default_yes=ask_write_default_yes) def view_with_prompt(self,prompt=''): diff --git a/scripts/tx-old2new.py b/scripts/tx-old2new.py index 5d9fe8dd..254703c8 100755 --- a/scripts/tx-old2new.py +++ b/scripts/tx-old2new.py @@ -18,6 +18,7 @@ help_data = { 'usage': "", 'options': """ -h, --help Print this help message +-S, --stdout Write data to STDOUT instead of file """ } @@ -97,6 +98,8 @@ tx = MMGenTX() [tx.txid,send_amt,tx.timestamp],tx.hex,inputs,b2m_map,tx.label = parse_tx_file(cmd_args[0]) tx.send_amt = Decimal(send_amt) +g.testnet = False +g.rpc_host = 'localhost' c = bitcoin_connection() # attrs = 'txid','vout','amt','comment','mmid','addr','wif' @@ -134,4 +137,4 @@ for e in tx.outputs: #die(1,'') tx.blockcount = find_block_by_time(c,tx.timestamp) -tx.write_to_file(ask_write=False) +tx.write_to_file(ask_tty=False) diff --git a/setup.py b/setup.py index ee466e80..5b6a5216 100755 --- a/setup.py +++ b/setup.py @@ -63,8 +63,8 @@ setup( author_email = 'mmgen-py@yandex.com', url = 'https://github.com/mmgen/mmgen', license = 'GNU GPL v3', - platforms = 'Linux, MS Windows, Raspberry PI', - keywords = 'Bitcoin, wallet, cold storage, offline storage, open-source, command-line, Python, Bitcoin Core, bitcoind, hd, deterministic, hierarchical, secure, anonymous', + platforms = 'Linux, MS Windows, Raspberry Pi', + keywords = 'Bitcoin, cryptocurrency, wallet, cold storage, offline, online, spending, open-source, command-line, Python, Bitcoin Core, bitcoind, hd, deterministic, hierarchical, secure, anonymous, Electrum, seed, mnemonic, brainwallet, Scrypt, utility, script, scriptable, blockchain, raw, transaction, permissionless, console, terminal, curses, ansi, color, tmux, remote, client, daemon, RPC, json, entropy', cmdclass = { 'build_ext': my_build_ext, 'install_data': my_install_data }, ext_modules = [module1], data_files = [('share/mmgen', [ @@ -76,10 +76,11 @@ setup( 'mmgen.__init__', 'mmgen.addr', 'mmgen.bitcoin', - 'mmgen.globalvars', + 'mmgen.color', 'mmgen.common', 'mmgen.crypto', 'mmgen.filename', + 'mmgen.globalvars', 'mmgen.license', 'mmgen.mn_electrum', 'mmgen.mn_tirosh', @@ -90,8 +91,8 @@ setup( 'mmgen.term', 'mmgen.test', 'mmgen.tool', - 'mmgen.tx', 'mmgen.tw', + 'mmgen.tx', 'mmgen.util', 'mmgen.main', diff --git a/test/gentest.py b/test/gentest.py index 4a1d34df..aec4c4ad 100755 --- a/test/gentest.py +++ b/test/gentest.py @@ -36,10 +36,10 @@ opts_data = { 'desc': "Test address generation in various ways", 'usage':'[options] [spec] [rounds | dump file]', 'options': """ --h, --help Print this help message --q, --quiet Produce quieter output ---, --testnet Run for testnet rather than mainnet --v, --verbose Produce more verbose output +-h, --help Print this help message +--, --longhelp Print help message for long options (common options) +-q, --quiet Produce quieter output +-v, --verbose Produce more verbose output """, 'notes': """ Tests: @@ -106,7 +106,7 @@ else: def match_error(sec,wif,a_addr,b_addr,a,b): m = ['','py-ecdsa','keyconv','secp256k1','dump'] - msg_r(red('\nERROR: Addresses do not match!')) + qmsg_r(red('\nERROR: Addresses do not match!')) die(3,""" sec key : {} WIF key : {} @@ -116,13 +116,13 @@ def match_error(sec,wif,a_addr,b_addr,a,b): if a and b: m = "Comparing address generators '{}' and '{}'" - msg(green(m.format(g.key_generators[a-1],g.key_generators[b-1]))) + qmsg(green(m.format(g.key_generators[a-1],g.key_generators[b-1]))) from mmgen.addr import get_privhex2addr_f gen_a = get_privhex2addr_f(generator=a) gen_b = get_privhex2addr_f(generator=b) compressed = False for i in range(1,rounds+1): - msg_r('\rRound %s/%s ' % (i,rounds)) + qmsg_r('\rRound %s/%s ' % (i,rounds)) sec = hexlify(os.urandom(32)) wif = hex2wif(sec,compressed=compressed) a_addr = gen_a(sec,compressed) @@ -133,10 +133,10 @@ if a and b: if a != 2 and b != 2: compressed = not compressed - msg(green(('\n','')[bool(opt.verbose)] + 'OK')) + qmsg(green(('\n','')[bool(opt.verbose)] + 'OK')) elif a and not fh: m = "Testing speed of address generator '{}'" - msg(green(m.format(g.key_generators[a-1]))) + qmsg(green(m.format(g.key_generators[a-1]))) from mmgen.addr import get_privhex2addr_f gen_a = get_privhex2addr_f(generator=a) import time @@ -147,7 +147,7 @@ elif a and not fh: print 'Starting key:', hexlify(seed+pack('I',0)) compressed = False for i in range(rounds): - if not opt.quiet: msg_r('\rRound %s/%s ' % (i+1,rounds)) + qmsg_r('\rRound %s/%s ' % (i+1,rounds)) sec = hexlify(seed+pack('I',i)) wif = hex2wif(sec,compressed=compressed) a_addr = gen_a(sec,compressed) @@ -155,18 +155,18 @@ elif a and not fh: if a != 2: compressed = not compressed elapsed = int(time.time() - start) - if not opt.quiet: msg('') - msg('%s addresses generated in %s second%s' % (rounds,elapsed,('s','')[elapsed==1])) + qmsg('') + qmsg('%s addresses generated in %s second%s' % (rounds,elapsed,('s','')[elapsed==1])) elif a and dump: m = "Comparing output of address generator '{}' against wallet dump '{}'" - msg(green(m.format(g.key_generators[a-1],cmd_args[1]))) + qmsg(green(m.format(g.key_generators[a-1],cmd_args[1]))) if a == 2: - msg("NOTE: for compressed addresses, 'python-ecdsa' generator will be used") + qmsg("NOTE: for compressed addresses, 'python-ecdsa' generator will be used") from mmgen.addr import get_privhex2addr_f gen_a = get_privhex2addr_f(generator=a) from mmgen.bitcoin import wif2hex for n,[wif,a_addr] in enumerate(dump,1): - msg_r('\rKey %s/%s ' % (n,len(dump))) + qmsg_r('\rKey %s/%s ' % (n,len(dump))) sec = wif2hex(wif) if sec == False: die(2,'\nInvalid {}net WIF address in dump file: {}'.format(('main','test')[g.testnet],wif)) @@ -174,4 +174,4 @@ elif a and dump: b_addr = gen_a(sec,compressed) if a_addr != b_addr: match_error(sec,wif,a_addr,b_addr,1 if compressed and a==2 else a,4) - msg(green(('\n','')[bool(opt.verbose)] + 'OK')) + qmsg(green(('\n','')[bool(opt.verbose)] + 'OK')) diff --git a/test/tooltest.py b/test/tooltest.py index cdf2cd67..135a1dde 100755 --- a/test/tooltest.py +++ b/test/tooltest.py @@ -131,6 +131,7 @@ add_spawn_args = ' '.join(['{} {}'.format( '--'+k.replace('_','-'), getattr(opt,k) if getattr(opt,k) != True else '' ) for k in 'testnet','rpc_host' if getattr(opt,k)]).split() +add_spawn_args += [ '--data-dir', cfg['tmpdir']] # ignore ~/.mmgen if opt.system: sys.path.pop(0)