add pdf command, show block time in verify command

This commit is contained in:
2025-04-11 13:57:38 +02:00
parent 03f30f1968
commit 7d577f383e
6 changed files with 401 additions and 1 deletions

View File

@@ -2,8 +2,10 @@ package main
import (
"crypto/sha256"
"fmt"
"log/slog"
"os"
"strings"
"time"
"git.intruders.space/public/opentimestamps"
@@ -137,8 +139,21 @@ func runVerifyCmd(cmd *cobra.Command, args []string) {
}
att := seq.GetAttestation()
// Get the block time
blockHash, err := bitcoin.GetBlockHash(int64(att.BitcoinBlockHeight))
blockTime := ""
if err == nil {
blockHeader, err := bitcoin.GetBlockHeader(blockHash)
if err == nil {
// Format the block time
blockTime = fmt.Sprintf(" (%s)", blockHeader.Timestamp.Format(time.RFC3339))
}
}
slog.Info("Verification successful",
"block_height", att.BitcoinBlockHeight)
"block_height", att.BitcoinBlockHeight,
"block_time", strings.TrimPrefix(blockTime, " "))
if tx != nil {
slog.Info("Bitcoin transaction", "txid", tx.TxHash().String())