Crate zcash_client_sqlite

Source
Expand description

An SQLite-based Zcash light client.

zcash_client_sqlite contains complete SQLite-based implementations of the WalletRead, WalletWrite, and BlockSource traits from the zcash_client_backend crate. In combination with zcash_client_backend, it provides a full implementation of a SQLite-backed client for the Zcash network.

§Design

The light client is built around two SQLite databases:

  • A cache database, used to inform the light client about new CompactBlocks. It is read-only within all light client APIs except for init_cache_database which can be used to initialize the database.

  • A data database, where the light client’s state is stored. It is read-write within the light client APIs, and assumed to be read-only outside these APIs. Callers MUST NOT write to the database without using these APIs. Callers MAY read the database directly in order to extract information for display to users.

§Feature flags

  • multicore (enabled by default) — Enables multithreading support for creating proofs and building subtrees.
  • orchard — Enables support for storing data related to the sending and receiving of Orchard funds.
  • test-dependencies — Exposes APIs that are useful for testing, such as proptest strategies.
  • transparent-inputs — Enables receiving transparent funds and sending to transparent recipients

§Experimental features

  • unstable — Exposes unstable APIs. Their behaviour may change at any time.
  • expensive-tests — A feature used to isolate tests that are expensive to run. Test-only.

Modules§

  • Functions for enforcing chain validity and handling chain reorgs.
  • Error types for problems that may arise when reading or storing wallet data to SQLite.
  • Functions for querying information in the wallet database.

Structs§

  • The ID type for accounts.
  • A handle for the SQLite block source.
  • FsBlockDbunstable
    A block source that reads block data from disk and block metadata from a SQLite database.
  • An opaque type for received note identifiers.
  • A wrapper for a SQLite transaction affecting the wallet database.
  • A newtype wrapper for sqlite primary key values for the utxos table.
  • A wrapper for the SQLite connection to the wallet database.

Enums§

  • Errors that can be generated by the filesystem/sqlite-backed block source.