6. Creating a stakepool certificate

This is the cool part, because after having done this, you will be able to restart your node as a stakepool. A stakepool certificate is essentially a transaction in the blockchain which says to the network "Hey! This is a stakepool, this is our fixed fee, operators fee,... here is our node ID,...".

Before doing the following steps, make sure your node is running.

6.1 Execute the following command in your second terminal tab

./jcli rest v0 account get youraccountaddress -h http://127.0.0.1:3100/api

Replace youraccountaddress with your address.

6.2 Execute the following commands in the right order:

curl -sLOJ https://raw.githubusercontent.com/input-output-hk/jormungandr-qa/master/scripts/createStakePool.sh
curl -sLOJ https://raw.githubusercontent.com/input-output-hk/jormungandr-qa/master/scripts/send-certificate.sh
chmod +x createStakePool.sh
chmod +x send-certificate.sh

6.3 Execute the following command to generate the stakepool certificate:

./createStakePool.sh 3100 fixedfee poolfee PRIVATE_KEY_SK | tee createStakePool_output.txt

Replace "fixedfee" with the fixed amount of ADA in Lovelaces you would like to charge (example: "100000000" for a 100 ADA fixed fee), replace "poolfee" with the percentage of the remaining value you would like charge (example: 1/10 for a 10% fee).

Make sur to replace PRIVATE_KEY_SK with your private key which you can find in the stakepool_owner_account.txt file.

Make sure you have the required 500 tADA before executing the command, otherwise it won't work.

This is what it should look like:

+ + ./createStakePool.sh 3100 10000 1/10 1000000 ed25519e_sk1lq2zcyms6exxan0xx2gufjt2hdgsxmytgv5fl7nd4agzc89e6eympdwrhc2e59zkhqrpp3gnc4cfp5kf9xqufr9kn7ddl5uvtdsr84q5rg3ge
tee createStakePool_output.txt
================ Blockchain details =================
REST_PORT: 3100
ACCOUNT_SK: ed25519e_sk1lq2zcyms6exxan0xx2gufjt2hdgsxmytgv5fl7nd4agzc89e6eympdwrhc2e59zkhqrpp3gnc4cfp5kf9xqufr9kn7ddl5uvtdsr84q5rg3ge
BLOCK0_HASH: c8a1b4b8cd3b6a6c39adba11f62c34230b37b388f5a8edfe8cd73e7b8f811f48
FEE_CONSTANT: 2
FEE_COEFFICIENT: 1
FEE_CERTIFICATE: 4
==================================================
#1. Create VRF keys
POOL_VRF_SK: vrf_sk15kyr7422z69urytz0j5yx8e0shdsg9hqsqe3cjw289xhkdhdfc9ssr2hdq
POOL_VRF_PK: vrf_pk1g3ac9l7fg27au7zxwc4tyj2pua35tfvrguwf0hg203rez3jffgvsqmtp57
#2. Create KES keys
POOL_KES_SK: kes25519-12-sk1qqqqqq9hcm2aqrhx024uxd748jkrs687qesd945guja5lzqlx36k74yn0g3mgtdevyqzla895ylcdlp8rcq7vqepp6nnpegyunvtupjs6qlyax2lxr8rdzkk846546jkahc5fj63yzhh9fx7ev3cg7x267fms0zdhxeeavzphdhf3cj8cnw9395xf7rufdkge2c033k32rf3q52sd3allhpmqzxrxgy9226236yhesals88l4wl3yupddxa5575cauz0pe2fwe56uhua4t77a8dajgnnmdf997dugx4wk523z3nqskxchp9dyguccwush6pqfax57dr7gj7zcjcrtmfugny3tzc6cyzkyy4wfe3fht6sf2tzy2v5f3kya6jehnz2lv6uqzd8jv7vr35l95g79rjcfrlc9xqrz8q7h2n6hl8lwhv0gdqjuctw40rrakjuhwgd0r2w7t5vwvvvkuuzxf9jq68a0u8kjxp4seeczlp7fmar4e9jc9pvn5hhc30knhfh0jnzckexlh9an053508x9m6qvt37ra4ls8h43req6lu2d8xgv9sptkf9syafvyhqkumqwpx28xng4s9uymv3tk82hhhrxh3kftxqghjt9874ry855axxsacnqxmzh9xxmkxgc5q2l9dgpdhrvdtdk9nhv32ct3yuaw432l5z4e9uct87l294qjnjgz40xk0vczffwqeu8x2l37k6kzjv8daee3hy2kv5f6fkxpd3npj3hmdhvr4d90sstm7v0rr6e5egtdmgd5w6s4n6ntzf7z0qmskrvs2drvejl0hdg7vt76a2a6frf7z3jnfze0d4402x437xa4whu8s4nmxpf5a67a96qvjawphntw6rpp48pzm08a0kr0ka5480w8jfjnlm55xuk06e5fudyq4dgj73kdphz9ssay4whtxssfc7wrwx33dudpddjlsvz6qphsttudlphsyteu5p6djuwt6mpdk27pfnpgftn2lnvnnpx952rz6rywhlqzwvecgud0sf3g059xqhfwn34acjhr5kzrqda3sj9wqp8kl9rts2a66ljecjfhay83l3qzgwscpy67wzcjn4pgq26ljhczkzg9y5lhgj75fa06wv09xmvrk6t4j2l8mrxwga7ksnsc55tl7qc3rhxwnxj4a070qu8g87xchcyuxp570zwjcw08auhy2tumsmmzh0rhrru8sngsd67mmz8dpdh9ssqtl5uksnlphuyu0qresryy82wv89qnjd30sx2rgrunjf7q4krr8c4ze5enlsq42rx9safl66wsknr8d8f7v09qr03lakkc6awayy9qmruu0l6u97hvgnz7slff9hrj9xu4atghjmc5d4wmznyeyq2th2ddwrmgercgjpl50f7qstg3kjlj3t402tp5pnesvjlg4zduvux3ev6sm5ja5j4uyum825pxz6jyeaqphpzggzef30tkxcvejnv5vk49qz7q429lwe45uhrn2d69hj64lq59hcd7dtds8nleshfqtxyw4mpvddjdsfu2c9448l688uq2xy7twsu8cnylv43jvh92fv2re9rrn9rz7jz04chms0x7zxcj8l7kdulxvvvjn4e70cmfnwn27jvw3a73t5y25uwpul9ygr9w76vhc8ptwz554sguc6mdmupp37r3fe8dyhmt99jqcv3kr0z99c6w230q377fxqfzj6alsv0dsmn039usva84z2vs4ajmjvpreue3qxs6vqxc5tqchu74l4fndcp27adeah2tku6excg6skhuwam4vy0y62mpa09ukk7rr3mdaxt9uw9zv7p2an7j0074hw5wvf2fx9cm2rn8yzvzfjmwqwc2u3t37smpwthqz8dyeukl5gmnyt5avy25elwzuwf838ce70rju477ycv2dxc4psv5uncjdz9ttyzp
POOL_KES_PK: kes25519-12-pk1lp3ta4aphvpct84cykhq37cd9vh9005y02gxhrnd0djdcns6up2sjgn884
#3. Create the Stake Pool certificate using above VRF and KEY public keys
Sign the Stake Pool certificate
SIGNED_STAKE_POOL_CERTIFICATE: signedcert1qvqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqz3rmstlujs4ameuyva32kfy5remrgkjcx3cujlws5lz8j9ryjjselp3ta4aphvpct84cykhq37cd9vh9005y02gxhrnd0djdcns6up2sr8kwjxh8kwxwgnuhx25lmdewkafq5dmc3thjrv0td8r7298m8pw7qqqqqqqqqqqzwyqqqqqqqqqqqqqsqqqqqqqqqqq2qqqqqqqqpapyqqqpqq23upxuk26389w6579x6988j6d6chsz2xvzptcelcsgnepyte4nf0rpln9j4vp70gs0z2kqysht2ztm06zrx2s473kjjc8a8m2024grxeq4sp
#4. Send the signed Stake Pool certificate to the blockchain
===============Send Certificate=================
CERTIFICATE_PATH: stake_pool.cert
REST_PORT: 3100
ACCOUNT_SK: ed25519e_sk1lq2zcyms6exxan0xx2gufjt2hdgsxmytgv5fl7nd4agzc89e6eympdwrhc2e59zkhqrpp3gnc4cfp5kf9xqufr9kn7ddl5uvtdsr84q5rg3ge
BLOCK0_HASH: c8a1b4b8cd3b6a6c39adba11f62c34230b37b388f5a8edfe8cd73e7b8f811f48
FEE_CONSTANT: 2
FEE_COEFFICIENT: 1
FEE_CERTIFICATE: 4
==================================================
#1. Create the offline transaction file
#2. Add the Account to the transaction
#3. Add the certificate to the transaction
#4. Finalize the transaction
#5. Make the witness
#6. Add the witness to the transaction
#7. Show the transaction info
---
balance: 0
fee: 7
input: 7
inputs:
- account: 9ece91ae7b38ce44f9732a9fdb72eb7520a37788aef21b1eb69c7e514fb385de
kind: account
value: 7
num_inputs: 1
num_outputs: 0
num_witnesses: 1
output: 0
outputs: []
sign_data_hash: e9ebf7833745cc254bbc1652b4247231946e46a3c343535de8e1de31e163af84
status: finalizing
#8. Seal the transaction
#9. Auth the transactions
#10. Encode and send the transaction
76c4ff1a8710036531f266dd2fab10183b319a68be04bd451081f9448e6f570d
#11. Remove the temporary files
#Waiting for new block to be created (timeout = 200 blocks = 400s)
New block was created - 80d812d1fc73a4c8dbd24bf42276ca1f008a93496259ea36a54017de6c76aeca
#5. Retrieve your stake pool id (NodeId)
f76184d75c075e08de3750fecd10e5956751f028b5056d121ce0ea87575f5970
============== Stake Pool details ================
Stake Pool ID: f76184d75c075e08de3750fecd10e5956751f028b5056d121ce0ea87575f5970
Stake Pool owner: ca1sk0vaydw0vuvu38ewv4flkmjad6jpgmh3zh0yxc7k6w8u520kwzauynxpks
TAX_VALUE: 10000
TAX_RATIO: 1/10
TAX_LIMIT: 1000000
==================================================
#6. Create the node_secret.yaml file

6.4 Check the results and look for "Stakepool Node ID"

This is the unique ID of your stakepool which allows you to identify in Cardano explorers

6.5 Execute the following command and check if your "Stakepool Node ID" is in the list:

./jcli rest v0 stake-pools get --host "http://127.0.0.1:3100/api"

Questions? Ask them in our Telegram chat!