Skip to content

Set Up Your Account to Produce Blocks on Tanssi

Introduction

Before you can start producing blocks on Tanssi and Tanssi appchains, you'll need to set up your account and establish your eligibility.

You must have spun up a block-producing node to tackle the account setup steps in this guide.

You'll need to set up your account by generating session keys and mapping those session keys to your account. This account is the one to which delegators will choose to delegate and where your rewards will be distributed. You can optionally establish a proxy account for additional security.

To establish eligibility, you must delegate yourself as a block producer and meet the minimum bond requirements.

By following the steps outlined in this guide, you'll learn everything you need to know to get started producing blocks within the Tanssi ecosystem.

Important Variables

When establishing eligibility to produce blocks, there are a couple of variables to be aware of:

  • Minimum self-delegation - there is a minimum amount you must self-delegate to be considered eligible
  • Session - a period that has a constant set of block producers
  • Tanssi block producers per session - the number of block producers assigned to Tanssi per session
  • Appchain block producers per session - the number of block producers assigned to a Tanssi appchain per session
Variable Value
Minimum self-delegation 10,000 DANCE
Session 600 blocks
Tanssi block producers per session 3 to 5 block producers
Appchain block producers per session 2 block producers

Map an Account to Your Block Producer Node

The first step is a two-step process that generates session keys and maps the session keys to your account. Session keys are used to perform network operations, such as signing blocks, whereas your account holds the staked funds and has an on-chain identity. By mapping the session key to your account, you create an association between your account and your block-producing node.

You will need to create session keys for your primary and backup servers. Each of your servers, your primary and backup, should have its own unique keys. Since the keys never leave your servers, you can consider them a unique ID for that server.

Generate Session Keys

Before generating session keys, you must be running a block-producing node.

To generate session keys, you'll send an RPC call, using the author_rotateKeys method, to your node's HTTP endpoint. For reference, if your block producer's HTTP endpoint is at port 9944, the JSON-RPC call might look like this:

curl http://127.0.0.1:9944 -H \
"Content-Type:application/json;charset=utf-8" -d \
  '{
    "jsonrpc":"2.0",
    "id":1,
    "method":"author_rotateKeys",
    "params": []
  }'

Your hex-encoded session keys will be printed to the terminal in the "result" field.

curl http://127.0.0.1:9944 -H \
"Content-Type:application/json;charset=utf-8" -d \
'{
"jsonrpc":"2.0",
"id":1,
"method":"author_rotateKeys",
"params": []
}'
{"jsonrpc":"2.0","result": "0x76afaf334bd33b82d0b8fbd6a2845cb3b9b785edf1dce4ccefd4973fa79fed2b","id":1}

Make sure you write down your session keys; you'll need to map your session keys to your account in the next section.

Map Session Keys

To perform the next step and map your session keys to your account, head to Polkadot.js Apps, click on the Developer tab, select Extrinsics from the dropdown, and take the following steps:

  1. Select your account, which should be the same account that you previously self-delegated
  2. Select the session module and the setKeys extrinsic
  3. For keys, enter your session keys
  4. For proof, enter 0x
  5. Click Submit Transaction and sign and send the transaction from your wallet

Create and submit an extrinsic to set session keys on Polkadot.js Apps

Using the session.keyOwner method, you can verify that your session keys have been mapped to your account as expected. To do this on Polkadot.js Apps, click on the Developer tab, select Chain state from the dropdown, and take the following steps:

  1. Select the session module and the keyOwner query
  2. Enter nmbs in the SpCoreCryptoKeyTypeId field
  3. For Bytes, enter your hex-encoded session keys
  4. Click the + button next to the extrinsic field
  5. The account associated with the session keys, which should be your account, will be displayed at the bottom of the page

Create and submit query to verify session keys on Polkadot.js Apps

Submit Self-Delegation

The next step towards becoming eligible to produce blocks on Tanssi and Tanssi appchains is to delegate to your own account. To do this, you'll be required to submit a minimum of 10,000 DANCE tokens.

After you've submitted the request to delegate, you'll need to wait for a minimum of two sessions before you can execute the pending request. There are 600 blocks in a session. So, two sessions are 1200 blocks, which can take around two hours.

Block producers are assigned upon each session, requiring two per appchain and a minimum of three to five for Tanssi. The block producers participating in the session are picked from the list of candidates ordered by total stake until the total number of block producers required is covered. So, you'll need to ensure that your total stake is enough to fill one of the slots, which may require more than 10,000 DANCE tokens.

Request Delegate

Head to Polkadot.js Apps, click on the Developer tab, select Extrinsics from the dropdown, and take the following steps:

  1. Select the account from which you want to send the extrinsic. This account must be the same account that you are delegating to and is the account that you want to become a block producer
  2. Select the pooledStaking module and the requestDelegate extrinsic
  3. Enter your account, which is, again, the same account you are sending the extrinsic from and the account you want to become a block producer
  4. Choose the target pool. The pool can either be the auto-compounding pool, which auto-compounds delegation rewards, or the manual rewards pool, in which all actions related to rewards are manual
  5. Enter the amount to stake. This amount must meet the minimum, which is 10,000 DANCE tokens. You'll need to submit the value in Planck, so for 10,000, you'll need to enter 10000000000000000
  6. Click Submit Transaction and sign and send the transaction from your wallet

Create and submit an extrinsic to self-delegate on Polkadot.js Apps

Execute the Pending Request

Before executing the pending request, you'll need to retrieve the session at which you submitted the request to delegate. To do so, head to Polkadot.js Apps, click on the Developer tab, select Chain state from the dropdown, and take the following steps:

  1. Select the pooledStaking module and the pendingOperations query
  2. Enter your account
  3. Toggle the include option slider off
  4. Click the + button next to the extrinsic field
  5. The pending request will be displayed at the bottom of the page

Query the pending self-delegation request on Polkadot.js Apps

In the example in the above image, the delegate request to join the auto-compounding pool was submitted during session 4,829. So, the request can be executed starting at session 4,831.

Take note of the operation and the session number at which you submitted the request, as you'll need both values to execute the pending request.

You can run another query from the Chain state page to check the current session. To do so, you can:

  1. Select the session module and the currentIndex query
  2. Click the + button next to the extrinsic field
  3. The current session will be displayed at the bottom of the page

Query the current session index on Polkadot.js Apps

If the request can be executed, select Extrinsics from the Developer dropdown and take the following steps:

  1. Select the account from which you want to send the extrinsic
  2. Select the pooledStaking module and the executePendingOperations extrinsic
  3. For delegator, enter your account, which is the same account you sent the self-delegate request from
  4. For operation, select the type of operation to execute. This should be either JoiningAutoCompounding or JoiningManualRewards, depending on the target pool you selected at the time of submitting the self-delegation request
  5. For candidate, enter the same account as you did in the delegator field
  6. For at, enter the session id at which you submitted the delegate request
  7. Click Submit Transaction and sign and send the transaction from your wallet

Create and submit an extrinsic to execute the pending self-delegation request on Polkadot.js Apps

Now, you have completed all of the necessary account setup to be eligible to produce blocks!

Verify That Your Account Is in the List of Eligible Candidates

If you've followed all of the steps in this guide and have fully synced your block-producing node, you are now eligible to produce blocks. To verify that you are in the list of eligible candidates, you can go to Polkadot.js Apps, click on the Developer tab, select Chain state from the dropdown, and take the following steps:

  1. Select the pooledStaking module and the sortedEligibleCandidates query
  2. Click the + button next to the extrinsic field
  3. A list of the eligible candidates and their stake will be displayed at the bottom of the page. You can search for your address to ensure you are eligible to produce blocks

Query the current list of eligible candidates on Polkadot.js Apps

Remember that you'll need to be in the top candidates by total stake to produce blocks, and this is based on the number of block producers required for each appchain and Tanssi.

Last update: May 3, 2024
| Created: February 28, 2024