Tuesday 1 March 2016

Decred Solo Stake Mining Guide & Useful Commands [PoS]

Solo stake mining is a relatively simple process.
But I suggest you use https://dcrstakes.com Stake Pool, if you dont want to keep your PC online 24/7.
With enough tickets, its more profitable than PoW mining, with comparably lesser investment!
So, lets get started.

First you will need the latest Decred binary files- dcrd, dcrctl, dcrwallet.
At this moment the latest is v0.0.6. It contains a lot of bug fixes and its best to use this.

Download the files according to your OS , 32 or 64 bit, etc.

Most commonly-

Windows 32bit

Windows 64bit

For future updates keep an eye on this(https://github.com/decred/decred-release/releases)


Okay, so now that you have the files, lets get it all setup.

The below guide is for Windows users. [linux users- you guys can figure it out from this (smarter people)]


Make a folder PoS in the C: drive.
Lets put all files you downloaded in C:\PoS\
mainly dcrd.exe, dcrwallet.exe and dcrctl.exe

Next right click and create three text files:

StartServer.txt, StartPoSMining.txt and UnlockWallet.txt

Open StartServer.txt and write the following:

dcrctl -u <user> -P <password> --wallet walletpassphrase <PrivateKey> 0

Open StartPoSMining.txt and write the following:

dcrwallet -u <user> -P <password> --walletpass <PublicKey> --enablestakemining --balancetomaintain=1.0 --ticketmaxprice=20

Open UnlockWallet.txt and write the following:

dcrctl -u <user> -P <password> --wallet walletpassphrase <PrivateKey> 0

Now replace <user> , <password> , <PublicKey> with rpc server username and password and publickey of your wallet .save and close the windows.


If you haven't created a wallet yet.

Checkout the "Creating new wallet" part of this post.

Now save all the three text files.

Rename them to:

StartServer.bat, StartPoSMining.bat and UnlockWallet.bat.

Remember, your Wallet needs to be unlocked all the time while mining!

But, of course you are very lazy!!
so just download the three bat files from here and then replace <user> , <password> , <PublicKey> with rpc server username and password and publickey of your wallet .save and close the windows.

Next run the three .bat files in the following order:

1.StartServer.bat
2.StartPoSMining.bat
3.UnlockWallet.bat       (this cmd window will close immediately and "The wallet has been unlocked without a time limit." will appear in StartPoSMining.bat window)

You can change wallet parameters balancetomaintain and ticketmaxprice as per your need.
I think its best to buy tickets when the price is around 4-5 DCR.
And Its irrelevant to keep a lot of balance. Unless you have a lot of tickets, chances of your wallet voting is lesser.
I keep it at 1.0 , you decide as per your wish.


Some Useful commands:

open cmd and do:

cd C:\PoS\

This will take you to your stake mining directory with the three binary files (dcrd, dcrctl, dcrwallet)

Now type these:

dcrctl -u <user> -P <pass> --wallet getbalance
This will give you the current spendable balance of your wallet.

dcrctl -u <user> -P <pass> --wallet getbalance "default" 0 all
This will give you the total balance of your wallet, both locked(means money spent in buying tickets) and spendable together.

dcrctl -u <user> -P <pass> --wallet getstakeinfo
This will give you the details about the current stake pool.

Example:

{
 "poolsize": 41142,   //Total number of tickets in the pool right now.
  "difficulty": 7.47481456,  //Current Ticket price!
  "allmempooltix": 3,  //Number of tickets being bought in this present block
  "ownmempooltix": 0, //Number of tickets you are buying in the present block
  "immature": 0,  //Number of immature tickets you have ( it takes 256 confirmations for a newly bought ticket to become live and be ready to vote.)
  "live": 99,  //Total number of live tickets you have
  "proportionlive": 0.0024063001312527345,  // That's the fraction, of live tickets you have compared to all the other tickets.
  "voted": 2,  //Number of votes you did.
  "totalsubsidy": 3.72496701,  // Voting rewards in total
  "missed": 0,  //Votes you missed!
  "proportionmissed": 0,
  "revoked": 0  //Votes that were revoked
}

dcrctl -u <user> -P <pass> --wallet gettickets 1
This will show you the ID of all the tickets you have bought!


Hope this guide helps!
comment below if you need any clarifications!

Thanks rohit pawar for the help! :)

3 comments:

  1. Thanks a lot. All things covered clearly and accurately. No issues encountered. Well done. :)

    ReplyDelete
  2. Hi, is there a way to adjust the ticketprice previously bought? Or to reset the purchased ticket so all DCR can be spendable again?

    ReplyDelete
    Replies
    1. No, once bought your funds will be locked. You will only be able to access your funds after your ticket votes. Then your funds will be spendable again.

      Delete