Canvas
⚡️ Instant database and sync engine for decentralized and local-first applications
Install / Use
/learn @canvasxyz/CanvasREADME
Canvas
Canvas is an embedded application database, similar to a fully-distributed version of Firebase or Supabase.
It allows you to build multiplayer, real-time, and offline-first applications, where each application is defined as a local bundle that replicates and verifies all user interactions.
Canvas applications are easy to configure and have several useful properties:
- Instant sync. No transaction fees or confirmation wait times. Any number of peers can concurrently execute new actions, without waiting for consensus.
- Real-time p2p. Peers connect and sync directly with each other over libp2p, and use GossipSub topics to broadcast actions.
- Eventually consistent and convergent. Actions can freely read and write to a relational database. Every peer's database state will deterministically converge regardless of the order in which actions are received.
- Self-authenticating. Every action is signed by a session key
authorized by a cryptographic identity, e.g. a Sign in with Ethereum
address or
did:plcidentifier. The entire action log can be verified and replayed by anyone at any time; applications are trustless and portable. - Cross-platform. Canvas apps run in the browser, server, or mobile devices. They persist data to IndexedDB in-browser, SQLite with on-disk storage, or Postgres with an in-memory Merkle index.
- Open-source. Built in the same spirit as libp2p and IPFS.
For more information, see the Canvas documentation.
Using Canvas
To install the latest published CLI:
npm install -g @canvas-js/cli
Commands
canvas init <path>: Initialize a sample applicationcanvas info <path>: Display application metadatacanvas run <path>: Run an applicationcanvas export <path>: Export the action log as JSON to stdoutcanvas import <path>: Import an action log from stdin
You can run each command with --help for more detailed documentation.
Contributing
Canvas is currently developed and maintained by a small team. For suggestions or contributions, we recommend first opening an issue or discussing with an existing contributor before opening a pull request.
For information about how to build this repo, see DEVELOPING.md.
License
MIT © Canvas Technologies, Inc.
Related Skills
feishu-drive
341.0k|
things-mac
341.0kManage Things 3 via the `things` CLI on macOS (add/update projects+todos via URL scheme; read/search/list from the local Things database)
clawhub
341.0kUse the ClawHub CLI to search, install, update, and publish agent skills from clawhub.com
postkit
PostgreSQL-native identity, configuration, metering, and job queues. SQL functions that work with any language or driver
