Skip to content

Self Identification Steps for the Casper Mainnet Validators

Muhammet Kara edited this page Apr 8, 2024 · 12 revisions

Casper Account Info Contract allows account owners to provide information about themselves to the public by specifying their domain name, on which they will host a Casper Account Info Standard file.

Follow the steps below to identify the details of your validator on the Casper Mainnet. The commands are meant to be run on your Mainnet validator, and are tested on Ubuntu 20.04 LTS.

Prepare your Casper Account Info Standard file

  • Right click here and select Save Link As... (or the proper option for your Browser) to download the sample Casper Account Info Standard file.

  • Adapt the file to match your details. See the JSON Schema Specification for details about the schema and the possible values for each key.

  • Validate your account-info.casper.json file against the standard schema by pasting it into the second box here: https://www.jsonschemavalidator.net/s/ltMuxIEq

    • You should see the No errors found. JSON validates against the schema message at the bottom of the page.
  • Also make sure it passes the JSON validity checks here: https://jsonlint.com/

Important: The checks above are extremely important. If you publish an invalid JSON file, it will not be displayed correctly.

  • Then publish it at https://YOURDOMAIN/.well-known/casper/account-info.casper.json
    • (If your validator website is at https://mysupercaspervalidator.com, then your account info file should be publicly reachable at https://mysupercaspervalidator.com/.well-known/casper/account-info.casper.json)

Install the prerequisites

To run the commands in the instructions, you need to have a recent version of casper-client and jq installed. Run these commands to make sure you have them on your node:

sudo apt update
sudo apt install casper-client jq

Set URL for your account

Payment: The set_url entry point call payment should be 15 CSPR. The deploy may fail with an "Out of gas" error if a smaller amount provided. For the consecutive set_url calls the advised payment amount is 0.5 CSPR

If you are running the command below on your mainnet node, you should be able to simply copy/paste it, other than editing the domain portion to match your domain. The example below illustrates the value to set for the top level domain URL for an account information file that is hosted at https://MYSUPERCASPERVALIDATOR.COM/.well-known/casper/account-info.casper.json. (Please note that the url you provide here will be prominently displayed on the block explorers as your official website, and your account's public key must exist in the JSON data either in the nodes or affiliated accounts section for it to be successfully verified by CSPR.live and other dApps in the Casper ecosystem.)

sudo -u casper casper-client put-deploy \
    --chain-name "casper" \
    --node-address "http://127.0.0.1:7777/" \
    --secret-key "/etc/casper/validator_keys/secret_key.pem" \
    --session-hash "fb8e0215c040691e9bbe945dd22a00989b532b9c2521582538edb95b61156698" \
    --session-entry-point "set_url" \
    --payment-amount 15000000000 \
    --session-arg=url:"string='https://MYSUPERCASPERVALIDATOR.COM'"

Take note of the deploy hash returned from the command above, wait for a few minutes and confirm that your deploy succeeded by searching for it on https://cspr.live/.

Verify the account info for your validator

Clone the Casper Account Info Contract repo:

cd ~
git clone https://github.com/make-software/casper-account-info-contract.git

Then get the account information file content:

cd ~/casper-account-info-contract/tools
./get-account-info.sh --node-address=127.0.0.1 --contract-hash=fb8e0215c040691e9bbe945dd22a00989b532b9c2521582538edb95b61156698 --public-key=$(sudo -u casper cat /etc/casper/validator_keys/public_key_hex) | jq

You should see the content of your account info file as the output of this command. You can now proceed to CSPR.Live to see your details displayed there: https://cspr.live/validator/YOUR-PUBLIC-KEY