https://github.com/formancehq/ledger
The programmable open source core ledger for fintech
https://github.com/formancehq/ledger
ledger
Last synced: about 2 months ago
JSON representation
The programmable open source core ledger for fintech
- Host: GitHub
- URL: https://github.com/formancehq/ledger
- Owner: formancehq
- License: mit
- Created: 2021-05-28T09:13:03.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2026-10-13T12:30:26.000Z (about 2 months ago)
- Last Synced: 2026-10-13T12:38:01.170Z (about 2 months ago)
- Topics: ledger
- Language: Go
- Homepage: https://formance.com
- Size: 125 MB
- Stars: 1,433
- Watchers: 20
- Forks: 216
- Open Issues: 40
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Codeowners: CODEOWNERS
- Claude: CLAUDE.md
Awesome Lists containing this project
- awesome-go-cn - ledger - moving applications. [![近一周有更新][G]](https://github.com/formancehq/ledger) [![godoc][D]](https://godoc.org/github.com/formancehq/ledger) (金融 / 检索及分析资料库)
- awesome-go-cn - ledger - **star:1130** A programmable financial ledger that provides a foundation for money-moving applications. [](https://github.com/formancehq/ledger) [](https://godoc.org/github.com/formancehq/ledger) (金融)
- awesome-go - formancehq/ledger - The programmable open source core ledger for fintech ☆`1,483` (Finance & Blockchain / Financial)
- fucking-awesome-go - ledger - A programmable financial ledger that provides a foundation for money-moving applications. (Financial)
- awesome-billing - Formance Ledger - 💸 MIT-licensed programmable double-entry ledger with the Numscript DSL, multi-currency, REST API, and Docker deployment usable standalone. Formance sells Enterprise add-ons (Wallets, Flows, Reconciliation, pre-built connectors, SSO, RBAC, audit logs) on top, but the core ledger is fully functional in OSS. (Accounting / Bookkeeping)
- awesome-go - ledger - A programmable financial ledger that provides a foundation for money-moving applications. Stars:`1.0K`. (Financial)
- awesome-go-plus - ledger - A programmable financial ledger that provides a foundation for money-moving applications.  (Financial / Search and Analytic Databases)
- awesome-go - ledger - A programmable financial ledger that provides a foundation for money-moving applications. (Financial)
- awesome-fintech - Formance Ledger - Programmable open source ledger with atomic multi-posting transactions and a built-in DSL (Numscript). (Banking Infrastructure)
README
# Ledger v3 - Raft Cluster
Distributed ledger system using the Raft consensus protocol to ensure data consistency across a cluster of nodes. The system uses a **single Raft group** to manage all ledgers and their transactions, providing strong consistency and simplified operations.
## Key Features
| Feature | Description |
| ---------------------------- | --------------------------------------------------------------- |
| **Distributed Consensus** | Uses etcd/raft for strong consistency across cluster nodes |
| **Single Raft Architecture** | All ledgers managed by one Raft group for atomic operations |
| **Pebble Storage** | High-performance LSM-tree storage engine (CockroachDB), pure Go |
| **Numscript Support** | Full support for Numscript transaction scripting |
| **Idempotency** | Built-in idempotency key support for safe retries |
| **Bulk Operations** | Process multiple transactions in a single request |
| **Observability** | OpenTelemetry (traces, metrics, logs) + Pyroscope profiling |
| **Request Signing** | Ed25519 request signing for authenticity and integrity |
## Architecture
```
┌─────────────────────────────────────────────────────────────┐
│ Client Applications │
│ (HTTP REST / gRPC / CLI Client) │
└─────────────────────────────────────────────────────────────┘
│
┌────────────────────┼────────────────────┐
▼ ▼ ▼
┌───────────────────┐ ┌───────────────────┐ ┌───────────────────┐
│ Node 1 │ │ Node 2 │ │ Node 3 │
│ (Leader) │ │ (Follower) │ │ (Follower) │
├───────────────────┤ ├───────────────────┤ ├───────────────────┤
│ HTTP :9000 │ │ HTTP :9000 │ │ HTTP :9000 │
│ gRPC :8888 │ │ gRPC :8888 │ │ gRPC :8888 │
├───────────────────┤ ├───────────────────┤ ├───────────────────┤
│ Single Raft │◄─┼─ Raft Protocol ──►│◄─┤ Single Raft │
│ Group │ │ │ │ Group │
├───────────────────┤ ├───────────────────┤ ├───────────────────┤
│ FSM (All Ledgers) │ │ FSM (All Ledgers) │ │ FSM (All Ledgers) │
├───────────────────┤ ├───────────────────┤ ├───────────────────┤
│ Store (Pebble) │ │ Store (Pebble) │ │ Store (Pebble) │
└───────────────────┘ └───────────────────┘ └───────────────────┘
```
## Quick Start
**Prerequisites:** Go 1.27+, [Just](https://github.com/casey/just), Nix with Flakes enabled.
```bash
# Setup (first time only)
direnv allow
# Start a single node
just run
```
For cluster deployment and Kubernetes, see the [Deployment Guide](./docs/ops/deployment.md).
## Development
```bash
just build # Build the application
just test # Run tests
just test-e2e # Run end-to-end tests
just generate-proto # Generate protobuf code
just pre-commit # Run all checks (generate, tidy, lint)
```
For more details, see the [Developer Guide](./docs/technical/).
## Documentation
| Guide | Audience |
| --------------------------------- | -------------------------------------- |
| [Operations](./docs/ops/) | Deploy, monitor, backup, CLI reference |
| [Development](./docs/technical/) | Architecture, conventions, testing |
| [Product Overview](./docs/sales/) | Features, benchmarks, v2 vs v3 |
| [Drafts & RFCs](./docs/drafts/) | Experimental designs |
See [docs/README.md](./docs/README.md) for full navigation.