Discovery
Explains an architectural specification for the Discovery Registry
The Discovery Registry is designed to facilitate the discovery of Solvers operating on the TRAIN protocol. The system is fully decentralized, operating entirely on-chain, ensuring transparency and fairness. Thus, all registered Solvers are given equal opportunities to be discovered.
Governance (WIP)
The Discovery System is governed by a DAO, represented as the governor
. The governor is assigned by the contract creator and can only be set once using the assignGovernor
function.
The governor’s sole responsibility is to update the discovery service fees, and only the governor is authorized to call the updateFee
function.
Registration
Each Solver can register in the system by calling the register
function. The registration process requires providing the necessary data and specifying the desired discovery duration in days. Based on the specified duration, the Solver must lock the corresponding amount of ERC20 tokens in the Discovery System’s address, effectively burning them.
Discovery
To find a required Solver, any user can call the public discover
function by providing the source and destination chain details. The system will return all active Solvers whose discovery time has not yet expired.
Extension
When a Solver wants to extend its discovery time, it can call the extendDiscoveryTime
function by providing the Solver key and the desired extension duration in days. The Solver must lock the required amount of ERC20 tokens in the system’s address as a service fee based on the extension duration. If the discovery time has already expired, the new expiry time will start from the current timestamp. Otherwise, the expiry time will be updated by adding the new extension duration to the existing expiry time.
Cancellation
If a Solver wants to stop its discovery, the owner can call the stopDiscovery
function by providing the Solver key. If the discovery time has not yet expired, a refund will be calculated for the remaining duration and transferred to the fee payer who initially paid the registration fees.