From 8cb5cb4ad23ba0315da754a9cff7ba01b7e035b2 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 20 Feb 2026 21:42:22 +0000 Subject: [PATCH] feat(chain): go-store dependency and metadata types Co-Authored-By: Charon --- chain/meta.go | 30 ++++++++++++++++++++++++++++++ go.mod | 3 +++ 2 files changed, 33 insertions(+) create mode 100644 chain/meta.go diff --git a/chain/meta.go b/chain/meta.go new file mode 100644 index 0000000..14326d8 --- /dev/null +++ b/chain/meta.go @@ -0,0 +1,30 @@ +// Copyright (c) 2017-2026 Lethean (https://lt.hn) +// +// Licensed under the European Union Public Licence (EUPL) version 1.2. +// SPDX-License-Identifier: EUPL-1.2 + +package chain + +import "forge.lthn.ai/core/go-blockchain/types" + +// BlockMeta holds metadata stored alongside each block. +type BlockMeta struct { + Hash types.Hash `json:"hash"` + Height uint64 `json:"height"` + Timestamp uint64 `json:"timestamp"` + Difficulty uint64 `json:"difficulty"` + CumulativeDiff uint64 `json:"cumulative_diff"` + GeneratedCoins uint64 `json:"generated_coins"` +} + +// TxMeta holds metadata stored alongside each transaction. +type TxMeta struct { + KeeperBlock uint64 `json:"keeper_block"` + GlobalOutputIndexes []uint64 `json:"global_output_indexes"` +} + +// outputEntry is the value stored in the outputs index. +type outputEntry struct { + TxID string `json:"tx_id"` + OutNo uint32 `json:"out_no"` +} diff --git a/go.mod b/go.mod index cec8d52..550763e 100644 --- a/go.mod +++ b/go.mod @@ -4,9 +4,12 @@ go 1.25.5 require ( forge.lthn.ai/core/go-p2p v0.0.0-00010101000000-000000000000 + forge.lthn.ai/core/go-store v0.0.0-00010101000000-000000000000 golang.org/x/crypto v0.48.0 ) require golang.org/x/sys v0.41.0 // indirect replace forge.lthn.ai/core/go-p2p => /home/claude/Code/core/go-p2p + +replace forge.lthn.ai/core/go-store => /home/claude/Code/core/go-store