EXTENDING LEDGDEX


You can build on ledgdex in these ways, from the simplest:

1. Your own pages. A ledgdex is a dex, so add pages to data.json, or add files to to_add/. Ledgdex writes again only its own pages: the pages that start with <!-- ledgdex -->.

2. Tools that read the state. state(Ledger(...)) is plain JSON of offers, claims, auctions, disputes, admissions and listings.

Reports, exports, dashboards and alerts can read the state. Nothing that they do can change a ledger.

3. Agents: programs that sign and record by rule (Bots and Agents). From Python, call the commands with ledgdex.cli.main([...]), or use the library under them.

4. In the browser: the same core in js/ (JavaScript Core, Example: JavaScript).

5. New message types. A new type changes the format, so start with the specification. Then change these parts:

- the fields of the body in BODIES (core.py and core.js)

- who can sign and record the type

- its rule in the two state functions

- a line for the ledger page in the two renderers

- the shared vectors (py/tests/make_vectors.py), with fuzzing, so that the two languages agree byte for byte

Do not do these things:

- Do not change a ledger file by hand. The ledger breaks, or the change is a rewrite that each receipt shows.

- Do not keep keys in a dex.

- Do not trust a ledger until it is whole (Ledger(data).whole).

Example: Extending makes a sales report and adds it to the dex as a page.








BACK TO LEDGDEX DOCS