Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions node/migrations/20260130152449_supply_info.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
-- Single-row table tracking current supply statistics
-- This table always contains exactly one row (id=1) that gets updated
CREATE TABLE IF NOT EXISTS supply_info (
id INTEGER PRIMARY KEY NOT NULL CHECK (id = 1), -- Constrained to 1 to enforce single-row table
block_height INTEGER NOT NULL, -- Current block height of these stats
total_supply REAL NOT NULL, -- Total coins created minus burned coins (floating point)
circulating_supply REAL NOT NULL, -- Coins in public circulation (floating point)
max_supply REAL NOT NULL, -- Theoretical maximum coins that can exist minus burned (floating point)
burned REAL NOT NULL, -- Total coins verifiably burned (floating point)
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL -- Last update timestamp
);

-- Insert the initial row with default values
INSERT INTO supply_info (id, block_height, total_supply, circulating_supply, max_supply, burned)
VALUES (1, 0, 500000000.0, 500000000.0, 1000000000.0, 0.0);
1 change: 1 addition & 0 deletions node/src/archive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ mod transformer;
use conf::Params as ArchiveParams;

pub use moonlight::{MoonlightGroup, Order};
pub use sqlite::SupplyInfo;

// Archive folder containing the sqlite database and the moonlight database
const ARCHIVE_FOLDER_NAME: &str = "archive";
Expand Down
Loading
Loading