Command Line Wallet

From Mochimo Wiki
Revision as of 18:44, 10 January 2019 by Acrotiger (talk | contribs) (Created page with "The CLI wallet started life as a dev tool. And since it functions perfectly and fills it's purpose so well, it became the official wallet in the early days of the project. __...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

The CLI wallet started life as a dev tool. And since it functions perfectly and fills it's purpose so well, it became the official wallet in the early days of the project.

Installation

There are some instances where you might want to compile the wallet separate from any mining capability. All it takes is a slight modification of the git repo to do this, so we will start by cloning the git repo:

Clone Git

git clone https://github.com/mochimodev/mochimo

Create new installation script

Next we need to create and make executable a makewal file so that we can compile just the wallet software and not the Cuda code for mining. cd ./mochimo/src touch makewal chmod +x ./makewal nano ./makewal You should now be in the nano editor, and we want to place the following code into that file:

#!/bin/sh
# Change the set CC line for your compiler:

export set CC='cc -DUNIXLIKE -DLONG64'
echo Building wallet...
$CC -c sha256.c 2>ccerror.log
$CC -c wots/wots.c  2>>ccerror.log
$CC -o wallet wallet.c wots.o sha256.o 2>>ccerror.log
echo Errors logged to ccerror.log
ls -l ccerror.log

Now save and exit from nano by doig a Ctrl-o then Enter then Ctrl-x

Now, run it!

Now we can run the script by typing ./makewal at the terminal inside the mochimo/src/ directory.
If we have done everything right, we should have a wallet program in src/ directory. Let's make a bin directory, and move the binary over there...

mkdir ../bin/
cp ./wallet ../
cd ../

We should now be in the bin directory.
That's it! program installed :)

Running for the first time

Create a new wallet

To start, from the mochimo/bin/ directory, invoke the wallet with the following command:
./wallet -p2095 -n

  1. You will be prompted to choose a name for your wallet.
  2. You will be prompted for a password. Your wallet will be encrypted 100% of the time. This password will be used to decrypt the wallet, don't lose it.
  3. You will be asked to enter some random text to help randomize your wallet seed. You do not need to memorize this information.
    1. If this is a NEW installation of Linux, say on a cloud server, you may get stuck here. This means that your box doesn't have enough entropy to create the randomness needed for this step. Here is the proposed solution to that problem:
      1. You will have to open a new terminal window and do the following
      2. sudo apt-get install rng-tools
      3. sudo rngd -r /dev/urandom
      4. This should solve your problem, if not check in the Diccord.
  4. You will be asked to pick a filename. We recommend mochimo.wal.
  5. The wallet file is saved to disk and the wallet software exits.

Generate a mining address

If you named your wallet mochimo.wal, then open the wallet with the following command:

./wallet -p2095 mochimo.wal


You will be prompted to enter your password. If you enter this incorrectly, the system will not tell you, but the name at the top of the wallet when you open it be some garbled gibberish. The reason for this is the password is a decryption key and is not stored in the wallet itself. If you enter it wrong, the wallet will still decrypt using the wrong key, and the result will be garbage. You know you entered it correctly if the wallet name you chose displays at the top of the screen.

  1. From the main menu, select option 4 to create an address. You will be prompted to name it. We suggest calling it "mining address".
    WARNING: YOU MUST *NOT* ADD A TAG TO A MINING ADDRESS.
  2. Select option 2, to display your address entries.
  3. Select option 6, to check the balance on this new address. If you don't have any coins yet, the wallet will read "No entries."

Exporting your mining address

Now let's save this address to a file, so that we can start mining and have our block rewards go to this address.

  1. Select option 7, to export. You will be prompted to select the index number of the address you want to export. In this case it will be index 1, since it's the only address you have. Type 1 and hit enter.
  2. You will be prompted to select a file name. The file has to be named: maddr.dat
  3. You will be asked where to save the Balance. Please select N.
  4. If you are replacing a mining address, you will be told that maddr.dat file already exists. If you are asked enter Y to overwrite the old mining address with your new mining address.
  5. Now type 0 to exit, and go invoke your miner.

You are ready to mine!

Create a new non-mining address

We are going to play out the scenario that you are NOT a miner, but you would like to buy Mochimo from your friend who is. In order to do this you will have to have a Mochimo address to which he can send your coins. There are two ways of doing this. We are going to address the old-school original way here, since this is the old-school original wallet.

  1. First, create a new address with option 4.
  2. You must give it a name here, let's use Mo money. This address will be assigned an index sequentially higher than your last address. If you don't have any addresses yet, this would be index 1. If you have been following this guide, this would be 2.

Send your first transaction