Join us on the Cardano testnet and delegate your first stake

Stake Nuts
3 min readSep 27, 2019
Stakenuts staking pool

As you might have already heard, Cardano shelley testnet is entering its second phase, where the communication between nodes is now possible. If you would like to join us in testing, in this guide we will show you how to delegate your funds to our staking pool.

Start your own node

As the first step, we are going to start your own node and join the network. Follow this guide that you have probably already seen, we need to install jormungandr version 0.5.2 or latest in order to join the network — this is important. Once this is done, create a new node.yaml configuration file with this content:

rest:
listen: "127.0.0.1:8443"
p2p:
trusted_peers:
— "/ip4/3.123.177.192/tcp/3000"
— "/ip4/3.123.155.47/tcp/3000"
— "/ip4/3.115.57.216/tcp/3000"
— "/ip4/3.112.185.217/tcp/3000"
— "/ip4/18.139.40.4/tcp/3000"
— "/ip4/18.140.134.230/tcp/3000"

This specifies that we want to start the node with the REST API on port 8443 and we want to reach these trusted peers provided by IOHK.

Now, start the node with the following command, you should see it reaching out to peers and starting syncing the blockchain.

# jormungandr --genesis-block-hash adbdd5ede31637f6c9bad5c271eec0bc3d0cb9efb86a5b913bb55cba549d0770 --config node.yaml

In a different window, we will use jcli to verify the node is running and communicating with the rest of the networking using the REST API.

# jcli rest v0 node stats get -h http://127.0.0.1:8443/api
— -
blockRecvCnt: 537
lastBlockDate: “217.14379”
lastBlockFees: 3650
lastBlockHash: 24b039178b7f90fff235eb1466b0858a3cca51f11e3ea1c8a7bb197963805111
lastBlockHeight: “8136”
lastBlockSum: 244883627118
lastBlockTime: “2019–09–27T15:52:52+00:00”
lastBlockTx: 3
txRecvCnt: 487
uptime: 1298

Watch closely the blockRecvCnt number, this one should be increasing.

Get the money

Once your node is up and running, it’s time to get some funds to play around. In order to do that, we first need to generate our account keys and addresses.

# ACCOUNT_PRV=$(jcli key generate --type=Ed25519Extended)# ACCOUNT_PUB=$(echo $ACCOUNT_PRV | jcli key to-public)# ACCOUNT_ADDR=$(jcli address account $ACCOUNT_PUB --testing)

Once this is done, we print out out account address.

# echo $ACCOUNT_ADDR 
ca1s5t0hg4fmtmxdy4ptgtcxk0zk2za7x4qwa62jhkjlwkktxu60jxcs0jdxc6

Head over to the Shelley Testnet Faucet website and request some funds to the address above. After you have done that, verify the state of you address.

# jcli rest v0 account get $ACCOUNT_ADDR --host http://127.0.0.1:8443/api
— -
counter: 0
delegation:
pools: []
value: 250000000000

250 000 ADA, sweet! I don’t have to work anymore.

Delegate your stake

Now it’s time to delegate your stake with our staking pool. For this to happen, we need to create a delegation certificate and sign it.

# jcli certificate new stake-delegation 969963a8b6cab96be257a37f2f27be6cc41c9561253b4da7c47704036024169a $ACCOUNT_PUB > stake_delegation.cert# echo $ACCOUNT_PRV > account_key.prv# cat stake_delegation.cert | jcli certificate sign account_key.prv | tee stake_delegation_signed.cert

Our delegation certificate is now signed, but we still need to include in the blockchain.

# jcli transaction new --staging tx# jcli transaction add-account $ACCOUNT_ADDR 11050 --staging tx# STAKE_SIGNED_CERT=$(cat stake_delegation_signed.cert)# jcli transaction add-certificate --staging tx $STAKE_SIGNED_CERT# jcli transaction finalize --staging tx# TRANSACTION_ID=$(jcli transaction id --staging tx)# echo $ACCOUNT_PRV > witness.secret# jcli transaction make-witness $TRANSACTION_ID  --genesis-block-hash adbdd5ede31637f6c9bad5c271eec0bc3d0cb9efb86a5b913bb55cba549d0770 --type "account" --account-spending-counter 0 witness witness.secret# jcli transaction add-witness witness --staging tx# jcli transaction seal --staging tx# jcli transaction to-message --staging tx | jcli rest v0 message post -h http://127.0.0.1:8443/api

Now, our certificate should be included in the blockchain which means our stake should be delegated. Let’s check that.

# jcli rest v0 account get $ACCOUNT_ADDR --host http://127.0.0.1:8443/api
— -
counter: 1
delegation:
pools:
— — 969963a8b6cab96be257a37f2f27be6cc41c9561253b4da7c47704036024169a
— 1
value: 249999988950

Congratulations, you just delegated your first stake in Cardano.

As always, keep in mind this is experimental and not endorsed by IOHK. If you find any problems, let us know at stakenuts.com.

Resources

--

--