Try   HackMD

Making calls on Kusama from Your Kreivo Community

Introduction

Yaay! You just created your community. Now, let's learn how to execute something on Kusama, from your Community.

Note: This tutorial assumes you're the admin of the community. If you already decentralized your community, and the admin is the community itself, you'll need to encode the final extrinsic and submit a referendum on your community track (this will be covered in the next part of this tutorials).

1. Craft the extrinsic to send

  1. Craft the extrinsic you want to execute in the name of the Community.
  2. Once you have the extrinsic crafted, copy the encoded call. You'll need it on a couple of places later.
    Image Not Showing Possible Reasons
    • The image was uploaded to a note which you don't have access to
    • The note which the image was originally uploaded to has been deleted
    Learn More →
  3. Go to the Runtime page, and submit the transactionPaymentCallApi.queryCallInfo runtime call with the following params:
    Image Not Showing Possible Reasons
    • The image was uploaded to a note which you don't have access to
    • The note which the image was originally uploaded to has been deleted
    Learn More →
    1. The encoded call, and
    2. The len of the call (you can get it by measuring the encoded call len —without the 0x prefix— and dividing by 2).
  4. Save the refTime and proofSize parameters.

2. Prepare the Sovereign Account

Note: Your Community owns two Sovereign Accounts. These accounts represent your Community on Kusama and other Parachains:

We'll soon submit a tool for you to know which are the Sovereign Accounts that represent your Community.

Deposit 0.1 KSM on the Sovereign Account that represents your Community on Kusama.

This amount will be used for the existential deposit of the account, and is enough to cover the costs XCM execution, the fees of the call, and any other related costs required (like submit deposits for referenda).

Prepare the XCM Send Call

We've prepared a base template to send some XCM instructions to Kusama needed to execute a call on the destination chain.

Note: This template is prepared to take a reasonable, conservative amount (5 µKSM) from your Community Sovereign Account in Kusama to cover for the base costs of executing the XCM instructions, and the costs of executing the call. Then, deposits the remaining amount back to the account.

Normally, Kusama takes between 1 µKSM and 3 µKSM, but some calls might charge a bit more. That's why we reserve 5 µKSM to cover for fees.

  1. Open the base template.
  2. Click on the Submission button to edit the fields and prepare the extrinsic.
    Image Not Showing Possible Reasons
    • The image was uploaded to a note which you don't have access to
    • The note which the image was originally uploaded to has been deleted
    Learn More →
  3. There is a couple of XCM instruction in this call you'd need to configure:
    1. On the Transact instruction, in the requireWeightAtMost field, paste the values you saved for refTime and proofSize.
    2. On the Transact instruction, in the call field, paste the encoded call.
      Image Not Showing Possible Reasons
      • The image was uploaded to a note which you don't have access to
      • The note which the image was originally uploaded to has been deleted
      Learn More →
    3. On the DepositAsset instruction, under the beneficiary field, set your community number in the Plurality id.
      Image Not Showing Possible Reasons
      • The image was uploaded to a note which you don't have access to
      • The note which the image was originally uploaded to has been deleted
      Learn More →
  4. Click on Submit Transaction.