Skip to content

Commit

Permalink
Merge pull request #2591 from input-output-hk/olgahryniuk-patch-1
Browse files Browse the repository at this point in the history
Update register_stakepool.md
  • Loading branch information
Jimbo4350 committed Apr 9, 2021
2 parents e9d99fa + 20555bd commit 9af6ed7
Showing 1 changed file with 41 additions and 22 deletions.
63 changes: 41 additions & 22 deletions doc/stake-pool-operations/register_stakepool.md
@@ -1,6 +1,6 @@
# Register a Stake Pool with Metadata
## Registering a Stake Pool with Metadata

Make sure you have access to:
First, make sure you have access to:

| File | Content |
| :--- | :--- |
Expand All @@ -19,17 +19,17 @@ Make sure you have access to:
| `vrf.vkey` | VRF verification key |
| `vrf.skey` | VRF signing key |

Registering your stake pool requires:
To register your stake pool you will need to:

* Create JSON file with your metadata and store it in the node and in a url you maintain
* Create a JSON file with your metadata and store it in the node and in the url you maintain
* Get the hash of your JSON file
* Generate the stake pool registration certificate
* Create a delegation certificate pledge
* Submit the certificates to the blockchain

**WARNING:** Generating the **stake pool registration certificate** and the **delegation certificate** requires the **cold keys**. So, when doing this on mainnet you may want to generate these certificates in your local machine taking the proper security measures to avoid exposing your cold keys to the internet.
**WARNING:** Generating the **stake pool registration certificate** and the **delegation certificate** requires using **cold keys**. When doing this on mainnet, you may want to generate these certificates in your local machine taking the proper security measures to avoid exposing your cold keys to the internet.

#### Create a JSON file with your pool's metadata
### Create a JSON file with your pool's metadata:

{
"name": "TestPool",
Expand All @@ -38,23 +38,40 @@ Registering your stake pool requires:
"homepage": "https://teststakepool.com"
}


Store the file in a url you control. For example [https://teststakepool.com/poolMetadata.json](https://git.io/JJWdJ) You can use a GIST in github to store the definition and git.io to make it short. Ensure that the URL is less than 65 characters long.
Store the file in the url you control. For example [https://teststakepool.com/poolMetadata.json](https://git.io/JJWdJ). You can use a GIST in Github to store the definition and git.io to make it short. Ensure that the URL is less than 65 characters long.

Example:

Gist-URL https://gist.githubusercontent.com/carloslodelar/38c7482070627092a427583cae8fa470/raw/7fddda4d258bf685d24ea3510fbde295b3920188/clrpool.json

Git.IO-URL https://git.io/JJWdJ

#### Get the hash of your metadata JSON file:
### Get the hash of your metadata JSON file

This validates that the JSON fits the required schema, if it does, you will get the hash of your file.
This validates that JSON fits the required schema, if it does, you will get the hash of your file:

cardano-cli stake-pool metadata-hash --pool-metadata-file pool_Metadata.json

>6bf124f217d0e5a0a8adb1dbd8540e1334280d49ab861127868339f43b3948af

### Register your relay nodes on-chain

The operator should register their relay nodes on-chain (including them into the pool’s registration certificate) to ensure that other peers on the network have an ability to connect to them. Registered relay nodes are continuously updated and added to a JSON dataset. IOG offers this [list of all registered relays categorized by geographical location](https://explorer.cardano-mainnet.iohk.io/relays/topology.json) for SPOs to consider for connection purposes. It is recommended that SPOs generate a configuration that uses 20 other SPOs as peers. The list allows selecting peers that are both nearby and far away so that there is strong inter-region connectivity.

To register your relay nodes during the creation of the pool registration certificate, specify their IP addresses and/or domain name using:

#### Generate Stake pool registration certificate
```
--pool-relay-ipv4 <IPADDRESS>
--single-host-pool-relay <DOMAIN_NAME>
```

After certificate submission, relay nodes will be added to the topology file enabling other SPOs to connect to them. Additionally, one of the IOG nodes will also establish a connection so that an operator has at least one downstream peer.

**Related topics:**

- [Establishing connectivity between nodes](https://docs.cardano.org/en/latest/getting-started/stake-pool-operators/establishing-connectivity-between-the-nodes.html)

### Generate Stake pool registration certificate

cardano-cli stake-pool registration-certificate \
--cold-verification-key-file cold.vkey \
Expand All @@ -67,6 +84,7 @@ This validates that the JSON fits the required schema, if it does, you will get
--mainnet \
--pool-relay-ipv4 <RELAY NODE PUBLIC IP> \
--pool-relay-port <RELAY NODE PORT> \
--single-host-pool-relay STRING <The stake pool relay's DNS name that corresponds to an A or AAAA DNS record> \
--metadata-url https://git.io/JJWdJ \
--metadata-hash <POOL METADATA HASH> \
--out-file pool-registration.cert
Expand All @@ -87,7 +105,7 @@ This validates that the JSON fits the required schema, if it does, you will get
| metadata-hash | the hash of pools json metadata file |
| out-file | output file to write the certificate to |

**You can use a different key for the rewards, and can provide more than one owner key if there were multiple owners who share the pledge.**
**You can use a different key for the rewards, and you can provide more than one owner key if there were multiple owners who share the pledge.**

The **pool-registration.cert** file should look like this:

Expand All @@ -101,7 +119,7 @@ The **pool-registration.cert** file should look like this:
46f1a68bdf8113f50e779d8158203a4e813b6340dc790f772b3d433ce1c371d5c5f5de46f1a68bdf
8113f50e779d80f6

#### Generate delegation certificate pledge
### Generate delegation certificate pledge

To honor your pledge, create a _delegation certificate_:

Expand All @@ -112,11 +130,11 @@ To honor your pledge, create a _delegation certificate_:

This creates a delegation certificate which delegates funds from all stake addresses associated with key `stake.vkey` to the pool belonging to cold key `cold.vkey`. If there are many staking keys as pool owners in the first step, we need delegation certificates for all of them.

#### Submit the pool certificate and delegation certificate to the blockchain
### Submit the pool certificate and delegation certificate to the blockchain

To submit the `pool registration certificate` and the `delegation certificates` to the blockchain by including them in one or more transactions. We can use one transaction for multiple certificates, the certificates will be applied in order.
To submit the `pool registration certificate` and the `delegation certificates` to the blockchain, include them in one or more transactions. We can use one transaction for multiple certificates, the certificates will be applied in order.

#### Draft the transaction
### Draft the transaction

cardano-cli transaction build-raw \
--tx-in <TxHash>#<TxIx> \
Expand All @@ -127,7 +145,7 @@ To submit the `pool registration certificate` and the `delegation certificates`
--certificate-file pool-registration.cert \
--certificate-file delegation.cert

#### Calculate the fees
### Calculate the fees

cardano-cli transaction calculate-min-fee \
--tx-body-file tx.draft \
Expand All @@ -146,12 +164,13 @@ Registering a stake pool requires a deposit. This amount is specified in `protoc

"poolDeposit": 500000000

#### Calculate the change for --tx-out
### Calculate the change for --tx-out

All amounts in Lovelace

expr <UTxO BALANCE> - <poolDeposit> - <TRANSACTION FEE>

#### Build the transaction:
### Build the transaction:

cardano-cli transaction build-raw \
--tx-in <TxHash>#<TxIx> \
Expand All @@ -162,7 +181,7 @@ All amounts in Lovelace
--certificate-file pool-registration.cert \
--certificate-file delegation.cert

#### Sign the transaction:
### Sign the transaction:

cardano-cli transaction sign \
--tx-body-file tx.raw \
Expand All @@ -172,14 +191,14 @@ All amounts in Lovelace
--mainnet \
--out-file tx.signed

#### Submit the transaction:
### Submit the transaction:

cardano-cli transaction submit \
--tx-file tx.signed \
--mainnet


#### Verify that your stake pool registration was successful.
### Verify that your stake pool registration was successful

Get Pool ID

Expand Down

0 comments on commit 9af6ed7

Please sign in to comment.