# Entity Resolver Contract
Voters may want to access an index of the available elections. The best way to organize them is by grouping them by the entity that created them.
In Vocdoni, entities publish human readable metadata, but such metadata needs to be securely indexed on a Smart Contract.
# Entity Resolver
The Entity Resolver is the smart contract where the metadata of each entity is indexed. It leverages a standard ENS Resolver contract for its Text records, used as a key-value store.
The instance of the Results contract is resolved from
entities.vocdoni.eth on the ENS registry. In the case of Ethereum chains like
sokol, the contract can also act as a global ENS resolver.
entityId is the unique identifier of each entity, being a hash of its Ethereum address:
bytes32 entityId = keccak256 (entityAddress);
# Text Record storage
We make use of EIP 634: Storage of Text records in ENS (opens new window). It is a convenient way to store arbitrary data as a string following a key-value store model.
# Supported Text Record keys
Entities may define the following Text Records:
| ||'ipfs://12345,https://server/json'||Content URI to fetch the Entity's JSON metadata. |
See JSON schema.
| ||'ipfs://12345,https://server/gw.json'||Content URI to fetch a set of Gateways for the Entity. |
See Gateway Boot Nodes below.
| ||'wss://host/path'||Messaging URI where the Gateways of the entity should report their health status.|
| ||'ipns://12345,QmSrPmbaUKA3ZodhzPWZnpFgcPMFWF4QsxXbkWfEptTBJd'||Content URI to fetch the process archive record.|
vnd.vocdoni.gateway-heartbeat(as long as the entity has no Gateways)
# JSON Metadata
See Entity Metadata.
# Gateway boot nodes
Client apps may not be able to join P2P networks by themselves, so Vocdoni makes use of Gateways to enable decentralized transactions over HTTP or Web Sockets. A gateway Boot Node is a service provided by the Entity, and it defines a list of active Gateways that a client can use.
By default, Vocdoni (as an Entity) provides its own set of Voting and Web3 Gateways. However, entities may want to use their own infrastructure. To this end, the Entity's ENS Text Record
vnd.vocdoni.boot-nodes can be set to the Content URI of a BootNodes JSON file defining some of them.