Skip to content

Conversation

@voidxno
Copy link
Contributor

@voidxno voidxno commented Dec 18, 2025

PR for including timestamp in mmx node history CLI export

Goal: Make it possible to export rewards with timestamp (tax reporting)

Changes:

  • Added TS(time_stamp) after TX(txid), same style
  • Added TX( to existing (txid), if 'nft_binary' (align style)

Questions:

  • Just tell if a better/other ways, or changes wanted ?

PS: If merged, probably going to create a script, outside PR/mmx-node, that reformats output (i.e., only rewards, transform timestamp, CSV).

@netlify
Copy link

netlify bot commented Dec 18, 2025

Deploy Preview for mmx-docs canceled.

Name Link
🔨 Latest commit d8a7cfe
🔍 Latest deploy log https://app.netlify.com/projects/mmx-docs/deploys/695a839fb892be0008a5189f

@netlify
Copy link

netlify bot commented Dec 18, 2025

Deploy Preview for explore-mmx canceled.

Name Link
🔨 Latest commit d8a7cfe
🔍 Latest deploy log https://app.netlify.com/projects/explore-mmx/deploys/695a839e9cfe3f00086aeed3

@madMAx43v3r
Copy link
Owner

madMAx43v3r commented Jan 4, 2026

I didn't add TX( for nfts because they are objects, not transactions. Just a semantic difference.

@voidxno
Copy link
Contributor Author

voidxno commented Jan 4, 2026

Changes Rev02:

  • Removed/reverted the added TX( for 'nft_binary'.

Keeping to semantic/logic from existing work.

PS: Tell if want other prefix label than TS(...), or none at all (...).

@madMAx43v3r
Copy link
Owner

Well maybe it makes sense to show the date and time in human readable format?

See vnx::get_date_string() and vnx::get_date_string_ex()

@voidxno
Copy link
Contributor Author

voidxno commented Jan 5, 2026

Not against it. My thought was to limit changes as much as possible (for now). Get data needed for temporary script to be able to transform to CSV for spreadsheet imports (i.e., Excel).

Nearly finished with a bash script that uses awk. Sample:

From mmx node history mmx1...:

[3043914] RECEIVE + 0.3 MMX (300000) -> mmx1... TX(192F...) TS(1767558794903) M(Testing memo "text", ". See how it works "".)
[3043914] SPEND   - 0.3 MMX (300000) <- mmx1... TX(192F...) TS(1767558794903) M(Testing memo "text", ". See how it works "".)

Output from mmx_hist2csv.sh (history as input):

Height,Type,Amount,Symbol,AmountFixed,InOut,Address,TX,UnixTS,DateTime,Memo
3043914,RECEIVE,0.3,MMX,300000,In,mmx1...,192...,1767558794903,2026-01-04T21:33:14+0100,"Testing memo ""text"", "". See how it works """"."
3043914,SPEND,-0.3,MMX,300000,Out,mmx1...,192...,1767558794903,2026-01-04T21:33:14+0100,"Testing memo ""text"", "". See how it works """"."

Taking UnixTS through strftime("%Y-%m-%dT%H:%M:%S%z",timestamp / 1000); in awk, giving column with local datetime + tz indicator (in log/db format). A few other tweaks too. Just making it very CSV compatible.

Meant as a temporary script solution I host on my GitHub, and point people to.

Ideally (future), should be a mmx node history-csv, or something, that could do the job. Or some other 'flexible' query CLI against database, that has csv, json, text as output options.

Open to any direction, that best fits existing framework.

@madMAx43v3r
Copy link
Owner

madMAx43v3r commented Jan 6, 2026

Hmm yes, it would be better to implement it all in C++, this way your script doesn't break if we change format of mmx history. I'm not a fan of adding raw timestamps to mmx history cause it's not human readable...

I'll do it real quick.

@madMAx43v3r
Copy link
Owner

@voidxno check latest master

@voidxno
Copy link
Contributor Author

voidxno commented Jan 6, 2026

Thx Max 👍 Will give it a run in a few hours and report back.

@voidxno
Copy link
Contributor Author

voidxno commented Jan 6, 2026

@madMAx43v3r Output is nearly perfect (don't need separate script anymore) :-)

One small CSV edge case (no showstopper):

  • If memo text itself contains double-quote characters (RFC 4180, 2.7)
    • Should be escaped by preceding it with another double-quote
  • Raw memo string (sample): Testing memo "text", ". See how it works "".
  • Currently (history_csv): ,"Testing memo "text", ". See how it works ""."
  • Ideally (history_csv): ,"Testing memo ""text"", "". See how it works """"."

Basically:

  • String replace every " to "" on *entry.memo, before output (mmx.cpp#L144)

Not very important. Still going to spreadsheet import ok'ish. Just that memo text above will split into two columns.

@madMAx43v3r
Copy link
Owner

Ok should be fixed

@voidxno
Copy link
Contributor Author

voidxno commented Jan 7, 2026

Thx again. I'll do a last test. Then Close this PR with "redundant" :-)

( + tip people on Discord that functionality exists )

@voidxno
Copy link
Contributor Author

voidxno commented Jan 7, 2026

Closing PR (redundant). Achieved with new CLI's (as of latest master v1.4.4-22-g91acb927):

mmx node history_csv <address> <block_height>
mmx wallet log_csv

@voidxno voidxno closed this Jan 7, 2026
@voidxno voidxno deleted the hist_timestamp branch January 7, 2026 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants