DCore Blockchain Voting via Wallet CLI

charles okaformbah
4 min readJun 28, 2019

The DCore protocol is gradually growing to be the blockchain technology for data and file transactions accessible and useful for real-world application/use case. Dcore uses a DPoS (Delegated Proof of Stake) consensus algorithm and IPFS (InterPlanetary File System) to help with fast data transactions with a very high level of security.

There are lots of use cases for the Dcore protocol using either Wallet API but we shall be focusing on how to cast vote for miners using the Wallet CLI. If you already know how to run the Wallet CLI, then see this short video I did on how to cast a vote https://www.loom.com/share/beedbb2f81394749a579ad965b510c25

Running the Wallet CLI

First and foremost, you would need to download the Dcore desktop application from the decent website. I created a video tutorial on how to download and install here. Follow this link to watch (https://www.loom.com/share/a3421805149b4fcca1d0ee700a9bbdbe) or simply go to the website — https://decent.ch/dcore/ to download and follow the installation prompts to install. Also, you’d need to wait for the application to sync and download all transaction blocks and be up to date.

After the desktop wallet application is installed, go to the installation folder (if you are using Windows, simply check your Programs folder) and launch 3 Command Prompts from inside the Decent installation folder.

Note: more information about how to go about the installation https://docs.decent.ch/getting_started/getting_dcore_intro/index.html

Inside the installation folder

i. Start the DCore daemon by executing decentd on the first command prompt

running deamon or decentd

ii. Run Cli_Wallet -r on the second command prompt. This will make the wallet listen to WebSocket connection on the default port. You will need to unlock your wallet or create a new password if it is the first time you are launching the wallet CLI. I found out that for Windows system, you would need to enclose your password with quotation mark for it to work, e.g “mypassword”. You can visit this mini-tutorial on the DCore website https://docs.decent.ch/snippets/cli_wallet/index.html

unlocking wallet

How to Vote for Miner Using via Wallet CLI

More information can be gotten here https://docs.decent.ch/UseCases/index.html#vote_for_a_miner

First, unlock your wallet. Follow the steps above to unlock your wallet. Upon successful unlocking of your wallet, you’d get ‘ unlocked >>> ’ status.

To Get a list of miners.

map<string,miner_id_type> list_miners(string lowerbound, uint32_t limit);

Example

list_miners “” 11

Here I am using the method “list_miners” then leaving the lowerbound(miner I want to return first) empty and then limiting the number of miners I want to be returned “11

to get a list of available miners

The Result:

More detail; https://docs.decent.ch/UseCases/index.html#get_a_list_of_miners

To get details of a Miner.

miner_object get_miner(string owner_account);

Example -

get_miner adilminer

Here I am calling the method “get_miner” and adding one of the miner’s id “adilminer

to get miner detail

The Result

miner’s detail More detail; https://docs.decent.ch/UseCases/index.html#get_info_about_a_miner

Finally, voting for a Miner.

signed_transaction vote_for_miner(string voting_account, string miner, bool approve, bool broadcast = false);

Example –

vote_for_miner dw-justcharlz init9 true true

I called the method “vote_for_miner” then added my Dcore account name “dw-justcharlz” followed by miner’s id I want to vote “init9” plus my vote “true” and then broadcast it to the blockchain “true

voting for a miner

The Result:

More details here https://docs.decent.ch/UseCases/index.html#vote_for_a_miner_1

If you are still confused on how to go about the process, I did a little video on how to cast a vote for miners here https://www.loom.com/share/beedbb2f81394749a579ad965b510c25

Charles is a blockchain solution architect, fullstack developer with over a decade experience in the IT world creating applications, running and advising several startups. Passionate about great ideas that have “Proof of concept” and scalablilty. #Fitfam gym dude and enjoys swimming when he is not in front of his laptop, bar, cooking, playing ping-pong or snooker.
twitter:
justcharz
linkedin:
linkedin.com/in/justcharles

--

--

charles okaformbah

Blockchain Solutions Architect | Cloud Engineer — CoFounder @ Convexity and VesselTrust