ledgerforge README

项目的 README,来自 github.com/devaccuracy/ledgerforge。合并为一个 markdown 文件:README.md。

LedgerForge

The ledger for AI-native money movement

The system of record for fintech wallets, payouts, marketplaces and billing — with spending limits that keep AI agents in check and an audit trail you can prove.

Latest release Build and Test License: Apache 2.0 Go 1.26.9 or later Go Reference

Website · Docs · Cloud · Changelog · Roadmap

Open-source core (Apache 2.0) · Managed with LedgerForge Cloud · Enterprise

LedgerForge is an open-source double-entry ledger. It records wallet transfers, payouts, billing activity, reservations and refunds in exact integer units, backs that history with a verifiable audit chain, and enforces spending policies on every API key, including the keys your AI agents use. Use it through an HTTP API, a Go library or a local MCP server.

PostgreSQL stores the financial records and Redis runs queues and background workers; search and observability services are optional. LedgerForge records money movement. Connecting payment rails and defining your accounting model remain application responsibilities.

Use cases

Why LedgerForge

Accounting guarantees

See ledger concepts for amount handling, balance semantics and asynchronous transaction states.

Quickstart: a balanced transfer

Requires Docker with Compose and Python 3:

git clone https://github.com/devaccuracy/ledgerforge.git
cd ledgerforge
./examples/quickstart/start.sh
./examples/quickstart/transfer.sh

This local-only demo builds the current checkout, generates a random master key, runs migrations and binds the API to 127.0.0.1:5001. It creates two USD balances and posts 12.50 synchronously using integer units. The source gets a bounded demo overdraft of 12.50; the result is -1250 and 1250 units, with equal total debits and credits. A retry with the same reference must leave those balances unchanged.

source: -1250 units
destination: 1250 units
total debits = total credits = 1250 units
reference retry: balances unchanged

Stop it with docker compose -p ledgerforge-demo -f examples/quickstart/compose.yaml down. The example guide covers the API payload, credentials and cleanup. These credentials and database defaults are for local use only; read the deployment guide before exposing a service.

Install

Run ledgerforge version to confirm what you installed, then follow the deployment guide and run ledgerforge migrate up before starting the server. Before upgrading an existing database, read the integrity upgrade notes.

Run the published image locally

cp ledgerforge.example.json ledgerforge.json
# Replace server.secret_key with a random secret before starting.
# For example, generate one with: openssl rand -hex 32
docker compose up -d

The config explicitly enables authentication. API requests use the X-LedgerForge-Key header. Keep ledgerforge.json private and out of version control. The :main image tracks tested main-branch commits; pin a release tag or digest in production with LEDGERFORGE_IMAGE.

Open source and LedgerForge Cloud

Everything in this repository is free and open source under Apache 2.0: the ledger, verification and audit tooling, agent spending policies and approvals, the MCP server and the release artifacts. There are no license keys or feature gates, and you can run it in production yourself.

LedgerForge Cloud is a service, not different software: it operates the same open-source core for you.

Open source LedgerForge Cloud Enterprise
What it is The software in this repository Managed LedgerForge deployments, operated per customer Contracted deployment, support and review services
Ledger, verification, agent policies, MCP server Included Same open-source core Same open-source core
Who operates it You The LedgerForge team (dedicated infrastructure per customer) You or the LedgerForge team, per contract, including in-VPC deployments
Upgrades, backups and monitoring You Operated for you Agreed per contract, with migration and integration assistance
Verification and audit checkpoints You run ledgerforge verify and audit export Scheduled ledgerforge verify runs with audit checkpoints exported and anchored for each deployment Architecture and audit reviews
Support Community, through GitHub Onboarding and support SLA and support plan agreed per contract; priority security response
Hosted multi-tenant service with a dashboard — Planned (roadmap) —
Price Free Request access Contact sales
Get started Quickstart Request access Contact sales

Documentation

The documentation index lists every guide. Start with:

Online documentation is at ledgerforge.io/docs. The roadmap describes what is planned and the changelog records what has shipped.

Development

make verify
make test-integration
make vuln
make cover

CONTRIBUTING.md covers prerequisites, isolated integration tests and pull request expectations.

Community, support and license

Licensed under Apache 2.0. Required notices are in NOTICE.md.

ledgerforge (devaccuracy/ledgerforge)

正在搜索数据库…

这是什么?LedgerForge 是一个开源的复式记账账本,面向金融科技钱包、交易市场和转移资金的 AI 智能体,以精确的整数单位记录钱包转账、付款、账单活动、预留和退款。
这是我自己部署的数据库,还是托管的 API 服务?它是一个自托管的权威记录系统:由 Go 服务器驱动,以 PostgreSQL 存储数据(并用 Redis 处理队列),由你自行部署,可通过 HTTP API、Go 库或本地 MCP 服务器使用;同时也提供托管的 LedgerForge Cloud 选项。
在正式部署之前,我怎样先试一下转账?使用 Docker Compose 和 Python 3 运行本地快速入门演示:它会构建当前代码检出版本、执行数据库迁移、将 API 绑定到 127.0.0.1:5001,然后在两个演示用的美元(USD)余额之间提交一笔借贷平衡的 12.50 转账。
除了 LedgerForge 二进制程序本身,还需要运行哪些组件?PostgreSQL 用于存储财务记录,Redis 负责运行队列和后台工作进程;搜索和可观测性服务是可选的附加组件。
LedgerForge 自己会通过支付通道转移资金吗?不会——它只记录资金流动;接入实际的支付通道以及定义你自己的会计模型,由你的应用负责。
在生产环境中使用它是否需要企业版或云版?不需要。账本、验证工具、智能体支出策略和 MCP 服务器等全部功能均以 Apache 2.0 协议免费提供,没有许可证密钥或功能限制,你可以自行在生产环境中运行;LedgerForge Cloud 和企业版是基于同一核心之上的可选托管或签约版本。
MCP 服务器有什么用?它让 AI 智能体通过模型上下文协议(Model Context Protocol)连接到账本,并绑定到特定的 API 密钥,使智能体的支出始终处于该密钥在服务器端强制执行的限额之内。
如何防止 AI 智能体超支?每个智能体都有自己的 API 密钥,其上设有币种限额、白名单、每日预算和审批预留,这些限制由服务器而非客户端强制执行;派生的密钥会继承并共享其上级密钥的预算。
我怎样确认账本没有被篡改?只读命令 ledgerforge verify 会针对带版本号、可导出的审计检查点重放会计凭证;这些检查点还可以通过 audit verify --anchor 独立锚定。
金额如何表示,才能避免舍入误差?所有过账和余额都使用带明确精度的整数单位,例如精度为 100 时,1250 表示 12.50,从而避免浮点数输入造成的精度丢失。
有哪些类似的项目?QuantDinger, casdoor, omnara, sentio, labtether, halofy, goshen-email, lago
大小
3.9 MB
星标
323
时长
6个月
提交 · 90 天