Persistant Circuit Architecture

Quick Start for Server-SDK Integration.

  1. MintGrantAndBurn a PKP on Chronicle using the Lit Explorer.

    • Invoke mintGrantAndBurnNext using a keyType 2, the bytes hash of the IPFS CID found here which generates the unsigned transaction data for logging all instantiated circuits and circuit responses to the ListenerDB Contract and a value of 0.000000000000000001 LIT.

  2. Deploy your ListenerDB and ListenerAccessControl from the ListenerFactory on Polygon by invoking deployFromFactory with your minted PKP address, public key and tokenId.

  3. Set up an Node.js VM or similar and deploy your server architecture. For a full code example of the server <> sdk integration and set up see here.

    • If you use the same architecture and endpoints, make sure to call /connect once at the start when the server is live to correctly instantiate the Lit client that is used to save logs on-chain.

  4. Create and connect your frontend using NextJS or similar to the server. See a full code example here.

    • Queries can be made to the deployed Lit Listener Graph subgraph to retrieve the logs recorded on-chain.

    • All DB contracts deployed through the Factory can easily retrieve their associated logs through this subgraph, with optionality to sort each query via your deployed DB address.

  5. Make sure to fund your PKP address with enough MATIC to pay for the gas costs associated with broadcasting signed transactions to the deployed LitDB contract on Polygon network.

Last updated