YOYOW Block Producer Creation Tutorial and Common Commands

yoyow
7 min readJun 13, 2019

The user identity of the block producer on the YOYOW blockchain is the witness. After the YOYOW Mainnet 2.0 was released, some commands of the block producer have changed. The new tutorial is for your reference.

I. The Server Configuration:

Server configuration: The minimum configuration is recommended for 2 core CPUs with at least 4GB of RAM and 40GB hard drive.

This tutorial will take the Ubuntu 16.04 system as an example to introduce the process of creating and deploying a block producer.

II. The Software Installation:

1. Go to https://github.com/yoyow-org/yoyow-core/releases and download the latest executable file released depending on your operating system or get the source code from https://github.com/yoyow-org/yoyow-core/ to compile. The following will demonstrate how to configure by downloading the executable file:

Download the file:

# wget https://github.com/yoyow-org/yoyow-core/releases/download/v2.0.0-190531/yoyow-v2.0.0-ubuntu16-20190531.tgz

Decompress:

# tar zxvf yoyow-v2.0.0-ubuntu16–20190531.tgz

After decompression, two files will be obtained under the yoyow-v2.0.0-ubuntu16–20190531 folder: yoyow_node and yoyow_client.

Yoyow_node is a node program that is responsible for synchronizing data on blockchains, broadcasting transactions, and packaging transactions to produce new blocks.

Yoyow_client is a client program, also called a wallet program, that manages private keys, generates transaction information, and signs. Yoyow_client needs to connect to yoyow_node to use it.

III. The Node Synchronization Block

The block producer needs to maintain at least one full node (the yoyow_node process that synchronizes all data). It is recommended to use screen on linux to prevent the process from exiting.

# cd yoyow-v2.0.0-ubuntu16–20190531

# ./yoyow_node — rpc-endpoint 127.0.0.1:8090

Seeing the “Got block” message means that the operation is successful and the data is being synchronized.

1585526ms th_a application.cpp:522 handle_block ] Got block: #10000 00002710f9480417d70a548a44a4ca3dbae10d17 time: 2017–09–06T18:30:09 latency: 55007776526 ms from: 28182/init10 irreversible: 9991 (-9)

Whether or not the latest block has been synchronized can be judged based on the time of the block in the print information and the delay (the blue part). If the latest block is synchronized, the latest block information will be output every 3 seconds.

IV. Configure the Wallet

After yoyow_node is synchronized to the latest block, you can run “./yoyow_client” directly, and the default will be connected to the local 8090 port.

If the synchronization is not completed temporarily, you can connect to the public node by specifying the -s parameter, such as:

# ./yoyow_client -s wss://api-bj.yoyow.org

1. Set the key

When the prompt is displayed as new, you need to set the wallet password first. For example, the password is yoyow-pass, as follows

new >>> set_password yoyow-pass

set_password yoyow-pass

null

locked >>>

After setting the password, unlock the wallet (enter the previously entered password), and the wallet displays Unlock>>> to operate the wallet.

locked >>> unlock yoyow-pass

unlock yoyow-pass

null

unlocked >>>

2. Register an account

Log in to the web wallet URL: https://wallet.yoyow.org/ and follow the prompts to register your yoyow account. After the account is registered, for example, the account number is 25638, you can use the command to view:

unlocked >>> get_account 25638

get_account 25638

{

“uid”: 25638,

“name”: “init”,

“owner”: {

“weight_threshold”: 1,

“account_auths”: [],

“account_uid_auths”: [],

3. Import the private key

The private key can be viewed in the web wallet at https://wallet.yoyow.org/#/settings/viewpurview, click on the “active key” to view the private key, enter the password, and copy the private key.

Import the private key through import_key, followed by two parameters, one is the yoyow account name, and the other is the private key (here is your YOYOW wallet active key).

unlocked >>> import_key 25638 5Hqwx3xXMYZ55Pko9nzw34234234nXHcGfNQjNEL23424w7Py

4. Test transfer

You can transfer your second yoyow account to test the transfer, for example, transfer 100 YOYO tokens from the account “25638” to the account “test”.

unlocked >>> transfer 25638 test 100 YOYO “” true

The command deducts points to pay fees by default. If the points are insufficient, you can collect the accumulated points in the web wallet. If you have not accumulated enough points, you need to use the transfer_new interface, add the false value to the penultimate parameter, and use the tippings to pay fees, and you can refer to: transfer_new.

You can check if the transfer is received through the web wallet.

V. Create a Block Producer

1. Generate a signing key

Prepare a block producer by generating a key with suggest_brain_key. Remember to save this key and public key and they will be used in the later operation.

unlocked >>> suggest_brain_key

suggest_brain_key

{

“brain_priv_key”: “NONCOME WOG LIGULE FARAWAY ADEVISMALOOSE SORCER”,

“wif_priv_key”:”5A34DFDSFereGDGGERTRT87UJLKDFHGSHFFKDSFSDFHE4532624535G”,

“pub_key”:”YYW4UOIUFDSfjoiw750alsjfoiujasdjflsajdfaiyuhoasifjdOISUJKfsdh”

}

Inside the YYW is the public key, the wif_priv_key private key is stored by itself, do not leak (red for the public key, blue for the private key)

2. Create a block producer

The key used by create_witness here is the pub_key generated in the previous step.

unlocked >>> create_witness 25638 YYW4UOIUFDSfjoiw750alsjfoiujasdjflsajdfaiyuhoasifjdOISUJKfsdh 10000 YOYO “https://yoyow.org" true true

Note: The parameters of create_witness are as follows

<owner_account>

account id

<block_signing_key>

block signing key of the block producer

<pledge_amount>

pledge amount, at least 10,000 YOYOs

<pledge_asset_symbol>

pledge token type, currently only YOYO

<url>

block producer profile url

<csaf_fee>

Whether to use the points to pay fees, true: deduct points to pay fees, false: use tippings to pay fees

<broadcast>

Whether to broadcast a transaction

At present, creating a block producer on the Mainnet requires a pledge of at least 10,000 YOYOs, and consumes 1000 YOYOs. The handling fees cannot be paid by points or tippings, and must be deducted from the balance, so please ensure that there are enough YOYOs in the balance.

3. Check the block producer

unlocked >>> get_witness 25638

4. update_witness Modify the super node mortgage amount (mortgage 10,000 yoyow coins, ensure that the wallet balance has at least 10,000 yoyow coins)

unlocked >>> update_witness 25638 null 10000 YOYO null true true

The update_witness parameter is the same as the create_witness parameter. If you don’t want to modify a parameter, the parameter needs to be set to null.

The update_witness fee is the same as most operations. You can use the point deduction or the tippings to pay. If you have not accumulated enough points, you can set the second-to-last parameter to false and use the YOYOs in the tippings to pay fees.

5. Block producer voting

Vote for yourself

unlocked >>> update_witness_votes 25638 [25638] [] true true

Vote for others (for example, 25638 to vote for 23456)

unlocked >>> update_witness_votes 25638 [23456] [] true true

6. Then use the get_witness command to see the number of votes (“total_votes”), and the number of pledge (“pledge”)

7. Ctrl + C to exit the wallet command line

VI. Run the Block Producer Program

The third step is to synchronize the nodes. After synchronizing to the latest block, you can end the process by Ctrl+C and add the parameters of the block producer. It is important to note that Ctrl+C only needs to be pressed once and then waits for the exit.

Run the following command to bring the uid and the signing key of the block producer as parameters (here, the private key and the public key are the keys generated when the block producer is created)

# ./yoyow_node — rpc-endpoint -w 25638 — private-key

‘[“YYW4UOIUFDSfjoiw750alsjfoiujasdjflsajdfaiyuhoasifjdOISUJKfsdh”,”5A34DFDSFereGDGGERTRT87UJLKDFHGSHFFKDSFSDFHE4532624535G”]’

When the block is normally produced, a message similar to the following is displayed.

3249002ms th_a witness.cpp:183 block_production_loo ] Generated block #192100000781196d14610bc781ce1880193d153c0200 with timestamp 2017–08–18T01:54:09 attime 2017–08–18T01:54:09 by 28182/init10

VII. Block Producer Adjusting Pledge, Getting Income

Restart the command line wallet, connect to the node, and perform other inspection tests.

1. Use the get_witness command to see the block information, such as

unlocked >>> get_witness 25638

get_witness 25638

{

“last_confirmed_block_num”: 1975,

If you see

“signing_key”: “YYW1111111111111111111111111111111114T1Anm”,

It indicates that the block producer is offline. You need to reset the block signing key with the update_witness command to produce blocks normally.

unlocked >>> update_witness 25638 YYW4UOIUFDSfjoiw750alsjfoiujasdjflsajdfaiyuhoasifjdOISUJKfsdh null null null true true

2. Use the get_full_account command to see more detailed account information, including block rewards, etc.

unlocked >>> get_full_account 25638

get_full_account 25638

{

“uncollected_witness_pay”: 55500000,

The value divided by 100,000 is the actual YOYO amount, that is, the profit to be received is 555 YOYOs.

3. Receive a block reward / wage

Collect_witness_pay can receive the block producer block reward, the parameters are:

<account>

account id

<amount>

amount of wage received

<asset >

asset name, currently only YOYO

<csaf_fee>

Whether to use the point deduction to pay fees, true: deduct points to pay fees, false: use tippings to pay fees

<broadcast>

Whether to broadcast a transaction

For example, to receive the block producer reward (100 YOYOs) of account 25638:

unlocked >>> collect_witness_pay 25638 100 YOYO true true

4. If you don’t want to be a block producer, set offline first.

unlocked >>> update_witness 25638 YYW1111111111111111111111111111111114T1Anm null null null true true

Then change the deposit to 0 and return it after a certain period of time (if not deducted for malicious behaviors)

unlocked >>> update_witness 25638 null 0 YOYO null true true

VIII. Security Configuration

After the node is running normally, it is recommended to change the ssh port and change to the key login for node security.

A previous tutorial can also be referred to:

https://bitsharestalk.org/index.php/topic,24851.0.html

If you have any questions or other errors in the tutorial, please leave a message below the article, we will update the tutorial to everyone.

--

--