A tool for Midnight nodes that displays the Aura block production schedule and records it in SQLite.
※This tool is currently in beta. Specifications may change and backward-incompatible changes may occur before the official release.
This tool auto-detects the Aura public key from the node keystore, verifies that this node holds the corresponding secret key via author_hasKey, then calculates and records the assigned slots for the current session (referred to as “epoch” here for convenience).
- Calculates your assigned Aura slots in the current epoch (session), displays them, and stores them in SQLite as
schedule - In watch mode (
mblog block --watch), tracks the chain and updates the status. It waits until the next session, and at the boundary it calculates and stores the assigned slots for the new epoch.schedule(planned)mint(observed on best head)finality(observed on finalized)
- Stores Authority set information per epoch (hash/length, start/end slots, etc.)
- Supports output timezone selection and colored output (auto-detected via TTY)
midnight-nodemust be started with the following flags (WS RPC enabled--rpc-methods=Unsafe--unsafe-rpc-external--rpc-port 9944- Rust (
cargo) build environment
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source "$HOME/.cargo/env"
rustup toolchain install stable
rustup default stable
rustc -V
cargo -VUbuntu/Debian:
sudo apt-get update
sudo apt-get install -y build-essential pkg-config libssl-devgit clone https://github.com/Midnight-Scripts/Midnight-blocklog.git
cd Midnight-blocklog
git checkout <latest_tag_name>
cargo install --path . --bin mblog --locked --forcemblog is typically installed to ~/.cargo/bin/mblog.
mblog --helpOutput (actual --help):
Usage: mblog <COMMAND>
Commands:
block Show Aura slot schedule (use --watch to monitor)
log Show stored blocks from SQLite
Options are provided per subcommand.
--ws <WS>: WS RPC endpoint (optional; default:ws://127.0.0.1:9944)--keystore-path <KEYSTORE_PATH>: Node keystore directory (required)--epoch-size <EPOCH_SIZE>: Number of slots per epoch (optional; default:1200)--lang <LANG>: Language for fixed messages (optional;ja|en; default:en)--tz <TZ>: Output timezone (optional; default:UTC)UTC/local/+HH:MM/-HH:MM- Unix only: IANA timezones such as
Asia/Tokyo(setsTZinternally and uses system tzdata)
--color <auto|always|never>: Colored output (optional; default:auto)--db <DB>: SQLite DB path (optional; default:./mblog.db)--no-store: Do not write to SQLite (optional; logs only;--dbpath is not required)--ariadne-endpoint <ARIADNE_ENDPOINT>: Ariadne JSON-RPC endpoint used for sidechain registration checks (optional; default:https://rpc.testnet-02.midnight.network)--ariadne-insecure: Accept invalid TLS certs for Ariadne endpoint (optional)--no-registration-check: Disable sidechain registration check (optional)--watch: Continuous monitoring (optional; keeps running without exiting)--output-json: Output schedule JSON to stdout (optional; cannot be used with--watch; exits after printing)--current: Output the current epoch schedule (requires--output-json)--next: Output the next epoch schedule (requires--output-json)
--db <DB>: SQLite DB path (optional; default:./mblog.db)--epoch <EPOCH>: Epoch number to display (optional; default: latest)--tz <TZ>: Scheduled time timezone (optional; default:UTC)
See mblog block --help and mblog log --help for the authoritative list.
mblog block \
--keystore-path /path/to/your/keystore \
--db /path/to/midnight-dir/mblog.db \
--tz Asia/Tokyo \
--watchExample results (may vary depending on time zone settings)
Midnight-blocklog - Version: 0.3.1
--------------------------------------------------------------
epoch:245527 (start_slot:294632400 / end_slot:294633599)
author: 0x52cc8d7dbb573b0fa3ba8e12545affa48313c3e5e0dc0b07515fd52419373360
ADA Stake: 2816841.654532 ADA (2816841654532 lovelace)
Registration: true (Registered)
Your Block Schedule List
-------------------------
#1 slot 294633422: 2026-01-07T19:42:12+04:00 (UTC 2026-01-07T15:42:12+00:00)
Total=1
Waiting for next session... (next_epoch=245528)
progress [============================= ] 99% (slot 294633599/294633599)
If there is no schedule, it will display
No schedule for this session.
When --output-json is set (instead of --watch), mblog prints the schedule as JSON to stdout (date respects --tz) and exits.
Note: --output-json does not write to SQLite (it ignores --db and does not create/update the DB).
Examples:
# Current epoch schedule as JSON (date respects --tz)
mblog block --keystore-path /path/to/keystore --tz UTC --output-json --current
# Next epoch schedule as JSON (date respects --tz)
mblog block --keystore-path /path/to/keystore --tz UTC --output-json --nextSample output:
{
"epoch": 245555,
"schedule": [
{ "slot": 294663162, "date": "2026-01-10T12:34:56Z" }
]
}# Latest epoch (default)
mblog log --db /path/to/midnight-dir/mblog.db
# Specific epoch
mblog log --db /path/to/midnight-dir/mblog.db --epoch 245525Example results (may vary depending on time zone settings)
Midnight Block Log
-------------------
epoch: 245528
|===|==========|==============|===========|===============|===========================|=======================|
| # | status | block_number | slot | slot_in_epoch | Scheduled_time | block_hash |
|===|==========|==============|===========|===============|===========================|=======================|
| 1 | finality | 3238956 | 294633833 | 233 | 2026-01-07T20:23:18+04:00 | 0xec7a91ac...81f5d053 |
| 2 | finality | 3238966 | 294633843 | 243 | 2026-01-07T20:24:18+04:00 | 0x63ec2189...c0776574 |
|===|==========|==============|===========|===============|===========================|=======================|
The data stored in SQLite is continuously updated by running this application with mblog watch.
On the first run, an SQLite database is created at the --db path you specify, and data is accumulated in the following tables. Please note that if you change the path or omit it, a new database will be created.
epoch: Epoch numberstart_slot: Start slotend_slot: End slotauthority_set_hash: Hash of the Authority setauthority_set_len: Number of elements in the Authority setcreated_at_utc: Recorded time (UTC)
slot(primary key)epochplanned_time_utc: Planned block production time (UTC)block_numberblock_hashproduced_time_utcstatus:schedule/mint/finality
- This tool does not read or print secret keys (it detects the public key from keystore filenames).
author_hasKeyis an RPC that checks whether this node’s keystore contains the corresponding secret key.
- Indexer Integration
- UX improvements (please open an issue if you have a request)
Apache-2.0
Copyright (c) 2026 BTBF (X-StakePool)
Copyright (c) 2026 BTBF (X-StakePool)