Kernel Registration (off-chain)
Last updated
Last updated
In this tutorial, we will have a mock API , which can use either the GET or POST method. This API works by taking the input parameter of wallet address, and returning the result of wallet score.
This page provides an example of both the GET method and the POST method.
For the GET method, the input parameter of a wallet address has to be sent within the API path.
Similarly, for the POST method, the input parameter of a wallet address has to be sent within the "Request" body. The "Response" of the API will return the wallet score.
In this tutorial, we will use a mock endpoint called <web2-off-chain.com>
.
As in the image above, some additional information is required.
Keep in mind that in order to register your service to be kernel supports only interacting with a single API endpoint. If you have multiple endpoints, you might need to modify your routes before registering on our platform.
You must provide the OpenAPI schema which will be called through the protocols.
Let's assume that the "Request" and "Response" of your API are in the below example code blocks:
The mock endpoint is <web2-off-chain.com/wallet-check-get-{
}>
.
For the GET method, the wallet address that needs to be checked is sent within the endpoint.
That will give us the OpenAPI schema, as in the below code block.
When using the POST method, tou must provide the OpenAPI schema, which will be called through the protocols.
Let's assume that the "Request" and "Response" of your API are in the below example code blocks:
The endpoint is <web2-off-chain.com/wallet-check>
.
The example of OpenAPI for POST method will be as in the code block below.
After clicking Upload, a CID will be generated for your specific off-chain API.
After filling the required information, "Fee Per Query" will be the crucial field in this process. It is the part where you, as service providers, can define how much users have to pay when they execute your services. The picture below shows the Fee Per Query and Staking sections. "Additional Information" contains optional fields where you can fill the name, logo, and more.
After pressing the "Activate" button at the bottom of the page, a review window will pop up for you to revise and confirm, as shown in the picture below.
Once you have submitted the transaction, a "Transaction Complete" window will be displayed.
Congratulations! You have successfully registered your service as one of our kernels!