Users can use these registries by submitting the address of a registry known to them with the authenticated POST /registries endpoint, which creates an id for the registry, and later submit entries to the registry by calling POST /registries/:id { "cid": "ipfs-directory-hash" }.
A list of all registries owned by a user can be retrieved by calling GET /registries?ownerId=:userId. A single registry can be retrieved with its id. When requesting a single registry, its last 10 entries are also returned.
To enable interaction with Ethereum registries, an Ethereum account is created for each user upon sign up. For users that had signed up before this change, the creation of an Ethereum account can be manually requested by PATCH /users/:id { "ethereumRegistryPrivateKey": true }, where ethereumRegistryPrivateKey can be set to any truthy value. Calling this endpoint will not overwrite a present ethereumRegistryPrivateKey, only set it if unset.
The address of this account is exposed in GET /accounts/:issuer as ethereumRegistryAddress if the requester owns the requested account, but hidden from the general public.
This account is used to sign the transactions that add to the Ethereum registry, and the user will need to ensure this address has enough funds to pay for the transaction fees.
The implementation uses eth-lib's Account.create directly rather than web3's because
web3 plans to drop this dependency (which is severely dated), but it's still using it in both the 1.x and 2.x branches.
POST /registries/:id { "cid: "value" } does its best to create, sign and send the smart-contract-modifying transaction, catch any errors that happen and return as fast as possible.
For example, if the associated Ethereum account has insufficient balance to pay for fees, this error will be reported back to the user of the API immediately.
Not to block I/O, this call does not wait for any block confirmations whatsoever. This means that other possible errors, such as the transaction being reverted by the EVM or never being mined at all, will not be reported.
This PR adds registries endpoints to Frost.
Users can use these registries by submitting the address of a registry known to them with the authenticated
POST /registries
endpoint, which creates an id for the registry, and later submit entries to the registry by callingPOST /registries/:id { "cid": "ipfs-directory-hash" }
.A list of all registries owned by a user can be retrieved by calling
GET /registries?ownerId=:userId
. A single registry can be retrieved with its id. When requesting a single registry, its last 10 entries are also returned.To enable interaction with Ethereum registries, an Ethereum account is created for each user upon sign up. For users that had signed up before this change, the creation of an Ethereum account can be manually requested by
PATCH /users/:id { "ethereumRegistryPrivateKey": true }
, whereethereumRegistryPrivateKey
can be set to any truthy value. Calling this endpoint will not overwrite a presentethereumRegistryPrivateKey
, only set it if unset.The address of this account is exposed in
GET /accounts/:issuer
asethereumRegistryAddress
if the requester owns the requested account, but hidden from the general public.This account is used to sign the transactions that add to the Ethereum registry, and the user will need to ensure this address has enough funds to pay for the transaction fees.
The implementation uses
eth-lib
's Account.create directly rather than web3's becausePOST /registries/:id { "cid: "value" }
does its best to create, sign and send the smart-contract-modifying transaction, catch any errors that happen and return as fast as possible.For example, if the associated Ethereum account has insufficient balance to pay for fees, this error will be reported back to the user of the API immediately.
Not to block I/O, this call does not wait for any block confirmations whatsoever. This means that other possible errors, such as the transaction being reverted by the EVM or never being mined at all, will not be reported.