Search
Duplicate
Try Notion
🚧🚧
Data Registry
Data registry is a governance curated data reference storage. It can be used for saving references to external resources such as files hosted via IPFS or GitHub along corresponding checksum and file size.
Main use case of the Data Registry is to prevent storing large files or otherwise long data/text sequences on-chain and instead only save the external URL's, metalinks or other types of distributed references. Data Registry guarantees integrity of externally hosted data thanks to on-chain checkum and provides additional informations about the file such as its encoding and size.
To modify Data Registry a PermCreateUpsertDataRegistryProposal (10) and PermVoteUpsertDataRegistryProposal (11) are required to vote on and create data registry modification proposal.
PROPERTY
TYPE
DESCRIPTION
key
string
Key by which property can be identified.
reference
string
Reference URL or other type of meta-link to externally hosted file
encoding
string
File encoding such as text, markdown, etc...
hash
string
SHA256 file checksum
size
integer
File size in Bytes
Code of Conduct
One of the most important properties of the Data Registry is code_of_conduct which can be treated as a Service-layer Agreement between network governance members and network users. It is nothing more then text based off-chain set of rules / network constitution describing expected behaviour of network actors and various other information that users and new members joining governance should be aware of.
Commands Examples
Proposals Creation
Bash
Copy
# CLI sekaid tx customgov proposal upsert-data-registry \ "$KEY" "$CHECKSUM" "$VALUE" "$FILETYPE" "$SIZE" \ --title="Upserting Data Registry key '$KEY'" \ --description="Assign value '$VALUE' to key '$KEY'" \ --from=$ACCOUNT --chain-id=$NETWORK_NAME --keyring-backend=test --fees=100ukex --yes --log_format=json --broadcast-mode=async --output=json # KM # e.g: upsertDataRegistry validator code_of_conduct "http://example.com/index.html" "text" upsertDataRegistry $ACCOUNT "$KEY" "$VALUE" "$FILETYPE"
​
Query All Keys
Bash
Copy
# CLI sekaid query customgov data-registry-keys --page-key 100000 --output=json | jq ".keys" # INTERX curl "<ip>:11000/api/kira/gov/data_keys" | jq ".keys" # KM showDataRegistryKeys # Example Output: [ "key-1", "key-2", "code_of_conduct", ... ]
​
Query Data By Key
Bash
Copy
# CLI sekaid query customgov data-registry "$KEY" --output=json 2> /dev/null || echo "" # INTERX curl "<ip>:11000/api/kira/gov/data/$KEY" | jq ".keys" # KM # e.g.: showDataRegistryKey "code_of_conduct" showDataRegistryKey "$KEY" # Example Output: { "hash": "08204c0416bd8ff4d68cea875cf86706ae96dc6c7b281f18cab3dce1277ae67f", "reference": "http://example.com/index.html", "encoding": "text", "size": "4933" }
​