Getting started with the Kenshi Oracle Network is easy. The logic part of your oracle can be developed in the language of your choice, it only needs to implement the Custom Oracle Protocol. You can host the logic part on any serverless (or serverful) solutions such as
- AWS Lambda
- Cloudflare Workers
- Microsoft Azure Functions
- Google Cloud Functions
- Netlify Functions
Once you're ready with the logic side of your oracle, you can head to the Kenshi Dashboard and click on the "Custom Oracle" tile. Follow the instructions on the "New Oracle" form to deploy your custom oracle.
Once you deploy your oracle, you can see the address of the gas wallet associated with your oracle on the Custom Oracle Dashboard. You must supply enough gas to this address for oracle network to fulfill your oracle's requests.
The Kenshi Nonce Manager is an Ethereum compatible nonce management solution by Kenshi for sending transactions in parallel. It is crucial to understand how the Kenshi Nonce Manager works. For each request to your smart contract, the Kenshi Nonce Manager:
- Assigns a nonce, keeping track of the last used nonce in the database,
- Estimates the gas required to fulfil the request,
- Uses the gas estimate and the assigned nonce to sign and send a transaction to fulfil the request,
- Increases the gas and resends the transaction if the transaction doesn't get approved within a minute,
- Burns the nonce by re-using it in a zero-eth transfer transaction if transaction isn't fulfilled after three retries,
- Re-schedules the request fulfilment for later if the assigned nonce is burned.
If there are gaps in the nonce or there are too many canceled transactions due to errors such as network congestion or RPC node failures, the Nonce Manager will eventually burn the entire gas in the oracle's wallet. The Kenshi Nonce Manager tries to prevent such scenarios and keep the nonces in order. However, Kenshi cannot guarantee the procedure is error-free.
To prevent catastrophic events, Kenshi allows adjusting the maximum number of unresolved requests sent to the blockchain from your oracle. When choosing a number for this parameter, you should consider the risks involved in nonce management, as well as the needs of your application.