Skip to content

How to Mine DCT

Please follow the instructions below, to become a miner in DCore Blockchain.

  • DCT holders can vote for (or delegate others to vote for them) miners.
  • To be an active miner you need to get some amount of votes to be in the top N miners. N being the number of active miners, also determined by stake voting.
  • A miner node needs to be online 24/7 to have a chance at being voted active.
  • Miners can propose changes to blockchain parameters like size, block interval (how often blocks are created) or transaction fees. If a proposal is agreed to by a majority of miners, the change goes into effect at the next update interval.
  • Active miners receive DCT rewards (first type is generated block, second type is part of transaction fees).

Becoming a Miner

Please, follow instructions below to become a DCore Miner.


Setup

To become a miner you need to set some parameters in your decentd and execute some commands in CLI Wallet. To do so, follow next steps. First, prepare your account name and private key, you will need to use them.

  • Start the local node by running:
./decentd
  • Start CLI Wallet, set the password and import the key if running for the first time:
$ ./cli_wallet
>>> set_password <password>
null
>>> unlock <password>
null
>>> import_key <accountname> <private-key>
true
  • Create miner object with the following prompt:
>>> create_miner <accountname> "url-to-proposal" true
{
  "ref_block_num": 8335,
  "ref_block_prefix": 760912907,
  "expiration": "2017-05-24T11:45:45",
  "operations":
  [
    [
       12,
       {
         "fee":
         {
          "amount": "5000000000",
          "asset_id": "1.3.0"
         },
        "miner_account": "1.2.16",
        "url": "url-to-proposal",
        "block_signing_key": "DCT7KmE9KzpiaygGo4DBF9JhdBB6C2HMdWqMFboUadjPfoHLgJ8jQ"
       }
    ]
  ],
  "extensions": [],
  "signatures": [   "20038dc5a699b030204ec3f70150d13c6a7b8a2ecb96aeddfe0927a4969e26ab1818b17f149a5e4def18653626db3cf53b9bfe570adb257455b62c1207da29dacf"
  ]
 }

where "url-to-proposal" is a url of a web page with your intentions, info about your system, and so on. It may be blank, but please keep in mind this is the way how you present yourself to the community.

  • Check the id and signing key:
>>> get_miner <accountname>
{
  "id": "1.4.xx",
  "miner_account": "1.2.16",
  "last_aslot": 0,
  "signing_key": "DCT7KmE9KzpiaygGo4DBF9JhdBB6C2HMdWqMFboUadjPfoHLgJ8jQ",
  "vote_id": "0:11",
  "total_votes": 0,
  "url": "url-to-proposal",
  "total_missed": 0,
  "last_confirmed_block_num": 0
}
  • Now, your miner object is ready.

Note

  • create_miner command automatically derives new key pair designated for mining purposes and imports them to the wallet. To obtain mining private key, get_private_key command can be used. The command accepts one parameter, a public key, and returns corresponding private key (if private key is imported in the wallet). Our mining public key is mentioned in the responses above as signing key:
>>> get_private_key DCT7KmE9KzpiaygGo4DBF9JhdBB6C2HMdWqMFboUadjPfoHLgJ8jQ
"5KNccmDPH15aN1PM5rzXgTwHXMpFfLHosZdFhZpNm2fKYH8gWcK"

Start a Miner Node

To make all previous settings run and use them, you need to start the decentd with additional arguments in order to start mining plugin. To do so, continue with one of the options.

Option 1: Start a Miner Node in Commandline

  • Shut down the wallet (ctrl-c)
  • Shut down decentd (ctrl-c)
  • Re-launch the decentd, now mentioning the new miner id 1.4.xx and its keypair:
./decentd --miner-id '"1.4.xx"' --private-key '["DCT7KmE9KzpiaygGo4DBF9JhdBB6C2HMdWqMFboUadjPfoHLgJ8jQ", "5KNccmDPH15aN1PM5rzXgTwHXMpFfLHosZdFhZpNm2fKYH8gWcK"]'

Option 2: Start a Miner Node in Configuration File

  • Add these lines into your config.ini:
miner-id = "1.4.xx"
private-key = ["DCT7KmE9KzpiaygGo4DBF9JhdBB6C2HMdWqMFboUadjPfoHLgJ8jQ", "5KNccmDPH15aN1PM5rzXgTwHXMpFfLHosZdFhZpNm2fKYH8gWcK"]