Set Up a Server
For any smart contract, with or without an off-chain handler, the next step is to set up a server to run it. In this example, we will create a simple JSON-RPC
server using the Hybrid Compute SDK. Add the lines to your "addsub" script:
Why is that?
The bundler sends us a JSON-RPC v2
request, containing a method
identifier. This identifier is the function selector of the desired off-chain method, along with several standard parameters (the names of which are subject to change) and a payload
which contains the ABI-encoded request data:
With the server set up, proceed to the following section to learn how to write our own smart contract.
Last updated