Run your own reader
A reader follows a Monero node block by block, applies the rules, and serves the ledger over HTTP. Anyone who runs one with the same settings gets the same records, the same owners and the same checkpoints.
#What you need
- Node.js 22 or newer.
- A synchronized Monero node (
monerod). The reader reads every block from block 3,804,029 on. - The repository:
git clone https://github.com/xmr20project/xmr721
cd xmr721
npm install#Start it
These are the settings of the live mainnet ledger. Every reader of that ledger uses exactly these values; a reader with any other value is a reader of another ledger.
node reader/service.mjs --network mainnet --node http://127.0.0.1:18081 --state xmr721-state \
--owners ownership-index/result/owners.jsonl,ownership-index/added/added.jsonl \
--transfers ownership-index/result/transfers.jsonl \
--domain ec7f7d26dba6725124df69417d43335c52e34557fc61c1d8d6b4736370e6ba1d \
--fee-address 45J4QMTbVoi61ZQoUzLVh7VkvjuRbqaaHW1AophY1Jbi9KzTzk8qoh43fT6JWYvkk6j6X1Stog7Xb9ZabzBrMr7tGzANudW \
--start 3804029 --start-hash cddee72e248e6fc903d7850f73e29cceff64dd9a027f64afc7362d76784081cd \
--mint-from 3805946 \
--minters 42zfMRhM9aQAXb4uZKw5gzVN9uTf3bUrgAz2cY7jpvbn8ZE4RWsBsKUECgXNiFKsqK9nBDPThFzTafsZX3bZ7socRQZU1qX,47hW3YWbqR5LrvJyfRSBAqArp8TcU1xnL29dn5xpEWJN9dmyohzaS4ug3e57yvSGmT3UWh47gfN4VW1soHSrXsmqD8haurE \
--open-from 3806220 \
--burn-from 3808200 \
--spend-from 3813165 \
--xmr20-inscribers 42zfMRhM9aQAXb4uZKw5gzVN9uTf3bUrgAz2cY7jpvbn8ZE4RWsBsKUECgXNiFKsqK9nBDPThFzTafsZX3bZ7socRQZU1qX \
--xmr20-open-from 3812510 \
--collections xmr20-nfts/collections \
--content-archiveIt listens on http://127.0.0.1:18951 (--port to change it), writes its log and checkpoints into the --state folder, and catches up from the start block. Compare its /info with the public reader's: the settings must match exactly.
curl http://127.0.0.1:18951/info
curl https://api.xmr20.org/xmr721/info#The settings
| Option | Value | What it fixes |
|---|---|---|
--domain | ec7f7d26…ba1d = SHA-256("XMR721 mainnet ledger 1") | Separates this ledger from any other use of the same keys |
--owners | the owner list and the added entry | Who held each Mordinal at the start block |
--start, --start-hash | 3,804,029 | The first block records count after |
--fee-address | 45J4QMTb…NudW | Where the 5% protocol fee of each sale goes |
--mint-from | 3,805,946 | The first block for collections and mints |
--minters | two addresses | Who could mint before the opening block |
--open-from | 3,806,220 | From here anyone mints |
--burn-from | 3,808,200 | Claims by burning; claim records end 720 blocks later |
--spend-from | 3,813,165 | Claims by a spent coin |
--xmr20-inscribers | the launchpad's inscriber | Which XMR20 token deploys are listed |
--xmr20-open-from | 3,812,510 | Open XMR20 tokens |
See Mainnet settings for the full values.
#Optional settings
| Option | What |
|---|---|
--content-archive [url] | Fetches Mordinal pictures from the xmr20.org archive and serves each only if it matches the hash on the owner list |
--content-dir <dir> | Serves pictures from a folder of your own instead |
--collections <dir> | Serves the GENESIS collection of earlier XMR20 NFTs |
--port <n> | The port (default 18951). The service listens on 127.0.0.1 only |
--allow-origin <origin> | Lets a web page on that origin read the service from a browser. Repeat for more |
--behind-proxy | Behind your own proxy on the same machine: request limits follow x-forwarded-for |
--no-xmr20-follow | Do not follow the earlier XMR20 formats in new blocks |
Without the relay options the service only reads. Running a relay needs a wallet of its own and the carrier tool; see reader/README.md.
#Pages
The reader also serves its own explorer, gallery and market pages at http://127.0.0.1:18951/view/.
#Use it
- Point the command-line wallet at it:
--reader http://127.0.0.1:18951. - Read it from your own app: see the HTTP API.
- Check another reader against it: see Verify a reader.
#Try it without a chain
npm test # rules, reader and decoders, offline, a few seconds
npm run demo # explorer, gallery and market with made-up data at http://127.0.0.1:18951/view/The demonstration uses a made-up chain, owner list and wallets. Nothing in it is real.
#What it costs
From the first burn block on, the reader looks at every transaction of every block with the fee wallet's public view key, to find claim fees. Measured on recent mainnet blocks: about 37 ms a block on average, around 26 seconds of work per day of blocks when catching up.