RAILGUN Reloaded
    Preparing search index...

    Portable RailgunEngine for browser (and any non-Node) runtimes.

    Mirrors the Node engine's scan surface but never touches a filesystem or opens databases: the caller constructs a ChainStorage (for example from @railgun-reloaded/storage/browser) and injects it. The caller owns the storage lifecycle.

    Index
    • Construct a portable engine around an injected chain storage.

      Parameters

      • options: { chainId: number; chainStorage: ChainStorage; prover?: Groth16Prover }

        Required { chainId, chainStorage }, optional { prover }.

        • chainId: number

          EVM chain ID of the one chain that the storage holds.

        • chainStorage: ChainStorage

          Chain storage contract; caller owns its lifecycle (open/close/delete).

        • Optionalprover?: Groth16Prover

          Groth16 backend for proof-bearing operations.

      Returns RailgunEngine

    • Set Logger for Railgun Engine

      Parameters

      • log: (msg: string) => void

        Logger Function

      Returns void

    • Drain the data source into the chain storage, returning when the source reaches its current tip. Resumes from the persisted sync cursor when one exists, otherwise starts at startBlock or the network's deployment block. Live sources never reach a natural tip; bound the scan with endBlock when using one. Direct engine calls are not serialized. Await each scan before starting another on the same storage or data source. RailgunClient.scan() provides a per-client queue.

      Parameters

      • options: ScanOptions

        { dataSource, startBlock?, endBlock?, onBatch?, persistRailgunTransactions? }.

        • dataSource

          Source of blocks. The caller owns it; the engine never destroys it.

        • startBlock

          Inclusive floor used only without a persisted cursor. Must be at or above the network deployment block.

        • endBlock

          Inclusive ceiling; the scan exits after writing a block at or above this height.

        • onBatch

          Fired after each batch is committed with the resolved scan start and the highest block number in that batch. Synchronous; throwing aborts the run.

        • persistRailgunTransactions

          Whether to persist PPOI Railgun transaction rows while denormalizing blocks.

      Returns Promise<bigint | undefined>

      Last block number written, or undefined when the source had nothing to yield.

    • Get MerkleTree by treeNumber

      Parameters

      • treeNumber: number

        Input treeNumber

      Returns NoteCommitmentTree

      • NoteCommitmentTree instance
    • Get all the note commitment tree in the engine

      Returns Map<number, NoteCommitmentTree>

      • Map of treeNumber with corresponding NoteCommitmentTree instance