Create Stakepool on Testnet
How to create a stakepool on Testnet
1. Install Cabal, GHC and Set PATH
Update packages and install Ubuntu dependencies:
sudo apt-get update -y
sudo apt-get upgrade -y
GETPKG_LIST="aptitude autoconf bc build-essential curl g++ git gnupg htop jq libffi-dev libgmp-dev libncursesw5 libpq-dev libsystemd-dev libssl-dev libtinfo-dev libtinfo-dev libtool make pkg-config rsync secure-delete tcptraceroute tmux wget zlib1g-dev"
sudo apt-get -y install ${GETPKG_LIST}Install Libsodium:
mkdir $HOME/git
cd $HOME/git
git clone https://github.com/input-output-hk/libsodium
cd libsodium
git checkout 66f017f1
./autogen.sh
./configure
make
sudo make installInstall Cabal:
cd
wget https://downloads.haskell.org/~cabal/cabal-install-3.2.0.0/cabal-install-3.2.0.0-x86_64-unknown-linux.tar.xz
tar -xf cabal-install-3.2.0.0-x86_64-unknown-linux.tar.xz
rm cabal-install-3.2.0.0-x86_64-unknown-linux.tar.xz cabal.sig
mkdir -p $HOME/.local/bin
mv cabal $HOME/.local/bin/Install GHC:
Update PATH to include Cabal and GHC and add exports. Your node's location will be in $NODE_HOME. The cluster configuration is set by $NODE_CONFIG and $NODE_BUILD_NUM.
Update cabal and verify the correct versions were installed successfully.
9. Generate block producer keys
Testnet ADA do not have value and to ease the build all commands are assumed to be run on BP (Block Producer) node. Do not do this on your production stake pool.
The block-producer node requires you to create 3 keys as defined in the Shelley ledger specs:
stake pool cold key (
node.cert)stake pool hot key (
kes.skey)stake pool VRF key (
vrf.skey)
First, make a KES key pair.
Cold keys must be generated and stored on your air-gapped offline machine. The cold keys are the files stored in $HOME/cold-keys.
Make a set of cold keys and create the cold counter file.
on Airgap
Be sure to back up your all your keys to another secure storage device. Make multiple copies.
Before continuing, your node must be fully synchronized to the blockchain. Otherwise, you won't calculate the latest KES period.
Your node is synchronized when the epoch and slot# is equal to that found on a block explorer https://explorer.cardano-testnet.iohkdev.io/en/browse-blocks
Find the kesPeriod by dividing the slot tip number by the slotsPerKESPeriod.
With this calculation, you can generate a operational certificate for your pool.
Copy kes.vkey to your cold environment.
Change the startKesPeriod value accordingly.
Copy node.cert to your hot environment.
Make a VRF key pair
Open a new terminal window and stop your BP node by running the following:
Update your BP startup script with the new KES, VRF and Operation Certificate.
Now start your block producer node.
10. Setup payment and stake keys
To create our transaction we will need the protocol parameters, so let’s query the parameters and save them in params.json
Create a new payment key pair: payment.skey & payment.vkey
Create a new stake address key pair: stake.skey & stake.vkey.
Create your stake address from the stake address verification key and store it in stake.addr
Build a payment address for the payment key payment.vkey which will delegate to the stake address, stake.vkey
Next step is to fund your payment address. Fill in the form below with your payment.addr
https://docs.google.com/forms/d/1BmPI3PsBChSIrpKBgroOjscRXe1vI7iQDFLNGVR6y2o/
Before continuing, your nodes must be fully synchronized to the blockchain. Otherwise, you won't see your funds.
After funding your account, check your payment address balance.
You should see output similar to this. This is your unspent transaction output (UXTO).
11. Register your stake address
Create a certificate, stake.cert, using the stake.vkey
You need to find the tip of the blockchain to set the ttl parameter properly.
Find your balance and UTXOs.
Find the keyDeposit value.
Run the build-raw transaction command
Calculate the current minimum fee:
Calculate your change output.
Build your transaction which will register your stake address.
Sign the transaction with both the payment and stake secret keys.
Sign transaction.
12. Register your stakepool
Create your pool's metadata with a JSON file. Update with your pool information.
Calculate the hash of your metadata file.
Now upload your poolMetaData.json to your website or a public website such as https://pages.github.com/
Find the minimum pool cost.
Pledge stake to your stake pool.
You need to find the tip of the blockchain to set the ttl parameter properly.
Find your balance and UTXOs.
Find the keyDeposit value.
Run the build-raw transaction command
Calculate the current minimum fee:
Calculate your change output.
Build your transaction:
Sign the transaction with both the payment and stake secret keys.
Sign transaction.
14. Configure your topology files
Publishing your Relay Node with topologyUpdater.sh
Create the topologyUpdater.sh script which publishes your node information to a topology fetch list.
Add permissions and run the updater script.
Update your relay node topology files
Create relay-topology_pull.sh script which fetches your relay node buddies and updates your topology file. Update with your block producer's public IP address.
Add permissions and pull new topology files.
18.4 Changing the pledge, fee, margin, etc.
Find the minimum pool cost.
If you're changing your poolMetaData.json, remember to calculate the hash of your metadata file and re-upload the updated poolMetaData.json file.
Update the below registration-certificate transaction with your desired settings.
If you have multiple relay nodes, refer to section 12 and change your parameters appropriately.
metadata-url must be no longer than 64 characters.
Pledge stake to your stake pool.
Copy deleg.cert to your hot environment.
You need to find the tip of the blockchain to set the ttl parameter properly.
Find your balance and UTXOs.
Run the build-raw transaction command.
Calculate the minimum fee:
Calculate your change output.
Build the transaction.
Copy tx.raw to your cold environment.
Sign the transaction.
Copy tx.signed to your hot environment.
Send the transaction.
Changes take effect next epoch. After the next epoch transition, verify that your pool settings are correct.
18.9 Send a simple transaction example
If you have not downloaded and install bech32 from https://github.com/input-output-hk/bech32/releases
Example sends 1000 ADA to Love2Stake address
First, find the tip of the blockchain to set the ttl parameter properly.
Set the amount to send in lovelaces. ✨ Remember 1 ADA = 1,000,000 lovelaces.
cho "daedalus-address" | bech32 addr_test
Set the destination address which is where you're sending funds to.
Find your balance and UTXOs.
Run the build-raw transaction command.
Calculate the current minimum fee:
Calculate your change output.
Build your transaction.
Copy tx.raw to your cold environment.
Sign the transaction with both the payment and stake secret keys.
Copy tx.signed to your hot environment.
Send the signed transaction.
Check if the funds arrived.
You should see output similar to this showing the funds you sent.
Last updated
Was this helpful?