Ordering Coretime

There are two types of coretime:

  • Bulk coretime - rent computation for an amount of time in advance (i.e., 28 days), requires renewal.
  • On-demand coretime - buy computation on-demand on a per block basis, requires sending an extrinsic to order a block.

For EduChain, we mostly use on-demand coretime and place order when we need to test something.

Ordering on-demand coretime

Ordering via CLI

You can use the polkadot-js-api to call any extrinsic, including on-demand coretime for your parachain.

Ensure you have it installed:

yarn global add @polkadot/api-cli
# or
npm -g install @polkadot/api-cli

Once installed, you can send the extrinsic as follows. Be sure to supplement a seed phrase with ROC (faucet here) and also replace PARA_ID with your parachain's ID on Rococo:

polkadot-js-api tx.onDemandAssignmentProvider.placeOrderAllowDeath \
1000000000000 \
PARA_ID \
--seed "your seed here" \
--ws "wss://rococo-rpc.polkadot.io"

If you wanted, you could even do something a bit silly, such as have a shell script which orders a block every six seconds:

while :
do
    polkadot-js-api tx.onDemandAssignmentProvider.placeOrderAllowDeath \
        1000000000000 \
        PARA_ID \
        --seed "your seed here" \
        --ws "wss://rococo-rpc.polkadot.io"
    sleep 6
done

Ordering via PolkadotJS

Use the following guides to order on-demand coretime through PolkadotJS.

Ordering Bulk Coretime

Use the following guides to order bulk coretime.