XMR721
Market

Build on XMR721

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:
Terminal
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.

Terminal
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-archive

It 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.

Terminal
curl http://127.0.0.1:18951/info
curl https://api.xmr20.org/xmr721/info

#The settings

OptionValueWhat it fixes
--domainec7f7d26…ba1d = SHA-256("XMR721 mainnet ledger 1")Separates this ledger from any other use of the same keys
--ownersthe owner list and the added entryWho held each Mordinal at the start block
--start, --start-hash3,804,029The first block records count after
--fee-address45J4QMTb…NudWWhere the 5% protocol fee of each sale goes
--mint-from3,805,946The first block for collections and mints
--minterstwo addressesWho could mint before the opening block
--open-from3,806,220From here anyone mints
--burn-from3,808,200Claims by burning; claim records end 720 blocks later
--spend-from3,813,165Claims by a spent coin
--xmr20-inscribersthe launchpad's inscriberWhich XMR20 token deploys are listed
--xmr20-open-from3,812,510Open XMR20 tokens

See Mainnet settings for the full values.

#Optional settings

OptionWhat
--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-proxyBehind your own proxy on the same machine: request limits follow x-forwarded-for
--no-xmr20-followDo 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

Terminal
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.