Updates
This commit is contained in:
@@ -1,28 +1,38 @@
|
||||
# hyper-p2p-credit-ledger
|
||||
|
||||
**Status:** scaffold (`0.0.0-scaffold`) · **Protocol:** `credit-ledger/v1` · **Wave:** 8
|
||||
Gossip-replicated credit accounts: open, credit, debit, and peer-to-peer transfer.
|
||||
|
||||
Credit ledger gossip.
|
||||
**Category:** Applications (economy)
|
||||
|
||||
## Holepunch references (inspiration only)
|
||||
**Composes with:** `hyper-p2p-bandwidth-broker`, `hyper-p2p-auction-gossip`
|
||||
|
||||
- `hyper-p2p-trust-graph`
|
||||
**Protocol:** `credit-ledger/v1`
|
||||
|
||||
> This module composes on Hyperswarm/Hypercore — it does **not** re-implement upstream packages.
|
||||
## When to use
|
||||
|
||||
## Composes with
|
||||
Apps that track balances or credits across peers on a shared Hyperswarm topic.
|
||||
|
||||
- `hyper-p2p-bandwidth-broker`
|
||||
## When not to use
|
||||
|
||||
## Planned API
|
||||
Authoritative financial ledgers requiring strong consistency (use dedicated consensus).
|
||||
|
||||
- `constructor(opts)` — topic, optional keyPair
|
||||
- `getStats()` — scaffold counters
|
||||
- `ready()` — no-op until implemented
|
||||
- Domain methods — throw `not implemented: scaffold` until Wave 8+ pass
|
||||
## Quick start
|
||||
|
||||
## Layout
|
||||
```js
|
||||
const { HyperP2PCreditLedger } = require('hyper-p2p-credit-ledger')
|
||||
const ledger = new HyperP2PCreditLedger({ topic: 'credits' })
|
||||
await ledger.ready()
|
||||
ledger.openAccount('alice', 100)
|
||||
ledger.transfer('alice', 'bob', 25)
|
||||
```
|
||||
|
||||
`modules/applications-economy/hyper-p2p-credit-ledger/`
|
||||
## Docs
|
||||
|
||||
See [`modules/_shared/MODULE_SYSTEM.md`](../../_shared/MODULE_SYSTEM.md).
|
||||
- [docs/api.md](docs/api.md)
|
||||
- [docs/architecture.md](docs/architecture.md)
|
||||
|
||||
## Test
|
||||
|
||||
```bash
|
||||
npm install && npm test
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user