Difference between revisions of "Command Line Wallet"

From Mochimo Wiki
Jump to: navigation, search
(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. __...")
 
Line 71: Line 71:
 
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.
 
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.
 
# First, create a new address with option <code>4</code>.
 
# First, create a new address with option <code>4</code>.
# 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 <code>1</code>. If you have been following this guide, this would be <code>2</code>.  
+
# 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 <code>1</code>. If you have been following this guide, this would be <code>2</code>.
 +
# If you are using the most recent version of the wallet, you will be asked if you want to "tag" this address, for this part of the guide, let's say <code>N</code>
 +
# After returning to the main menu, it is a good idea to hit <code>6</code> <code>Check Balances</code> every time. If you don't have an addresses with a balance, then you will see '''No entries.'''
 +
====Export address====
 +
In order for our friend to send us our Mochimo, we are going to have to send him an address file. The reason this is slightly different than other crypto-currencies is part of what makes us a quantum secure coin. Our addresses are over 2000 bytes in length. Not something you can easily type into a field on the web. The easy way around this is to export the entire file and send it to your friend via email which is what we will be doing here. However, the "tagging" feature is our long-term solution to this problem and will be explained later.
 
===Send your first transaction===
 
===Send your first transaction===

Revision as of 19:04, 10 January 2019

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.
  3. If you are using the most recent version of the wallet, you will be asked if you want to "tag" this address, for this part of the guide, let's say N
  4. After returning to the main menu, it is a good idea to hit 6 Check Balances every time. If you don't have an addresses with a balance, then you will see No entries.

Export address

In order for our friend to send us our Mochimo, we are going to have to send him an address file. The reason this is slightly different than other crypto-currencies is part of what makes us a quantum secure coin. Our addresses are over 2000 bytes in length. Not something you can easily type into a field on the web. The easy way around this is to export the entire file and send it to your friend via email which is what we will be doing here. However, the "tagging" feature is our long-term solution to this problem and will be explained later.

Send your first transaction