Server-SDK Integration
Long-Range and Long-Running Operations
Last updated
Long-Range and Long-Running Operations
Last updated
For applications where continuous webhook and contract event monitoring is required, a dedicated stable server setup provides uninterrupted connection.
A full code example of this set up, using an Node.js backend (hosted on render.com), is available here (frontend) and here (backend server), with the architecture running live at listener.irrevocable.dev.
The SDK also includes dedicated long-running functions that support the minting of PKPs directly from the server.
Further, the Listener Contract Factory can be deployed on Polygon as a persistant on-chain database for storing all logs generated by the running circuits on the server. These logs are stored with IPFS and can be accessed via a dedicated subgraph, making data retrieval efficient and streamlined for frontend queries. With this architecture, all logs are batched and signed to the Listener Database contract through an assigned PKP.
See here for a step by step walkthrough for getting started with a long range setup.