Create and Manage Meta-data
Meta-data JSON File and URL
Meta-data URL
Please ONLY have the meta-data JSON file at the URL you registered your pool with so that the foundation supported delegation/staking interface can interpret the pool information correctly. For example, https://jennijuju.github.io/stakeFrites.json is hosting the meta-data JSON file of one of the pools. If you want to include any additional information, they can be hosted at the pool URL, i.e: https://jennijuju.github.io/, and it should be included in the meta-data JSON file as the
Pool URL
.
The pool operator must host a JSON file at the metadata URL (HTTPS over TLS), with the following schema:
Schema version
: A version number, to identify the schema. This is here to enable upgradability.Logo
: A thumbnail containing the logo of the pool. The image MUST be base64 encoded PNG, with the dimensions of 256 pixels-square. The logo is encoded using this online tool.Description
: A βtell me about yourselfβ-style, short description for users to consume when making stake delegation decisions. This field shall not exceed 256 characters.Name
: A human-readable name for the pool. This field shall not exceed 64 characters.Tags
: These serve as keywords for any search functionality to be exposed by any ADS user interface. This is a JSON array. The size of this array shall not exceed 10 elements, with each element not exceeding 35 (valid) characters.Pool URL
: This is a URL, pointing interested delegators to the homepage of the pool, for additional information to peruse, to help make their delegation management decisions.
Example
An example json can be found here.
Steps for Updating the Meta-data Content
- Notifying the delegators.
- Update the content of the JSON file and/or the url that is hosting it.
- Update the meta-data url and content hash corresponding to the new contents in the Pool Registry.
Get the Meta-data Content Hash
UPK Interface
If you are using the UPK interface to register a pool or updating a meta-data content hash, you only need to paste the meta-data JSON file and the interface will generate the hash for you.
This is the Blake2b hash of the meta-data content JSON object. When a pool operator updates the metadata hosted at the meta-data URL, they must also update the meta-data content hash on-chain.
Use hashFile.sh
Pool operator can hash the JSON file using the hashFile script.
Download the Script
Open a terminal and navigate to the desired directory where you want to save the scripts, then run the following commands to get the scripts:
wget https://github.com/aionnetwork/staking_pool_scripts/releases/download/1.0/staking_pool_scripts-1.0.tar.gz
tar xvf staking_pool_scripts-1.0.tar.gz
cd staking_pool_scripts-1.0/
Run hashFile.sh
We will use hashFile.sh
to get the hash of metadata JSON file.
Usage
./hashFile.sh path_to_file
Inputs
path_to_file
: The relative path to the meta-data JSON file.
Example
For the example below, the meta-data JSON file is located in j3npool
folder.
./hashFile.sh ../j3npool/metadata.json
And the output we get is:
Meta-data content hash:
0x3a464616c24c3caaffe31d9f3883822e18f8e871ab93fe8449e8d534baee3215
Update Meta-data Url and Content Hash
The pool operator can change the metadata shown in the interface, by updating the content hash and/or the metadata URL. Since the metadata only contains display information about the pool, this feature can be used by pools to communicate updates and announcements to the delegators.
Update the meta-data using:
- Unity Pool Kit (UPK): a front end tool with ledger support.
- Script: terminal cli.
Use the UPK (Unity Pool Kit)
You can use the UPK interface to update your pool's metadata url and/or content hash using ledger.
- Go to UPK Interface, use the web version or get the desired build:
a. Mainnet
b. Amity Testnet - Sign in with your ledger and select the account that you used as your
management key
for pool registration and click theAccess
button. - Click on
Staking
on the left navigation bar. - Click on
Edit my Pool
to update pool information. - Input the new meta-data url/data(json). Click
Update Meta
once all information has been confirmed. - Confirm the transaction on your ledger, then the transaction hash will be shown on the interface. You can go to the OAN dashboard to track your transaction status.
Updated Information
It may take a while for your updated information to be shown as the transaction is getting mined in the network and the pool interface will pull the information after 7 block confirmations.
Use the updateMetaData.sh
The pool operator can use the updateMetaData script to update the meta-data url and content hash.
Download the Script
Open a terminal and navigate to the desired directory where you want to save the scripts, then run the following commands to get the scripts:
wget https://github.com/aionnetwork/staking_pool_scripts/releases/download/1.0/staking_pool_scripts-1.0.tar.gz
tar xvf staking_pool_scripts-1.0.tar.gz
cd staking_pool_scripts-1.0/
Run updateMetaData.sh
We will use `updateMetaData.sh' to update the hash of metadata JSON file and the url that is hosting the JSON File.
Usage
./updateMetaData.sh node_address(ip:port) pool_private_key metadata_url metadata_content_hash network_name(amity/mainnet)
Inputs
node_address
: node address in ip:port format. For example: 127.0.0.1:8545private_key
: private key of the pool's identity address, a.k.a the pool operator's management key. Input either the full 64-bytes private key or the first 32-bytes of the private key both with0x
.metadata_url
: the new url where the meta-data JSON file is hosted.metadata_content_hash
: the hash of the new metadata JSON file.network_name
:amity
testnet ormainnet
.
Example
For the example below, we are trying to update the metadata on mainnet. The new meta-data JSON file is hosted on https://jennijuju.github.io/stakeFrites.json
and the updated hash is 0x558729f5c8468f52b1f532ed53de5df98c0b94c66620c9e6f92b90f06f47a365
.
/updateMetaData.sh localhost:8545 0x***************************************************** https://jennijuju.github.io/stakeFrites.json 0x558729f5c8468f52b1f532ed53de5df98c0b94c66620c9e6f92b90f06f47a365 mainnet
And the output we get is:
New metadata URL = https://jennijuju.github.io/stakeFrites.json
New metadata content hash = 0x558729f5c8468f52b1f532ed53de5df98c0b94c66620c9e6f92b90f06f47a365
Using nonce 1
Updating metadata...
Transaction hash: "0xc367d14de648f9577b0ecd738f587ca8cd37202233705ac29b6671cb00a28ff1". Waiting for transaction to complete...
waiting...
waiting...
waiting...
Metadata update completed
Sufficient Balance
Make sure your management account has sufficient balance to pay for the gas fee of contract transaction.
Updated about 5 years ago