Part III: Setting up the account, DECENT witness node and voting
As mentioned above it is time to take our chances and follow Alice deep deep into the rabbit hole. While Part I and II are easy to achieve for nearly any linux system admin the following part is somewhat harder. You have to keep in mind that even if you have already experience with other blockchains like Bitcoin and Co this is different. If you are a pro with bitshares/Graphene this is not a challenge at all, if you already setup masternodes for DASH or DASH-based developments like the super-save and super-secure CRAVE, you will find differences and similarities in setting up a witness node in DECENT.
From here on I will only roughly comment what is going on, so fasten your seat belts – here we go:
Please prepare a textfile on your desktop to copy & paste – you will need it! If you get a connection lost without copying the data, people will hear your cursing all over the world. So better prepare yourself a copy of what your’re doing and the results.
Now switch to the shell with the already open wallet_cli. It should greet you with “NEW >>>”. you have to type an re-type a password it and afterwords uplock the wallet with
the prompt changes to “UNLOCKED >>>”
Now we will import your accountname and private key (which you should have ready, your textfile is a good place to store it temporarely).
import_key decentgousername privkey
returns TRUE if it worked fine. Now our wallet feels responsible for your account and has access to DECENT’s blockchain through it. We create three new sets of keys for it. Which works easily with three times
each time in return you get a newly created keyset as a json object, which you copy into your textfile. Similar like
"brain_priv_key": "here are the text phrases",
I will call them now key 1 to 3. Using these keys you will register a complete new account now, but you can choose some stuff in between:
register_account new_username publickey1 publickey2 decentgousername true
That means: You register a new account with the new username username, sign that with pubkey1 and pubkey2 from your user decentgousername.
In return you get a json object again stating the new user account information. Copy it to your text file! This is the account you will setup the miner for. Important for this at the moment is the name only. That will be the name others can vote for later and which will appear in the “miner list” – as I know, but later there is another username which could be for that. I choose the same anyway.
The next step is obsolete at the time of writing, but I mention it anyway, because it is at least possible it becomes relevant again in the future. In the past it was needed to “deposit” some DCT on the miner. I read something about 3 DCT later about 50 DCT and only asking on DECENT’s telegram channel eventually brought out, that actually you don’t need to send any DCT to the miner account. If you have to later in the future it works like this:
transfer decentgousername new_username 50.00 DCT "memo" true
which means to send 50 DCT from your Decentgo-Account to your newly registered account. Fees are deducted from your account’s balance, not from the amount you’re sending. “memo” is a an optional note of your choice.
If it was needed to send 50 DCT (or whatever) you get in result a json object which states all needed information which was sent to the blockchain. Copy that.
Next step is to import the new account into your wallet. That was hard to understand for me, because I just created it with my wallet. But to create an account does not mean to own it. Maybe you created one for your friend – whatever the reason is, you need to import that. We already know how it works:
import_key new_username privkey2
You import the new account and sign that with the pivkey2 – one of the ones you already created it with. That grants you that permission and makes it verifiable. Result should be TRUE.
Now we shutdown the daemon with CRTL+C on the other terminal, which turns off the wallet_cli also. NOTE: DON’T LOCK the WALLET before. Don’t lock it at any time during this procedure- I did that and lost control over login again. Just let the wallet_cli container die. We restart it later. On the daemon terminal or on a new terminal you hangle through to
respectively (depending on your access shell):
and open it with your favourite text editor. Mine is nano. So
does the job. nano has the advantage that on a ssh shell via putty you can copy-paste from and to a text file with rightclick. So it is awesome easy to copy
private-key = ["pubkey2","wifprivkey2"]
at the end of the file. Self-explanatory.
Restart both containers, with the docker run commands from above – first the daemon, of course. If you have a docker gui installed feel free also to use that to restart the containers and on the shell just with “docker ps” and “docker attach yxz” connect to the docker shells again. Let’s assume you did that, then you can create the so called miner object for your new user now.
create_miner username "proposal URL" true
What is proposal URL? Any URL you can show off why and how you setup your miner. Please prepare a website, blog, steemit, twitter or any reachable URL to explain your node, your intentions and if you like your ideology. In a DPoS-system like DECENT validating and block building nodes are really decentralized. PoW consensun mechanisms are needed for Bitcoin, but both PoW and PoW/PoS-Hybrids have the tendency to centralize. My two cent. Even a DASH-like masternode system offers some kind of VIP-Service (faster, more secure, more anonymously) at a higher price. But the fee is like some kind of “interest” on investment which is justified by the risk of being an early adopter/investor. Meanwhile the value of DASH is so high that the price for newcomers to run a masternode are a high barrier. So value is flowing to the already gathered value – centralizing. That kind of hoarding led to a HODL-attitude which is crippling innovation, but on bitshares/Graphene-based DPoS like DECENT the innovation can florish and new business concepts come across and alive. Not like BCash-supporter (I won’t drop names here, but you know who I am talking about), who see in their mining a money printing machine, in which they put their claws and they don’t want to give up under any circumstands. Lighting Network foresaw that and insisted on development forward. But sorry for the ideological rant, back to topic.
In return for creating the miner you get a json object with the transaction data for the creation. Next and last (!) step is a to change the signing key of our miner to the third one to “disconnect” from our keys used before to create the account and the miner object. With that we will get our miner-id!
update_miner username "proposal URL" publickey3 true
should be pretty clear. To get the witness in action we need to edit the config.ini again and add
enable-stale-production = true
miner-id = "1.4.X"
at the end of the file, where miner-id you get from the last json returned (which you saved nice and neat in your text file!)
Note: The miner-id is NOT the miner_account! It starts actually with 1.4.x NOT with 1.2.x!
Restart the daemon container! Done!
Was that that hard?
For me it was. Not the procedure itself, but to figure all that out – even with good connections to DECENT.
You can check the result by logging in at your decentgo client and check the section “vote” after decentgo synced. If you have DCT in your wallet you can already vote your node – or even better mine (jagottsicher). 🙂 If you liked this article and found it useful then vote for my node anyway! All my writing is without warranty and you do it on your own risk. But, I think this is the ultimate guide to run a DECENT witness node. A Seeder node should be very similar probably you ned to create a seeder object.
It took me days to figure all this out, but I didn’t want you just to copy-paste lots of code without understanding it. I hope my comments will help you. For me the telegram group of DECENT was a good source of support – even the founder contacted me and helped – and github also was useful. For Chinese (Mandarin) developers there are probably more sources, because many of the DECENT and DCore devs are located in China and do a hellish good job, but documentation in English suffered from that and was maybe somewhat neclegted. That’s another reason for me to write this little guide in English and not in my mother’s tongue, German.