refactor: migrate module path to dappco.re/go/core/blockchain
Update go.mod module line, all require/replace directives, and every .go import path from forge.lthn.ai/core/go-blockchain to dappco.re/go/core/blockchain. Add replace directives to bridge dappco.re paths to existing forge.lthn.ai registry during migration. Update CLAUDE.md, README, and docs to reflect the new module path. Co-Authored-By: Virgil <virgil@lethean.io>
This commit is contained in:
parent
6370d96c31
commit
34128d8e98
119 changed files with 328 additions and 296 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
|
@ -1,3 +1,5 @@
|
||||||
crypto/build/
|
crypto/build/
|
||||||
.core/
|
|
||||||
.idea/
|
.idea/
|
||||||
|
.vscode/
|
||||||
|
*.log
|
||||||
|
.core/
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
|
||||||
|
|
||||||
Go implementation of the Lethean blockchain protocol (CryptoNote/Zano-fork) with a CGo crypto bridge.
|
Go implementation of the Lethean blockchain protocol (CryptoNote/Zano-fork) with a CGo crypto bridge.
|
||||||
|
|
||||||
Module: `forge.lthn.ai/core/go-blockchain`
|
Module: `dappco.re/go/core/blockchain`
|
||||||
Licence: EUPL-1.2 (every source file carries the copyright header)
|
Licence: EUPL-1.2 (every source file carries the copyright header)
|
||||||
|
|
||||||
## Build
|
## Build
|
||||||
|
|
@ -42,7 +42,7 @@ go test -tags integration ./... # integration tests (need C++ te
|
||||||
- Co-Author trailer: `Co-Authored-By: Charon <charon@lethean.io>`
|
- Co-Author trailer: `Co-Authored-By: Charon <charon@lethean.io>`
|
||||||
- Error strings: `package: description` format (e.g. `types: invalid hex for hash`)
|
- Error strings: `package: description` format (e.g. `types: invalid hex for hash`)
|
||||||
- Error wrapping: `fmt.Errorf("package: description: %w", err)`
|
- Error wrapping: `fmt.Errorf("package: description: %w", err)`
|
||||||
- Import order: stdlib, then `golang.org/x`, then `forge.lthn.ai`, blank lines between groups
|
- Import order: stdlib, then `golang.org/x`, then `dappco.re`, blank lines between groups
|
||||||
- No emojis in code or comments
|
- No emojis in code or comments
|
||||||
|
|
||||||
## Test Conventions
|
## Test Conventions
|
||||||
|
|
@ -77,9 +77,9 @@ types / config ← leaf packages (stdlib only, no internal deps)
|
||||||
- Block hash includes a varint length prefix: `Keccak256(varint(len) || block_hashing_blob)`.
|
- Block hash includes a varint length prefix: `Keccak256(varint(len) || block_hashing_blob)`.
|
||||||
- Two P2P varint formats exist: CryptoNote LEB128 (`wire/`) and portable storage 2-bit size mark (`go-p2p/node/levin/`).
|
- Two P2P varint formats exist: CryptoNote LEB128 (`wire/`) and portable storage 2-bit size mark (`go-p2p/node/levin/`).
|
||||||
|
|
||||||
**Binary:** `cmd/core-chain/` — cobra CLI via `forge.lthn.ai/core/cli`. Subcommands: `chain sync` (P2P block sync) and `chain explorer` (TUI dashboard).
|
**Binary:** `cmd/core-chain/` — cobra CLI via `dappco.re/go/core/cli`. Subcommands: `chain sync` (P2P block sync) and `chain explorer` (TUI dashboard).
|
||||||
|
|
||||||
**Local replace directives:** `go.mod` uses local `replace` for sibling `forge.lthn.ai/core/*` modules.
|
**Local replace directives:** `go.mod` uses `replace` to map `dappco.re/go/core/*` paths to `forge.lthn.ai/core/*` modules during migration.
|
||||||
|
|
||||||
## Docs
|
## Docs
|
||||||
|
|
||||||
|
|
|
||||||
10
README.md
10
README.md
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
Pure Go implementation of the Lethean blockchain protocol. Provides chain configuration, core cryptographic data types, CryptoNote wire serialisation, and LWMA difficulty adjustment for the Lethean CryptoNote/Zano-fork chain. Follows ADR-001: protocol logic in Go, cryptographic primitives deferred to a C++ bridge in later phases. Lineage: CryptoNote to IntenseCoin (2017) to Lethean to Zano rebase.
|
Pure Go implementation of the Lethean blockchain protocol. Provides chain configuration, core cryptographic data types, CryptoNote wire serialisation, and LWMA difficulty adjustment for the Lethean CryptoNote/Zano-fork chain. Follows ADR-001: protocol logic in Go, cryptographic primitives deferred to a C++ bridge in later phases. Lineage: CryptoNote to IntenseCoin (2017) to Lethean to Zano rebase.
|
||||||
|
|
||||||
**Module**: `forge.lthn.ai/core/go-blockchain`
|
**Module**: `dappco.re/go/core/blockchain`
|
||||||
**Licence**: EUPL-1.2
|
**Licence**: EUPL-1.2
|
||||||
**Language**: Go 1.25
|
**Language**: Go 1.25
|
||||||
|
|
||||||
|
|
@ -10,10 +10,10 @@ Pure Go implementation of the Lethean blockchain protocol. Provides chain config
|
||||||
|
|
||||||
```go
|
```go
|
||||||
import (
|
import (
|
||||||
"forge.lthn.ai/core/go-blockchain/config"
|
"dappco.re/go/core/blockchain/config"
|
||||||
"forge.lthn.ai/core/go-blockchain/types"
|
"dappco.re/go/core/blockchain/types"
|
||||||
"forge.lthn.ai/core/go-blockchain/wire"
|
"dappco.re/go/core/blockchain/wire"
|
||||||
"forge.lthn.ai/core/go-blockchain/difficulty"
|
"dappco.re/go/core/blockchain/difficulty"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Query the active hardfork version at a given block height
|
// Query the active hardfork version at a given block height
|
||||||
|
|
|
||||||
|
|
@ -8,9 +8,9 @@
|
||||||
package chain
|
package chain
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"forge.lthn.ai/core/go-blockchain/types"
|
"dappco.re/go/core/blockchain/types"
|
||||||
coreerr "forge.lthn.ai/core/go-log"
|
coreerr "dappco.re/go/core/log"
|
||||||
store "forge.lthn.ai/core/go-store"
|
store "dappco.re/go/core/store"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Chain manages blockchain storage and indexing.
|
// Chain manages blockchain storage and indexing.
|
||||||
|
|
|
||||||
|
|
@ -8,9 +8,9 @@ package chain
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
store "forge.lthn.ai/core/go-store"
|
store "dappco.re/go/core/store"
|
||||||
"forge.lthn.ai/core/go-blockchain/types"
|
"dappco.re/go/core/blockchain/types"
|
||||||
"forge.lthn.ai/core/go-blockchain/wire"
|
"dappco.re/go/core/blockchain/wire"
|
||||||
)
|
)
|
||||||
|
|
||||||
func newTestChain(t *testing.T) *Chain {
|
func newTestChain(t *testing.T) *Chain {
|
||||||
|
|
|
||||||
|
|
@ -8,8 +8,8 @@ package chain
|
||||||
import (
|
import (
|
||||||
"math/big"
|
"math/big"
|
||||||
|
|
||||||
"forge.lthn.ai/core/go-blockchain/config"
|
"dappco.re/go/core/blockchain/config"
|
||||||
"forge.lthn.ai/core/go-blockchain/difficulty"
|
"dappco.re/go/core/blockchain/difficulty"
|
||||||
)
|
)
|
||||||
|
|
||||||
// nextDifficultyWith computes the expected difficulty for the block at the
|
// nextDifficultyWith computes the expected difficulty for the block at the
|
||||||
|
|
|
||||||
|
|
@ -8,9 +8,9 @@ package chain
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"forge.lthn.ai/core/go-blockchain/config"
|
"dappco.re/go/core/blockchain/config"
|
||||||
"forge.lthn.ai/core/go-blockchain/types"
|
"dappco.re/go/core/blockchain/types"
|
||||||
store "forge.lthn.ai/core/go-store"
|
store "dappco.re/go/core/store"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
package chain
|
package chain
|
||||||
|
|
||||||
import "forge.lthn.ai/core/go-blockchain/types"
|
import "dappco.re/go/core/blockchain/types"
|
||||||
|
|
||||||
// SparseChainHistory builds the exponentially-spaced block hash list used by
|
// SparseChainHistory builds the exponentially-spaced block hash list used by
|
||||||
// NOTIFY_REQUEST_CHAIN. Matches the C++ get_short_chain_history() algorithm:
|
// NOTIFY_REQUEST_CHAIN. Matches the C++ get_short_chain_history() algorithm:
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ package chain
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"forge.lthn.ai/core/go-blockchain/types"
|
"dappco.re/go/core/blockchain/types"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,10 +11,10 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
coreerr "forge.lthn.ai/core/go-log"
|
coreerr "dappco.re/go/core/log"
|
||||||
|
|
||||||
"forge.lthn.ai/core/go-blockchain/types"
|
"dappco.re/go/core/blockchain/types"
|
||||||
store "forge.lthn.ai/core/go-store"
|
store "dappco.re/go/core/store"
|
||||||
)
|
)
|
||||||
|
|
||||||
// MarkSpent records a key image as spent at the given block height.
|
// MarkSpent records a key image as spent at the given block height.
|
||||||
|
|
|
||||||
|
|
@ -18,12 +18,12 @@ import (
|
||||||
|
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
|
||||||
"forge.lthn.ai/core/go-blockchain/config"
|
"dappco.re/go/core/blockchain/config"
|
||||||
"forge.lthn.ai/core/go-blockchain/p2p"
|
"dappco.re/go/core/blockchain/p2p"
|
||||||
"forge.lthn.ai/core/go-blockchain/rpc"
|
"dappco.re/go/core/blockchain/rpc"
|
||||||
"forge.lthn.ai/core/go-blockchain/types"
|
"dappco.re/go/core/blockchain/types"
|
||||||
levin "forge.lthn.ai/core/go-p2p/node/levin"
|
levin "dappco.re/go/core/p2p/node/levin"
|
||||||
store "forge.lthn.ai/core/go-store"
|
store "dappco.re/go/core/store"
|
||||||
)
|
)
|
||||||
|
|
||||||
const testnetRPCAddr = "http://localhost:46941"
|
const testnetRPCAddr = "http://localhost:46941"
|
||||||
|
|
|
||||||
|
|
@ -8,10 +8,10 @@ package chain
|
||||||
import (
|
import (
|
||||||
"log"
|
"log"
|
||||||
|
|
||||||
coreerr "forge.lthn.ai/core/go-log"
|
coreerr "dappco.re/go/core/log"
|
||||||
|
|
||||||
"forge.lthn.ai/core/go-blockchain/p2p"
|
"dappco.re/go/core/blockchain/p2p"
|
||||||
levinpkg "forge.lthn.ai/core/go-p2p/node/levin"
|
levinpkg "dappco.re/go/core/p2p/node/levin"
|
||||||
)
|
)
|
||||||
|
|
||||||
// LevinP2PConn adapts a Levin connection to the P2PConnection interface.
|
// LevinP2PConn adapts a Levin connection to the P2PConnection interface.
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
package chain
|
package chain
|
||||||
|
|
||||||
import "forge.lthn.ai/core/go-blockchain/types"
|
import "dappco.re/go/core/blockchain/types"
|
||||||
|
|
||||||
// BlockMeta holds metadata stored alongside each block.
|
// BlockMeta holds metadata stored alongside each block.
|
||||||
type BlockMeta struct {
|
type BlockMeta struct {
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
|
|
||||||
coreerr "forge.lthn.ai/core/go-log"
|
coreerr "dappco.re/go/core/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
// P2PConnection abstracts the P2P communication needed for block sync.
|
// P2PConnection abstracts the P2P communication needed for block sync.
|
||||||
|
|
|
||||||
|
|
@ -10,8 +10,8 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
store "forge.lthn.ai/core/go-store"
|
store "dappco.re/go/core/store"
|
||||||
"forge.lthn.ai/core/go-blockchain/config"
|
"dappco.re/go/core/blockchain/config"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,10 +8,10 @@ package chain
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
coreerr "forge.lthn.ai/core/go-log"
|
coreerr "dappco.re/go/core/log"
|
||||||
|
|
||||||
"forge.lthn.ai/core/go-blockchain/consensus"
|
"dappco.re/go/core/blockchain/consensus"
|
||||||
"forge.lthn.ai/core/go-blockchain/types"
|
"dappco.re/go/core/blockchain/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
// GetRingOutputs fetches the public keys for the given global output indices
|
// GetRingOutputs fetches the public keys for the given global output indices
|
||||||
|
|
|
||||||
|
|
@ -8,8 +8,8 @@ package chain
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"forge.lthn.ai/core/go-blockchain/types"
|
"dappco.re/go/core/blockchain/types"
|
||||||
"forge.lthn.ai/core/go-blockchain/wire"
|
"dappco.re/go/core/blockchain/wire"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestGetRingOutputs_Good(t *testing.T) {
|
func TestGetRingOutputs_Good(t *testing.T) {
|
||||||
|
|
|
||||||
|
|
@ -13,11 +13,11 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
coreerr "forge.lthn.ai/core/go-log"
|
coreerr "dappco.re/go/core/log"
|
||||||
|
|
||||||
"forge.lthn.ai/core/go-blockchain/types"
|
"dappco.re/go/core/blockchain/types"
|
||||||
"forge.lthn.ai/core/go-blockchain/wire"
|
"dappco.re/go/core/blockchain/wire"
|
||||||
store "forge.lthn.ai/core/go-store"
|
store "dappco.re/go/core/store"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Storage group constants matching the design schema.
|
// Storage group constants matching the design schema.
|
||||||
|
|
|
||||||
|
|
@ -15,13 +15,13 @@ import (
|
||||||
"regexp"
|
"regexp"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
coreerr "forge.lthn.ai/core/go-log"
|
coreerr "dappco.re/go/core/log"
|
||||||
|
|
||||||
"forge.lthn.ai/core/go-blockchain/config"
|
"dappco.re/go/core/blockchain/config"
|
||||||
"forge.lthn.ai/core/go-blockchain/consensus"
|
"dappco.re/go/core/blockchain/consensus"
|
||||||
"forge.lthn.ai/core/go-blockchain/rpc"
|
"dappco.re/go/core/blockchain/rpc"
|
||||||
"forge.lthn.ai/core/go-blockchain/types"
|
"dappco.re/go/core/blockchain/types"
|
||||||
"forge.lthn.ai/core/go-blockchain/wire"
|
"dappco.re/go/core/blockchain/wire"
|
||||||
)
|
)
|
||||||
|
|
||||||
const syncBatchSize = 10
|
const syncBatchSize = 10
|
||||||
|
|
|
||||||
|
|
@ -16,12 +16,12 @@ import (
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
|
|
||||||
"forge.lthn.ai/core/go-blockchain/config"
|
"dappco.re/go/core/blockchain/config"
|
||||||
"forge.lthn.ai/core/go-blockchain/rpc"
|
"dappco.re/go/core/blockchain/rpc"
|
||||||
"forge.lthn.ai/core/go-blockchain/types"
|
"dappco.re/go/core/blockchain/types"
|
||||||
"forge.lthn.ai/core/go-blockchain/wire"
|
"dappco.re/go/core/blockchain/wire"
|
||||||
|
|
||||||
store "forge.lthn.ai/core/go-store"
|
store "dappco.re/go/core/store"
|
||||||
)
|
)
|
||||||
|
|
||||||
// makeGenesisBlockBlob creates a minimal genesis block and returns its hex blob and hash.
|
// makeGenesisBlockBlob creates a minimal genesis block and returns its hex blob and hash.
|
||||||
|
|
|
||||||
|
|
@ -9,11 +9,11 @@ import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
coreerr "forge.lthn.ai/core/go-log"
|
coreerr "dappco.re/go/core/log"
|
||||||
|
|
||||||
"forge.lthn.ai/core/go-blockchain/config"
|
"dappco.re/go/core/blockchain/config"
|
||||||
"forge.lthn.ai/core/go-blockchain/types"
|
"dappco.re/go/core/blockchain/types"
|
||||||
"forge.lthn.ai/core/go-blockchain/wire"
|
"dappco.re/go/core/blockchain/wire"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ValidateHeader checks a block header before storage.
|
// ValidateHeader checks a block header before storage.
|
||||||
|
|
|
||||||
|
|
@ -8,8 +8,8 @@ package chain
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
store "forge.lthn.ai/core/go-store"
|
store "dappco.re/go/core/store"
|
||||||
"forge.lthn.ai/core/go-blockchain/types"
|
"dappco.re/go/core/blockchain/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestValidateHeader_Good_Genesis(t *testing.T) {
|
func TestValidateHeader_Good_Genesis(t *testing.T) {
|
||||||
|
|
|
||||||
|
|
@ -6,8 +6,8 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
cli "forge.lthn.ai/core/cli/pkg/cli"
|
cli "dappco.re/go/core/cli/pkg/cli"
|
||||||
blockchain "forge.lthn.ai/core/go-blockchain"
|
blockchain "dappco.re/go/core/blockchain"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
|
||||||
|
|
@ -12,13 +12,13 @@ import (
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
coreerr "forge.lthn.ai/core/go-log"
|
coreerr "dappco.re/go/core/log"
|
||||||
|
|
||||||
cli "forge.lthn.ai/core/cli/pkg/cli"
|
cli "dappco.re/go/core/cli/pkg/cli"
|
||||||
store "forge.lthn.ai/core/go-store"
|
store "dappco.re/go/core/store"
|
||||||
|
|
||||||
"forge.lthn.ai/core/go-blockchain/chain"
|
"dappco.re/go/core/blockchain/chain"
|
||||||
"forge.lthn.ai/core/go-blockchain/tui"
|
"dappco.re/go/core/blockchain/tui"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
10
cmd_sync.go
10
cmd_sync.go
|
|
@ -15,11 +15,11 @@ import (
|
||||||
"sync"
|
"sync"
|
||||||
"syscall"
|
"syscall"
|
||||||
|
|
||||||
coreerr "forge.lthn.ai/core/go-log"
|
coreerr "dappco.re/go/core/log"
|
||||||
|
|
||||||
"forge.lthn.ai/core/go-blockchain/chain"
|
"dappco.re/go/core/blockchain/chain"
|
||||||
"forge.lthn.ai/core/go-process"
|
"dappco.re/go/core/process"
|
||||||
store "forge.lthn.ai/core/go-store"
|
store "dappco.re/go/core/store"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -85,7 +85,7 @@ func runSyncDaemon(dataDir, seed string, testnet bool) error {
|
||||||
PIDFile: pidFile,
|
PIDFile: pidFile,
|
||||||
Registry: process.DefaultRegistry(),
|
Registry: process.DefaultRegistry(),
|
||||||
RegistryEntry: process.DaemonEntry{
|
RegistryEntry: process.DaemonEntry{
|
||||||
Code: "forge.lthn.ai/core/go-blockchain",
|
Code: "dappco.re/go/core/blockchain",
|
||||||
Daemon: "sync",
|
Daemon: "sync",
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -9,10 +9,10 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
|
||||||
coreio "forge.lthn.ai/core/go-io"
|
coreio "dappco.re/go/core/io"
|
||||||
coreerr "forge.lthn.ai/core/go-log"
|
coreerr "dappco.re/go/core/log"
|
||||||
|
|
||||||
"forge.lthn.ai/core/go-blockchain/config"
|
"dappco.re/go/core/blockchain/config"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,10 +9,10 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"slices"
|
"slices"
|
||||||
|
|
||||||
coreerr "forge.lthn.ai/core/go-log"
|
coreerr "dappco.re/go/core/log"
|
||||||
|
|
||||||
"forge.lthn.ai/core/go-blockchain/config"
|
"dappco.re/go/core/blockchain/config"
|
||||||
"forge.lthn.ai/core/go-blockchain/types"
|
"dappco.re/go/core/blockchain/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
// IsPoS returns true if the block flags indicate a Proof-of-Stake block.
|
// IsPoS returns true if the block flags indicate a Proof-of-Stake block.
|
||||||
|
|
|
||||||
|
|
@ -6,8 +6,8 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"forge.lthn.ai/core/go-blockchain/config"
|
"dappco.re/go/core/blockchain/config"
|
||||||
"forge.lthn.ai/core/go-blockchain/types"
|
"dappco.re/go/core/blockchain/types"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -9,9 +9,9 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"math"
|
"math"
|
||||||
|
|
||||||
coreerr "forge.lthn.ai/core/go-log"
|
coreerr "dappco.re/go/core/log"
|
||||||
|
|
||||||
"forge.lthn.ai/core/go-blockchain/types"
|
"dappco.re/go/core/blockchain/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
// TxFee calculates the transaction fee for pre-HF4 (v0/v1) transactions.
|
// TxFee calculates the transaction fee for pre-HF4 (v0/v1) transactions.
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ package consensus
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"forge.lthn.ai/core/go-blockchain/types"
|
"dappco.re/go/core/blockchain/types"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -10,8 +10,8 @@ package consensus
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"forge.lthn.ai/core/go-blockchain/config"
|
"dappco.re/go/core/blockchain/config"
|
||||||
"forge.lthn.ai/core/go-blockchain/types"
|
"dappco.re/go/core/blockchain/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestIsPreHardforkFreeze_Good(t *testing.T) {
|
func TestIsPreHardforkFreeze_Good(t *testing.T) {
|
||||||
|
|
|
||||||
|
|
@ -10,11 +10,11 @@ package consensus
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
store "forge.lthn.ai/core/go-store"
|
store "dappco.re/go/core/store"
|
||||||
|
|
||||||
"forge.lthn.ai/core/go-blockchain/chain"
|
"dappco.re/go/core/blockchain/chain"
|
||||||
"forge.lthn.ai/core/go-blockchain/config"
|
"dappco.re/go/core/blockchain/config"
|
||||||
"forge.lthn.ai/core/go-blockchain/rpc"
|
"dappco.re/go/core/blockchain/rpc"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestConsensusIntegration(t *testing.T) {
|
func TestConsensusIntegration(t *testing.T) {
|
||||||
|
|
|
||||||
|
|
@ -9,8 +9,8 @@ import (
|
||||||
"encoding/binary"
|
"encoding/binary"
|
||||||
"math/big"
|
"math/big"
|
||||||
|
|
||||||
"forge.lthn.ai/core/go-blockchain/crypto"
|
"dappco.re/go/core/blockchain/crypto"
|
||||||
"forge.lthn.ai/core/go-blockchain/types"
|
"dappco.re/go/core/blockchain/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
// maxTarget is 2^256, used for difficulty comparison.
|
// maxTarget is 2^256, used for difficulty comparison.
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ package consensus
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"forge.lthn.ai/core/go-blockchain/types"
|
"dappco.re/go/core/blockchain/types"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,9 +9,9 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"math/bits"
|
"math/bits"
|
||||||
|
|
||||||
coreerr "forge.lthn.ai/core/go-log"
|
coreerr "dappco.re/go/core/log"
|
||||||
|
|
||||||
"forge.lthn.ai/core/go-blockchain/config"
|
"dappco.re/go/core/blockchain/config"
|
||||||
)
|
)
|
||||||
|
|
||||||
// BaseReward returns the base block reward at the given height.
|
// BaseReward returns the base block reward at the given height.
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ package consensus
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"forge.lthn.ai/core/go-blockchain/config"
|
"dappco.re/go/core/blockchain/config"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -8,10 +8,10 @@ package consensus
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
coreerr "forge.lthn.ai/core/go-log"
|
coreerr "dappco.re/go/core/log"
|
||||||
|
|
||||||
"forge.lthn.ai/core/go-blockchain/config"
|
"dappco.re/go/core/blockchain/config"
|
||||||
"forge.lthn.ai/core/go-blockchain/types"
|
"dappco.re/go/core/blockchain/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ValidateTransaction performs semantic validation on a regular (non-coinbase)
|
// ValidateTransaction performs semantic validation on a regular (non-coinbase)
|
||||||
|
|
|
||||||
|
|
@ -10,8 +10,8 @@ package consensus
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"forge.lthn.ai/core/go-blockchain/config"
|
"dappco.re/go/core/blockchain/config"
|
||||||
"forge.lthn.ai/core/go-blockchain/types"
|
"dappco.re/go/core/blockchain/types"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -10,8 +10,8 @@ package consensus
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"forge.lthn.ai/core/go-blockchain/config"
|
"dappco.re/go/core/blockchain/config"
|
||||||
"forge.lthn.ai/core/go-blockchain/types"
|
"dappco.re/go/core/blockchain/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
// validV2Tx returns a minimal valid v2 (Zarcanum) transaction for testing.
|
// validV2Tx returns a minimal valid v2 (Zarcanum) transaction for testing.
|
||||||
|
|
|
||||||
|
|
@ -9,10 +9,10 @@ import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
coreerr "forge.lthn.ai/core/go-log"
|
coreerr "dappco.re/go/core/log"
|
||||||
|
|
||||||
"forge.lthn.ai/core/go-blockchain/types"
|
"dappco.re/go/core/blockchain/types"
|
||||||
"forge.lthn.ai/core/go-blockchain/wire"
|
"dappco.re/go/core/blockchain/wire"
|
||||||
)
|
)
|
||||||
|
|
||||||
// zcSigData holds the parsed components of a ZC_sig variant element
|
// zcSigData holds the parsed components of a ZC_sig variant element
|
||||||
|
|
|
||||||
|
|
@ -11,9 +11,9 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"forge.lthn.ai/core/go-blockchain/config"
|
"dappco.re/go/core/blockchain/config"
|
||||||
"forge.lthn.ai/core/go-blockchain/types"
|
"dappco.re/go/core/blockchain/types"
|
||||||
"forge.lthn.ai/core/go-blockchain/wire"
|
"dappco.re/go/core/blockchain/wire"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -8,12 +8,12 @@ package consensus
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
coreerr "forge.lthn.ai/core/go-log"
|
coreerr "dappco.re/go/core/log"
|
||||||
|
|
||||||
"forge.lthn.ai/core/go-blockchain/config"
|
"dappco.re/go/core/blockchain/config"
|
||||||
"forge.lthn.ai/core/go-blockchain/crypto"
|
"dappco.re/go/core/blockchain/crypto"
|
||||||
"forge.lthn.ai/core/go-blockchain/types"
|
"dappco.re/go/core/blockchain/types"
|
||||||
"forge.lthn.ai/core/go-blockchain/wire"
|
"dappco.re/go/core/blockchain/wire"
|
||||||
)
|
)
|
||||||
|
|
||||||
// RingOutputsFn fetches the public keys for a ring at the given amount
|
// RingOutputsFn fetches the public keys for a ring at the given amount
|
||||||
|
|
|
||||||
|
|
@ -8,10 +8,10 @@ package consensus
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"forge.lthn.ai/core/go-blockchain/config"
|
"dappco.re/go/core/blockchain/config"
|
||||||
"forge.lthn.ai/core/go-blockchain/crypto"
|
"dappco.re/go/core/blockchain/crypto"
|
||||||
"forge.lthn.ai/core/go-blockchain/types"
|
"dappco.re/go/core/blockchain/types"
|
||||||
"forge.lthn.ai/core/go-blockchain/wire"
|
"dappco.re/go/core/blockchain/wire"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,8 @@ package consensus
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"forge.lthn.ai/core/go-blockchain/config"
|
"dappco.re/go/core/blockchain/config"
|
||||||
"forge.lthn.ai/core/go-blockchain/types"
|
"dappco.re/go/core/blockchain/types"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ import "C"
|
||||||
import (
|
import (
|
||||||
"unsafe"
|
"unsafe"
|
||||||
|
|
||||||
coreerr "forge.lthn.ai/core/go-log"
|
coreerr "dappco.re/go/core/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
// PointMul8 multiplies a curve point by the cofactor 8.
|
// PointMul8 multiplies a curve point by the cofactor 8.
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ import (
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"forge.lthn.ai/core/go-blockchain/crypto"
|
"dappco.re/go/core/blockchain/crypto"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestFastHash_Good_KnownVector(t *testing.T) {
|
func TestFastHash_Good_KnownVector(t *testing.T) {
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"unsafe"
|
"unsafe"
|
||||||
|
|
||||||
coreerr "forge.lthn.ai/core/go-log"
|
coreerr "dappco.re/go/core/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
// GenerateKeys creates a new random key pair.
|
// GenerateKeys creates a new random key pair.
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ import "C"
|
||||||
import (
|
import (
|
||||||
"unsafe"
|
"unsafe"
|
||||||
|
|
||||||
coreerr "forge.lthn.ai/core/go-log"
|
coreerr "dappco.re/go/core/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
// GenerateKeyImage computes the key image for a public/secret key pair.
|
// GenerateKeyImage computes the key image for a public/secret key pair.
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"unsafe"
|
"unsafe"
|
||||||
|
|
||||||
coreerr "forge.lthn.ai/core/go-log"
|
coreerr "dappco.re/go/core/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
// RandomXHash computes the RandomX PoW hash. The key is the cache
|
// RandomXHash computes the RandomX PoW hash. The key is the cache
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ import "C"
|
||||||
import (
|
import (
|
||||||
"unsafe"
|
"unsafe"
|
||||||
|
|
||||||
coreerr "forge.lthn.ai/core/go-log"
|
coreerr "dappco.re/go/core/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
// GenerateSignature creates a standard (non-ring) signature.
|
// GenerateSignature creates a standard (non-ring) signature.
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ import (
|
||||||
"math/big"
|
"math/big"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"forge.lthn.ai/core/go-blockchain/config"
|
"dappco.re/go/core/blockchain/config"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestNextDifficulty_Good(t *testing.T) {
|
func TestNextDifficulty_Good(t *testing.T) {
|
||||||
|
|
|
||||||
|
|
@ -147,7 +147,7 @@ Do not use American spellings in identifiers, comments, or documentation.
|
||||||
- Error wrapping uses `fmt.Errorf("types: description: %w", err)`
|
- Error wrapping uses `fmt.Errorf("types: description: %w", err)`
|
||||||
- Every source file carries the EUPL-1.2 copyright header
|
- Every source file carries the EUPL-1.2 copyright header
|
||||||
- No emojis in code or comments
|
- No emojis in code or comments
|
||||||
- Imports are ordered: stdlib, then `golang.org/x`, then `forge.lthn.ai`, each
|
- Imports are ordered: stdlib, then `golang.org/x`, then `dappco.re`, each
|
||||||
separated by a blank line
|
separated by a blank line
|
||||||
|
|
||||||
### Dependencies
|
### Dependencies
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ description: Pure Go implementation of the Lethean CryptoNote/Zano-fork blockcha
|
||||||
|
|
||||||
`go-blockchain` is a Go reimplementation of the Lethean blockchain protocol. It provides pure-Go implementations of chain logic, data structures, consensus rules, wallet operations, and networking, delegating only mathematically complex cryptographic operations (ring signatures, Bulletproofs+, Zarcanum proofs) to a cleaned C++ library via CGo.
|
`go-blockchain` is a Go reimplementation of the Lethean blockchain protocol. It provides pure-Go implementations of chain logic, data structures, consensus rules, wallet operations, and networking, delegating only mathematically complex cryptographic operations (ring signatures, Bulletproofs+, Zarcanum proofs) to a cleaned C++ library via CGo.
|
||||||
|
|
||||||
**Module path:** `forge.lthn.ai/core/go-blockchain`
|
**Module path:** `dappco.re/go/core/blockchain`
|
||||||
|
|
||||||
**Licence:** [European Union Public Licence (EUPL) version 1.2](https://joinup.ec.europa.eu/software/page/eupl/licence-eupl)
|
**Licence:** [European Union Public Licence (EUPL) version 1.2](https://joinup.ec.europa.eu/software/page/eupl/licence-eupl)
|
||||||
|
|
||||||
|
|
@ -61,9 +61,9 @@ go-blockchain/
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"forge.lthn.ai/core/go-blockchain/config"
|
"dappco.re/go/core/blockchain/config"
|
||||||
"forge.lthn.ai/core/go-blockchain/rpc"
|
"dappco.re/go/core/blockchain/rpc"
|
||||||
"forge.lthn.ai/core/go-blockchain/types"
|
"dappco.re/go/core/blockchain/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Query the daemon
|
// Query the daemon
|
||||||
|
|
@ -109,7 +109,7 @@ When CGo is disabled, stub implementations return errors, allowing the rest of t
|
||||||
|
|
||||||
## Development Phases
|
## Development Phases
|
||||||
|
|
||||||
The project follows a 9-phase development plan. See the [wiki Development Phases page](https://forge.lthn.ai/core/go-blockchain/wiki/Development-Phases) for detailed phase descriptions.
|
The project follows a 9-phase development plan. See the [wiki Development Phases page](https://dappco.re/go/core/blockchain/wiki/Development-Phases) for detailed phase descriptions.
|
||||||
|
|
||||||
| Phase | Scope | Status |
|
| Phase | Scope | Status |
|
||||||
|-------|-------|--------|
|
|-------|-------|--------|
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ The Lethean node exposes two RPC interfaces: a **daemon** API for blockchain que
|
||||||
The `rpc/` package provides a typed Go client:
|
The `rpc/` package provides a typed Go client:
|
||||||
|
|
||||||
```go
|
```go
|
||||||
import "forge.lthn.ai/core/go-blockchain/rpc"
|
import "dappco.re/go/core/blockchain/rpc"
|
||||||
|
|
||||||
// Create a client (appends /json_rpc automatically)
|
// Create a client (appends /json_rpc automatically)
|
||||||
client := rpc.NewClient("http://localhost:36941")
|
client := rpc.NewClient("http://localhost:36941")
|
||||||
|
|
|
||||||
|
|
@ -1085,8 +1085,8 @@ package consensus
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"forge.lthn.ai/core/go-blockchain/config"
|
"dappco.re/go/core/blockchain/config"
|
||||||
"forge.lthn.ai/core/go-blockchain/types"
|
"dappco.re/go/core/blockchain/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
// validV2Tx returns a minimal valid v2 (Zarcanum) transaction for testing.
|
// validV2Tx returns a minimal valid v2 (Zarcanum) transaction for testing.
|
||||||
|
|
@ -1287,8 +1287,8 @@ package consensus
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"forge.lthn.ai/core/go-blockchain/config"
|
"dappco.re/go/core/blockchain/config"
|
||||||
"forge.lthn.ai/core/go-blockchain/types"
|
"dappco.re/go/core/blockchain/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestIsPreHardforkFreeze_Good(t *testing.T) {
|
func TestIsPreHardforkFreeze_Good(t *testing.T) {
|
||||||
|
|
|
||||||
|
|
@ -51,9 +51,9 @@ package chain
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"forge.lthn.ai/core/go-blockchain/config"
|
"dappco.re/go/core/blockchain/config"
|
||||||
"forge.lthn.ai/core/go-blockchain/types"
|
"dappco.re/go/core/blockchain/types"
|
||||||
store "forge.lthn.ai/core/go-store"
|
store "dappco.re/go/core/store"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -277,8 +277,8 @@ package chain
|
||||||
import (
|
import (
|
||||||
"math/big"
|
"math/big"
|
||||||
|
|
||||||
"forge.lthn.ai/core/go-blockchain/config"
|
"dappco.re/go/core/blockchain/config"
|
||||||
"forge.lthn.ai/core/go-blockchain/difficulty"
|
"dappco.re/go/core/blockchain/difficulty"
|
||||||
)
|
)
|
||||||
|
|
||||||
// nextDifficultyWith computes the expected difficulty for the block at the
|
// nextDifficultyWith computes the expected difficulty for the block at the
|
||||||
|
|
@ -365,7 +365,7 @@ cd /home/claude/Code/core/go-blockchain && go test -race -run "TestNext.*Difficu
|
||||||
**Expected:**
|
**Expected:**
|
||||||
|
|
||||||
```
|
```
|
||||||
ok forge.lthn.ai/core/go-blockchain/chain (cached)
|
ok dappco.re/go/core/blockchain/chain (cached)
|
||||||
```
|
```
|
||||||
|
|
||||||
All 10 tests pass: `TestNextDifficulty_Genesis`, `TestNextDifficulty_FewBlocks`, `TestNextDifficulty_EmptyChain`, `TestNextDifficulty_HF6Boundary_Good`, `TestNextDifficulty_HF6Boundary_Bad`, `TestNextDifficulty_HF6Boundary_Ugly`, `TestNextPoSDifficulty_Good`, `TestNextPoSDifficulty_HF6Boundary_Good`, `TestNextPoSDifficulty_Genesis`.
|
All 10 tests pass: `TestNextDifficulty_Genesis`, `TestNextDifficulty_FewBlocks`, `TestNextDifficulty_EmptyChain`, `TestNextDifficulty_HF6Boundary_Good`, `TestNextDifficulty_HF6Boundary_Bad`, `TestNextDifficulty_HF6Boundary_Ugly`, `TestNextPoSDifficulty_Good`, `TestNextPoSDifficulty_HF6Boundary_Good`, `TestNextPoSDifficulty_Genesis`.
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
**Date:** 2026-03-16
|
**Date:** 2026-03-16
|
||||||
**Author:** Charon
|
**Author:** Charon
|
||||||
**Package:** `forge.lthn.ai/core/go-blockchain`
|
**Package:** `dappco.re/go/core/blockchain`
|
||||||
**Status:** Approved
|
**Status:** Approved
|
||||||
|
|
||||||
## Context
|
## Context
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
**Date:** 2026-03-16
|
**Date:** 2026-03-16
|
||||||
**Author:** Charon
|
**Author:** Charon
|
||||||
**Package:** `forge.lthn.ai/core/go-blockchain`
|
**Package:** `dappco.re/go/core/blockchain`
|
||||||
**Status:** Approved
|
**Status:** Approved
|
||||||
|
|
||||||
## Context
|
## Context
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
**Date:** 2026-03-16
|
**Date:** 2026-03-16
|
||||||
**Author:** Charon
|
**Author:** Charon
|
||||||
**Package:** `forge.lthn.ai/core/go-blockchain`
|
**Package:** `dappco.re/go/core/blockchain`
|
||||||
**Status:** Draft
|
**Status:** Draft
|
||||||
**Depends on:** HF1 (types refactor), HF3 (block version), HF4 (Zarcanum — already implemented)
|
**Depends on:** HF1 (types refactor), HF3 (block version), HF4 (Zarcanum — already implemented)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
**Date:** 2026-03-16
|
**Date:** 2026-03-16
|
||||||
**Author:** Charon
|
**Author:** Charon
|
||||||
**Package:** `forge.lthn.ai/core/go-blockchain`
|
**Package:** `dappco.re/go/core/blockchain`
|
||||||
**Status:** Draft
|
**Status:** Draft
|
||||||
**Depends on:** HF5 (confidential assets)
|
**Depends on:** HF5 (confidential assets)
|
||||||
|
|
||||||
|
|
|
||||||
34
go.mod
34
go.mod
|
|
@ -1,14 +1,14 @@
|
||||||
module forge.lthn.ai/core/go-blockchain
|
module dappco.re/go/core/blockchain
|
||||||
|
|
||||||
go 1.26.0
|
go 1.26.0
|
||||||
|
|
||||||
require (
|
require (
|
||||||
forge.lthn.ai/core/cli v0.3.1
|
dappco.re/go/core/cli v0.3.1
|
||||||
forge.lthn.ai/core/go-io v0.1.2
|
dappco.re/go/core/io v0.2.0
|
||||||
forge.lthn.ai/core/go-log v0.0.4
|
dappco.re/go/core/log v0.1.0
|
||||||
forge.lthn.ai/core/go-p2p v0.1.3
|
dappco.re/go/core/p2p v0.1.3
|
||||||
forge.lthn.ai/core/go-process v0.2.3
|
dappco.re/go/core/process v0.2.3
|
||||||
forge.lthn.ai/core/go-store v0.1.6
|
dappco.re/go/core/store v0.1.6
|
||||||
github.com/charmbracelet/bubbletea v1.3.10
|
github.com/charmbracelet/bubbletea v1.3.10
|
||||||
github.com/spf13/cobra v1.10.2
|
github.com/spf13/cobra v1.10.2
|
||||||
github.com/stretchr/testify v1.11.1
|
github.com/stretchr/testify v1.11.1
|
||||||
|
|
@ -17,9 +17,12 @@ require (
|
||||||
|
|
||||||
require (
|
require (
|
||||||
forge.lthn.ai/core/go v0.3.1 // indirect
|
forge.lthn.ai/core/go v0.3.1 // indirect
|
||||||
forge.lthn.ai/core/go-crypt v0.1.7 // indirect
|
forge.lthn.ai/core/go-crypt v0.1.6 // indirect
|
||||||
forge.lthn.ai/core/go-i18n v0.1.4 // indirect
|
forge.lthn.ai/core/go-i18n v0.1.4 // indirect
|
||||||
forge.lthn.ai/core/go-inference v0.1.4 // indirect
|
forge.lthn.ai/core/go-inference v0.1.4 // indirect
|
||||||
|
forge.lthn.ai/core/go-io v0.1.2 // indirect
|
||||||
|
forge.lthn.ai/core/go-log v0.0.4 // indirect
|
||||||
|
forge.lthn.ai/core/go-process v0.2.2 // indirect
|
||||||
github.com/ProtonMail/go-crypto v1.4.0 // indirect
|
github.com/ProtonMail/go-crypto v1.4.0 // indirect
|
||||||
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
|
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
|
||||||
github.com/charmbracelet/colorprofile v0.4.3 // indirect
|
github.com/charmbracelet/colorprofile v0.4.3 // indirect
|
||||||
|
|
@ -29,6 +32,7 @@ require (
|
||||||
github.com/charmbracelet/x/term v0.2.2 // indirect
|
github.com/charmbracelet/x/term v0.2.2 // indirect
|
||||||
github.com/clipperhouse/displaywidth v0.11.0 // indirect
|
github.com/clipperhouse/displaywidth v0.11.0 // indirect
|
||||||
github.com/clipperhouse/uax29/v2 v2.7.0 // indirect
|
github.com/clipperhouse/uax29/v2 v2.7.0 // indirect
|
||||||
|
github.com/cloudflare/circl v1.6.3 // indirect
|
||||||
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
|
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
|
||||||
github.com/dustin/go-humanize v1.0.1 // indirect
|
github.com/dustin/go-humanize v1.0.1 // indirect
|
||||||
github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f // indirect
|
github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f // indirect
|
||||||
|
|
@ -47,6 +51,7 @@ require (
|
||||||
github.com/rivo/uniseg v0.4.7 // indirect
|
github.com/rivo/uniseg v0.4.7 // indirect
|
||||||
github.com/spf13/pflag v1.0.10 // indirect
|
github.com/spf13/pflag v1.0.10 // indirect
|
||||||
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect
|
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect
|
||||||
|
golang.org/x/exp v0.0.0-20260312153236-7ab1446f8b90 // indirect
|
||||||
golang.org/x/sys v0.42.0 // indirect
|
golang.org/x/sys v0.42.0 // indirect
|
||||||
golang.org/x/term v0.41.0 // indirect
|
golang.org/x/term v0.41.0 // indirect
|
||||||
golang.org/x/text v0.35.0 // indirect
|
golang.org/x/text v0.35.0 // indirect
|
||||||
|
|
@ -56,3 +61,16 @@ require (
|
||||||
modernc.org/memory v1.11.0 // indirect
|
modernc.org/memory v1.11.0 // indirect
|
||||||
modernc.org/sqlite v1.47.0 // indirect
|
modernc.org/sqlite v1.47.0 // indirect
|
||||||
)
|
)
|
||||||
|
|
||||||
|
replace (
|
||||||
|
dappco.re/go/core => forge.lthn.ai/core/go v0.5.0
|
||||||
|
dappco.re/go/core/cli => forge.lthn.ai/core/cli v0.3.1
|
||||||
|
dappco.re/go/core/crypt => forge.lthn.ai/core/go-crypt v0.1.7
|
||||||
|
dappco.re/go/core/i18n => forge.lthn.ai/core/go-i18n v0.1.4
|
||||||
|
dappco.re/go/core/inference => forge.lthn.ai/core/go-inference v0.1.4
|
||||||
|
dappco.re/go/core/io => forge.lthn.ai/core/go-io v0.2.0
|
||||||
|
dappco.re/go/core/log => forge.lthn.ai/core/go-log v0.1.0
|
||||||
|
dappco.re/go/core/p2p => forge.lthn.ai/core/go-p2p v0.1.3
|
||||||
|
dappco.re/go/core/process => forge.lthn.ai/core/go-process v0.2.3
|
||||||
|
dappco.re/go/core/store => forge.lthn.ai/core/go-store v0.1.6
|
||||||
|
)
|
||||||
|
|
|
||||||
44
go.sum
44
go.sum
|
|
@ -1,21 +1,31 @@
|
||||||
forge.lthn.ai/core/cli v0.3.7 h1:1GrbaGg0wDGHr6+klSbbGyN/9sSbHvFbdySJznymhwg=
|
forge.lthn.ai/core/cli v0.3.1 h1:ZpHhaDrdbaV98JDxj/f0E5nytYk9tTMRu3qohGyK4M0=
|
||||||
forge.lthn.ai/core/cli v0.3.7/go.mod h1:DBUppJkA9P45ZFGgI2B8VXw1rAZxamHoI/KG7fRvTNs=
|
forge.lthn.ai/core/cli v0.3.1/go.mod h1:28cOl9eK0H033Otkjrv9f/QCmtHcJl+IIx4om8JskOg=
|
||||||
forge.lthn.ai/core/go v0.3.3 h1:kYYZ2nRYy0/Be3cyuLJspRjLqTMxpckVyhb/7Sw2gd0=
|
forge.lthn.ai/core/go v0.3.1 h1:5FMTsUhLcxSr07F9q3uG0Goy4zq4eLivoqi8shSY4UM=
|
||||||
forge.lthn.ai/core/go v0.3.3/go.mod h1:Cp4ac25pghvO2iqOu59t1GyngTKVOzKB5/VPdhRi9CQ=
|
forge.lthn.ai/core/go v0.3.1/go.mod h1:gE6c8h+PJ2287qNhVUJ5SOe1kopEwHEquvinstpuyJc=
|
||||||
forge.lthn.ai/core/go-i18n v0.1.7 h1:aHkAoc3W8fw3RPNvw/UszQbjyFWXHszzbZgty3SwyAA=
|
forge.lthn.ai/core/go-crypt v0.1.6 h1:jB7L/28S1NR+91u3GcOYuKfBLzPhhBUY1fRe6WkGVns=
|
||||||
forge.lthn.ai/core/go-i18n v0.1.7/go.mod h1:0VDjwtY99NSj2iqwrI09h5GUsJeM9s48MLkr+/Dn4G8=
|
forge.lthn.ai/core/go-crypt v0.1.6/go.mod h1:4VZAGqxlbadhSB66sJkdj54/HSJ+bSxVgwWK5kMMYDo=
|
||||||
forge.lthn.ai/core/go-inference v0.1.6 h1:ce42zC0zO8PuISUyAukAN1NACEdWp5wF1mRgnh5+58E=
|
forge.lthn.ai/core/go-i18n v0.1.4 h1:zOHUUJDgRo88/3tj++kN+VELg/buyZ4T2OSdG3HBbLQ=
|
||||||
forge.lthn.ai/core/go-inference v0.1.6/go.mod h1:jfWz+IJX55wAH98+ic6FEqqGB6/P31CHlg7VY7pxREw=
|
forge.lthn.ai/core/go-i18n v0.1.4/go.mod h1:aDyAfz7MMgWYgLkZCptfFmZ7jJg3ocwjEJ1WkJSvv4U=
|
||||||
forge.lthn.ai/core/go-io v0.1.7 h1:Tdb6sqh+zz1lsGJaNX9RFWM6MJ/RhSAyxfulLXrJsbk=
|
forge.lthn.ai/core/go-inference v0.1.4 h1:fuAgWbqsEDajHniqAKyvHYbRcBrkGEiGSqR2pfTMRY0=
|
||||||
forge.lthn.ai/core/go-io v0.1.7/go.mod h1:8lRLFk4Dnp5cR/Cyzh9WclD5566TbpdRgwcH7UZLWn4=
|
forge.lthn.ai/core/go-inference v0.1.4/go.mod h1:jfWz+IJX55wAH98+ic6FEqqGB6/P31CHlg7VY7pxREw=
|
||||||
|
forge.lthn.ai/core/go-io v0.1.2 h1:q8hj2jtOFqAgHlBr5wsUAOXtaFkxy9gqGrQT/il0WYA=
|
||||||
|
forge.lthn.ai/core/go-io v0.1.2/go.mod h1:PbNKW1Q25ywSOoQXeGdQHbV5aiIrTXvHIQ5uhplA//g=
|
||||||
|
forge.lthn.ai/core/go-io v0.2.0 h1:O/b3E6agFNQEy99FB2PMeeGO0wJleE0C3jx7tPEu9HA=
|
||||||
|
forge.lthn.ai/core/go-io v0.2.0/go.mod h1:1QnQV6X9LNgFKfm8SkOtR9LLaj3bDcsOIeJOOyjbL5E=
|
||||||
forge.lthn.ai/core/go-log v0.0.4 h1:KTuCEPgFmuM8KJfnyQ8vPOU1Jg654W74h8IJvfQMfv0=
|
forge.lthn.ai/core/go-log v0.0.4 h1:KTuCEPgFmuM8KJfnyQ8vPOU1Jg654W74h8IJvfQMfv0=
|
||||||
forge.lthn.ai/core/go-log v0.0.4/go.mod h1:r14MXKOD3LF/sI8XUJQhRk/SZHBE7jAFVuCfgkXoZPw=
|
forge.lthn.ai/core/go-log v0.0.4/go.mod h1:r14MXKOD3LF/sI8XUJQhRk/SZHBE7jAFVuCfgkXoZPw=
|
||||||
forge.lthn.ai/core/go-p2p v0.1.7 h1:4mEi/mxsSSDUgRsYWwdOdV8NYEm2zOY4OP+VAzhvb+o=
|
forge.lthn.ai/core/go-log v0.1.0 h1:QMr7jeZj2Bb/BovgPbiZOzNt9j/+wym11lBSleucCa0=
|
||||||
forge.lthn.ai/core/go-p2p v0.1.7/go.mod h1:I8uEoxwchrG6oGY/29OO/CiSd9y7XolgUaiIHTdqLeI=
|
forge.lthn.ai/core/go-log v0.1.0/go.mod h1:Nkqb8gsXhZAO8VLpx7B8i1iAmohhzqA20b9Zr8VUcJs=
|
||||||
forge.lthn.ai/core/go-process v0.2.9 h1:Wql+5TUF+lfU2oJ9I+S764MkTqJhBsuyMM0v1zsfZC4=
|
forge.lthn.ai/core/go-p2p v0.1.3 h1:XbETiHrYTDiJTq6EAxdU+MJF1l5UxEQE14wJ7G7FOVc=
|
||||||
forge.lthn.ai/core/go-process v0.2.9/go.mod h1:NIzZOF5IVYYCjHkcNIGcg1mZH+bzGoie4SlZUDYOKIM=
|
forge.lthn.ai/core/go-p2p v0.1.3/go.mod h1:F2M4qIzkixQpZEoOEtNaB4rhmi1WQKbR7JqVzGA1r80=
|
||||||
forge.lthn.ai/core/go-store v0.1.10 h1:JLyf8xMR3V6PfBAW1kv6SJeHsYY93LacEBpTFW657qE=
|
forge.lthn.ai/core/go-process v0.2.2 h1:bnHFtzg92udochDDB6bD2luzzmr9ETKWmGzSsGjFFYE=
|
||||||
forge.lthn.ai/core/go-store v0.1.10/go.mod h1:VNnHh94TMD3+L+sSgvxn0GHtDKhJR8FD6JiuIuRtjuk=
|
forge.lthn.ai/core/go-process v0.2.2/go.mod h1:gVTbxL16ccUIexlFcyDtCy7LfYvD8Rtyzfo8bnXAXrU=
|
||||||
|
forge.lthn.ai/core/go-process v0.2.3 h1:/ERqRYHgCNZjNT9NMinAAJJGJWSsHuCTiHFNEm6nTPY=
|
||||||
|
forge.lthn.ai/core/go-process v0.2.3/go.mod h1:gVTbxL16ccUIexlFcyDtCy7LfYvD8Rtyzfo8bnXAXrU=
|
||||||
|
forge.lthn.ai/core/go-store v0.1.6 h1:7T+K5cciXOaWRxge0WnGkt0PcK3epliWBa1G2FLEuac=
|
||||||
|
forge.lthn.ai/core/go-store v0.1.6/go.mod h1:/2vqaAn+HgGU14N29B+vIfhjIsBzy7RC+AluI6BIUKI=
|
||||||
|
github.com/ProtonMail/go-crypto v1.4.0 h1:Zq/pbM3F5DFgJiMouxEdSVY44MVoQNEKp5d5QxIQceQ=
|
||||||
|
github.com/ProtonMail/go-crypto v1.4.0/go.mod h1:e1OaTyu5SYVrO9gKOEhTc+5UcXtTUa+P3uLudwcgPqo=
|
||||||
github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k=
|
github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k=
|
||||||
github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8=
|
github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8=
|
||||||
github.com/charmbracelet/bubbletea v1.3.10 h1:otUDHWMMzQSB0Pkc87rm691KZ3SWa4KUlvF9nRvCICw=
|
github.com/charmbracelet/bubbletea v1.3.10 h1:otUDHWMMzQSB0Pkc87rm691KZ3SWa4KUlvF9nRvCICw=
|
||||||
|
|
@ -34,6 +44,8 @@ github.com/clipperhouse/displaywidth v0.11.0 h1:lBc6kY44VFw+TDx4I8opi/EtL9m20WSE
|
||||||
github.com/clipperhouse/displaywidth v0.11.0/go.mod h1:bkrFNkf81G8HyVqmKGxsPufD3JhNl3dSqnGhOoSD/o0=
|
github.com/clipperhouse/displaywidth v0.11.0/go.mod h1:bkrFNkf81G8HyVqmKGxsPufD3JhNl3dSqnGhOoSD/o0=
|
||||||
github.com/clipperhouse/uax29/v2 v2.7.0 h1:+gs4oBZ2gPfVrKPthwbMzWZDaAFPGYK72F0NJv2v7Vk=
|
github.com/clipperhouse/uax29/v2 v2.7.0 h1:+gs4oBZ2gPfVrKPthwbMzWZDaAFPGYK72F0NJv2v7Vk=
|
||||||
github.com/clipperhouse/uax29/v2 v2.7.0/go.mod h1:EFJ2TJMRUaplDxHKj1qAEhCtQPW2tJSwu5BF98AuoVM=
|
github.com/clipperhouse/uax29/v2 v2.7.0/go.mod h1:EFJ2TJMRUaplDxHKj1qAEhCtQPW2tJSwu5BF98AuoVM=
|
||||||
|
github.com/cloudflare/circl v1.6.3 h1:9GPOhQGF9MCYUeXyMYlqTR6a5gTrgR/fBLXvUgtVcg8=
|
||||||
|
github.com/cloudflare/circl v1.6.3/go.mod h1:2eXP6Qfat4O/Yhh8BznvKnJ+uzEoTQ6jVKJRn81BiS4=
|
||||||
github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g=
|
github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g=
|
||||||
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
|
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
|
||||||
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
|
|
|
||||||
|
|
@ -11,10 +11,10 @@ package mining
|
||||||
import (
|
import (
|
||||||
"encoding/binary"
|
"encoding/binary"
|
||||||
|
|
||||||
"forge.lthn.ai/core/go-blockchain/consensus"
|
"dappco.re/go/core/blockchain/consensus"
|
||||||
"forge.lthn.ai/core/go-blockchain/crypto"
|
"dappco.re/go/core/blockchain/crypto"
|
||||||
"forge.lthn.ai/core/go-blockchain/types"
|
"dappco.re/go/core/blockchain/types"
|
||||||
"forge.lthn.ai/core/go-blockchain/wire"
|
"dappco.re/go/core/blockchain/wire"
|
||||||
)
|
)
|
||||||
|
|
||||||
// RandomXKey is the cache initialisation key for RandomX hashing.
|
// RandomXKey is the cache initialisation key for RandomX hashing.
|
||||||
|
|
|
||||||
|
|
@ -11,8 +11,8 @@ import (
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"forge.lthn.ai/core/go-blockchain/types"
|
"dappco.re/go/core/blockchain/types"
|
||||||
"forge.lthn.ai/core/go-blockchain/wire"
|
"dappco.re/go/core/blockchain/wire"
|
||||||
)
|
)
|
||||||
|
|
||||||
func testnetGenesisHeader() types.BlockHeader {
|
func testnetGenesisHeader() types.BlockHeader {
|
||||||
|
|
|
||||||
|
|
@ -12,8 +12,8 @@ import (
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"forge.lthn.ai/core/go-blockchain/rpc"
|
"dappco.re/go/core/blockchain/rpc"
|
||||||
"forge.lthn.ai/core/go-blockchain/wire"
|
"dappco.re/go/core/blockchain/wire"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -15,13 +15,13 @@ import (
|
||||||
"sync/atomic"
|
"sync/atomic"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
coreerr "forge.lthn.ai/core/go-log"
|
coreerr "dappco.re/go/core/log"
|
||||||
|
|
||||||
"forge.lthn.ai/core/go-blockchain/consensus"
|
"dappco.re/go/core/blockchain/consensus"
|
||||||
"forge.lthn.ai/core/go-blockchain/crypto"
|
"dappco.re/go/core/blockchain/crypto"
|
||||||
"forge.lthn.ai/core/go-blockchain/rpc"
|
"dappco.re/go/core/blockchain/rpc"
|
||||||
"forge.lthn.ai/core/go-blockchain/types"
|
"dappco.re/go/core/blockchain/types"
|
||||||
"forge.lthn.ai/core/go-blockchain/wire"
|
"dappco.re/go/core/blockchain/wire"
|
||||||
)
|
)
|
||||||
|
|
||||||
// TemplateProvider abstracts the RPC methods needed by the miner.
|
// TemplateProvider abstracts the RPC methods needed by the miner.
|
||||||
|
|
|
||||||
|
|
@ -14,9 +14,9 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"forge.lthn.ai/core/go-blockchain/rpc"
|
"dappco.re/go/core/blockchain/rpc"
|
||||||
"forge.lthn.ai/core/go-blockchain/types"
|
"dappco.re/go/core/blockchain/types"
|
||||||
"forge.lthn.ai/core/go-blockchain/wire"
|
"dappco.re/go/core/blockchain/wire"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
// Package p2p implements the CryptoNote P2P protocol for the Lethean blockchain.
|
// Package p2p implements the CryptoNote P2P protocol for the Lethean blockchain.
|
||||||
package p2p
|
package p2p
|
||||||
|
|
||||||
import "forge.lthn.ai/core/go-p2p/node/levin"
|
import "dappco.re/go/core/p2p/node/levin"
|
||||||
|
|
||||||
// Re-export command IDs from the levin package for convenience.
|
// Re-export command IDs from the levin package for convenience.
|
||||||
const (
|
const (
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ package p2p
|
||||||
import (
|
import (
|
||||||
"encoding/binary"
|
"encoding/binary"
|
||||||
|
|
||||||
"forge.lthn.ai/core/go-p2p/node/levin"
|
"dappco.re/go/core/p2p/node/levin"
|
||||||
)
|
)
|
||||||
|
|
||||||
// PeerlistEntrySize is the packed size of a peerlist entry (ip + port + id + last_seen).
|
// PeerlistEntrySize is the packed size of a peerlist entry (ip + port + id + last_seen).
|
||||||
|
|
|
||||||
|
|
@ -9,8 +9,8 @@ import (
|
||||||
"encoding/binary"
|
"encoding/binary"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"forge.lthn.ai/core/go-blockchain/config"
|
"dappco.re/go/core/blockchain/config"
|
||||||
"forge.lthn.ai/core/go-p2p/node/levin"
|
"dappco.re/go/core/p2p/node/levin"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestEncodeHandshakeRequest_Good_Roundtrip(t *testing.T) {
|
func TestEncodeHandshakeRequest_Good_Roundtrip(t *testing.T) {
|
||||||
|
|
|
||||||
|
|
@ -15,8 +15,8 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"forge.lthn.ai/core/go-blockchain/config"
|
"dappco.re/go/core/blockchain/config"
|
||||||
"forge.lthn.ai/core/go-p2p/node/levin"
|
"dappco.re/go/core/p2p/node/levin"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
package p2p
|
package p2p
|
||||||
|
|
||||||
import "forge.lthn.ai/core/go-p2p/node/levin"
|
import "dappco.re/go/core/p2p/node/levin"
|
||||||
|
|
||||||
// EncodePingRequest returns an encoded empty ping request payload.
|
// EncodePingRequest returns an encoded empty ping request payload.
|
||||||
func EncodePingRequest() ([]byte, error) {
|
func EncodePingRequest() ([]byte, error) {
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ package p2p
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"forge.lthn.ai/core/go-p2p/node/levin"
|
"dappco.re/go/core/p2p/node/levin"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestEncodePingRequest_Good_EmptySection(t *testing.T) {
|
func TestEncodePingRequest_Good_EmptySection(t *testing.T) {
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
package p2p
|
package p2p
|
||||||
|
|
||||||
import "forge.lthn.ai/core/go-p2p/node/levin"
|
import "dappco.re/go/core/p2p/node/levin"
|
||||||
|
|
||||||
// NewBlockNotification is NOTIFY_NEW_BLOCK (2001).
|
// NewBlockNotification is NOTIFY_NEW_BLOCK (2001).
|
||||||
type NewBlockNotification struct {
|
type NewBlockNotification struct {
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"forge.lthn.ai/core/go-p2p/node/levin"
|
"dappco.re/go/core/p2p/node/levin"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestNewBlockNotification_Good_Roundtrip(t *testing.T) {
|
func TestNewBlockNotification_Good_Roundtrip(t *testing.T) {
|
||||||
|
|
|
||||||
|
|
@ -6,8 +6,8 @@
|
||||||
package p2p
|
package p2p
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"forge.lthn.ai/core/go-blockchain/types"
|
"dappco.re/go/core/blockchain/types"
|
||||||
"forge.lthn.ai/core/go-p2p/node/levin"
|
"dappco.re/go/core/p2p/node/levin"
|
||||||
)
|
)
|
||||||
|
|
||||||
// CoreSyncData is the blockchain state exchanged during handshake and timed sync.
|
// CoreSyncData is the blockchain state exchanged during handshake and timed sync.
|
||||||
|
|
|
||||||
|
|
@ -8,8 +8,8 @@ package p2p
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"forge.lthn.ai/core/go-blockchain/types"
|
"dappco.re/go/core/blockchain/types"
|
||||||
"forge.lthn.ai/core/go-p2p/node/levin"
|
"dappco.re/go/core/p2p/node/levin"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestCoreSyncData_Good_Roundtrip(t *testing.T) {
|
func TestCoreSyncData_Good_Roundtrip(t *testing.T) {
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
package p2p
|
package p2p
|
||||||
|
|
||||||
import "forge.lthn.ai/core/go-p2p/node/levin"
|
import "dappco.re/go/core/p2p/node/levin"
|
||||||
|
|
||||||
// TimedSyncRequest is a COMMAND_TIMED_SYNC request.
|
// TimedSyncRequest is a COMMAND_TIMED_SYNC request.
|
||||||
type TimedSyncRequest struct {
|
type TimedSyncRequest struct {
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ package rpc
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
coreerr "forge.lthn.ai/core/go-log"
|
coreerr "dappco.re/go/core/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
// GetLastBlockHeader returns the header of the most recent block.
|
// GetLastBlockHeader returns the header of the most recent block.
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ import (
|
||||||
"net/url"
|
"net/url"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
coreerr "forge.lthn.ai/core/go-log"
|
coreerr "dappco.re/go/core/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Client is a Lethean daemon RPC client.
|
// Client is a Lethean daemon RPC client.
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ package rpc
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
coreerr "forge.lthn.ai/core/go-log"
|
coreerr "dappco.re/go/core/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
// GetInfo returns the daemon status.
|
// GetInfo returns the daemon status.
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ package rpc
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
coreerr "forge.lthn.ai/core/go-log"
|
coreerr "dappco.re/go/core/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
// SubmitBlock submits a mined block to the daemon.
|
// SubmitBlock submits a mined block to the daemon.
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ package rpc
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
coreerr "forge.lthn.ai/core/go-log"
|
coreerr "dappco.re/go/core/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
// GetTxDetails returns detailed information about a transaction.
|
// GetTxDetails returns detailed information about a transaction.
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ import (
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
coreerr "forge.lthn.ai/core/go-log"
|
coreerr "dappco.re/go/core/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
// RandomOutputEntry is a decoy output returned by getrandom_outs.
|
// RandomOutputEntry is a decoy output returned by getrandom_outs.
|
||||||
|
|
|
||||||
|
|
@ -14,12 +14,12 @@ import (
|
||||||
"net"
|
"net"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
coreerr "forge.lthn.ai/core/go-log"
|
coreerr "dappco.re/go/core/log"
|
||||||
|
|
||||||
"forge.lthn.ai/core/go-blockchain/chain"
|
"dappco.re/go/core/blockchain/chain"
|
||||||
"forge.lthn.ai/core/go-blockchain/config"
|
"dappco.re/go/core/blockchain/config"
|
||||||
"forge.lthn.ai/core/go-blockchain/p2p"
|
"dappco.re/go/core/blockchain/p2p"
|
||||||
levin "forge.lthn.ai/core/go-p2p/node/levin"
|
levin "dappco.re/go/core/p2p/node/levin"
|
||||||
)
|
)
|
||||||
|
|
||||||
func syncLoop(ctx context.Context, c *chain.Chain, cfg *config.ChainConfig, forks []config.HardFork, seed string) {
|
func syncLoop(ctx context.Context, c *chain.Chain, cfg *config.ChainConfig, forks []config.HardFork, seed string) {
|
||||||
|
|
|
||||||
|
|
@ -10,11 +10,11 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
cli "forge.lthn.ai/core/cli/pkg/cli"
|
cli "dappco.re/go/core/cli/pkg/cli"
|
||||||
tea "github.com/charmbracelet/bubbletea"
|
tea "github.com/charmbracelet/bubbletea"
|
||||||
|
|
||||||
"forge.lthn.ai/core/go-blockchain/chain"
|
"dappco.re/go/core/blockchain/chain"
|
||||||
"forge.lthn.ai/core/go-blockchain/types"
|
"dappco.re/go/core/blockchain/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Compile-time check: ExplorerModel implements cli.FrameModel.
|
// Compile-time check: ExplorerModel implements cli.FrameModel.
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ import (
|
||||||
|
|
||||||
tea "github.com/charmbracelet/bubbletea"
|
tea "github.com/charmbracelet/bubbletea"
|
||||||
|
|
||||||
cli "forge.lthn.ai/core/cli/pkg/cli"
|
cli "dappco.re/go/core/cli/pkg/cli"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Compile-time check: KeyHintsModel implements cli.FrameModel.
|
// Compile-time check: KeyHintsModel implements cli.FrameModel.
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ package tui
|
||||||
import (
|
import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"forge.lthn.ai/core/go-blockchain/types"
|
"dappco.re/go/core/blockchain/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
// NodeStatusMsg carries a periodic status snapshot from the Node goroutine
|
// NodeStatusMsg carries a periodic status snapshot from the Node goroutine
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ import (
|
||||||
|
|
||||||
tea "github.com/charmbracelet/bubbletea"
|
tea "github.com/charmbracelet/bubbletea"
|
||||||
|
|
||||||
"forge.lthn.ai/core/go-blockchain/chain"
|
"dappco.re/go/core/blockchain/chain"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Node wraps a [chain.Chain] and provides bubbletea commands for periodic
|
// Node wraps a [chain.Chain] and provides bubbletea commands for periodic
|
||||||
|
|
|
||||||
|
|
@ -9,11 +9,11 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
store "forge.lthn.ai/core/go-store"
|
store "dappco.re/go/core/store"
|
||||||
|
|
||||||
"forge.lthn.ai/core/go-blockchain/chain"
|
"dappco.re/go/core/blockchain/chain"
|
||||||
"forge.lthn.ai/core/go-blockchain/types"
|
"dappco.re/go/core/blockchain/types"
|
||||||
"forge.lthn.ai/core/go-blockchain/wire"
|
"dappco.re/go/core/blockchain/wire"
|
||||||
)
|
)
|
||||||
|
|
||||||
// testCoinbaseTx returns a minimal v1 coinbase transaction that round-trips
|
// testCoinbaseTx returns a minimal v1 coinbase transaction that round-trips
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ import (
|
||||||
|
|
||||||
tea "github.com/charmbracelet/bubbletea"
|
tea "github.com/charmbracelet/bubbletea"
|
||||||
|
|
||||||
cli "forge.lthn.ai/core/cli/pkg/cli"
|
cli "dappco.re/go/core/cli/pkg/cli"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Compile-time check: StatusModel implements cli.FrameModel.
|
// Compile-time check: StatusModel implements cli.FrameModel.
|
||||||
|
|
|
||||||
|
|
@ -13,11 +13,11 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"math/big"
|
"math/big"
|
||||||
|
|
||||||
coreerr "forge.lthn.ai/core/go-log"
|
coreerr "dappco.re/go/core/log"
|
||||||
|
|
||||||
"golang.org/x/crypto/sha3"
|
"golang.org/x/crypto/sha3"
|
||||||
|
|
||||||
"forge.lthn.ai/core/go-blockchain/config"
|
"dappco.re/go/core/blockchain/config"
|
||||||
)
|
)
|
||||||
|
|
||||||
// FlagAuditable marks an address as auditable. When set, the address was
|
// FlagAuditable marks an address as auditable. When set, the address was
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ package types
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"forge.lthn.ai/core/go-blockchain/config"
|
"dappco.re/go/core/blockchain/config"
|
||||||
)
|
)
|
||||||
|
|
||||||
// makeTestAddress creates an address with deterministic test data.
|
// makeTestAddress creates an address with deterministic test data.
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ import (
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
coreerr "forge.lthn.ai/core/go-log"
|
coreerr "dappco.re/go/core/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Hash is a 256-bit (32-byte) hash value, typically produced by Keccak-256.
|
// Hash is a 256-bit (32-byte) hash value, typically produced by Keccak-256.
|
||||||
|
|
|
||||||
|
|
@ -17,14 +17,14 @@ import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"io"
|
"io"
|
||||||
|
|
||||||
coreerr "forge.lthn.ai/core/go-log"
|
coreerr "dappco.re/go/core/log"
|
||||||
|
|
||||||
"golang.org/x/crypto/argon2"
|
"golang.org/x/crypto/argon2"
|
||||||
|
|
||||||
store "forge.lthn.ai/core/go-store"
|
store "dappco.re/go/core/store"
|
||||||
|
|
||||||
"forge.lthn.ai/core/go-blockchain/crypto"
|
"dappco.re/go/core/blockchain/crypto"
|
||||||
"forge.lthn.ai/core/go-blockchain/types"
|
"dappco.re/go/core/blockchain/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Store group and key for the encrypted account blob.
|
// Store group and key for the encrypted account blob.
|
||||||
|
|
|
||||||
|
|
@ -15,12 +15,12 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"slices"
|
"slices"
|
||||||
|
|
||||||
coreerr "forge.lthn.ai/core/go-log"
|
coreerr "dappco.re/go/core/log"
|
||||||
|
|
||||||
"forge.lthn.ai/core/go-blockchain/config"
|
"dappco.re/go/core/blockchain/config"
|
||||||
"forge.lthn.ai/core/go-blockchain/crypto"
|
"dappco.re/go/core/blockchain/crypto"
|
||||||
"forge.lthn.ai/core/go-blockchain/types"
|
"dappco.re/go/core/blockchain/types"
|
||||||
"forge.lthn.ai/core/go-blockchain/wire"
|
"dappco.re/go/core/blockchain/wire"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Destination is a recipient address and amount.
|
// Destination is a recipient address and amount.
|
||||||
|
|
|
||||||
|
|
@ -12,9 +12,9 @@ package wallet
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"forge.lthn.ai/core/go-blockchain/config"
|
"dappco.re/go/core/blockchain/config"
|
||||||
"forge.lthn.ai/core/go-blockchain/crypto"
|
"dappco.re/go/core/blockchain/crypto"
|
||||||
"forge.lthn.ai/core/go-blockchain/types"
|
"dappco.re/go/core/blockchain/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
// mockRingSelector returns fixed ring members for testing.
|
// mockRingSelector returns fixed ring members for testing.
|
||||||
|
|
|
||||||
|
|
@ -13,10 +13,10 @@ import (
|
||||||
"encoding/binary"
|
"encoding/binary"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
coreerr "forge.lthn.ai/core/go-log"
|
coreerr "dappco.re/go/core/log"
|
||||||
|
|
||||||
"forge.lthn.ai/core/go-blockchain/types"
|
"dappco.re/go/core/blockchain/types"
|
||||||
"forge.lthn.ai/core/go-blockchain/wire"
|
"dappco.re/go/core/blockchain/wire"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Extra field tag constants from the CryptoNote variant vector encoding.
|
// Extra field tag constants from the CryptoNote variant vector encoding.
|
||||||
|
|
|
||||||
|
|
@ -8,8 +8,8 @@ package wallet
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"forge.lthn.ai/core/go-blockchain/types"
|
"dappco.re/go/core/blockchain/types"
|
||||||
"forge.lthn.ai/core/go-blockchain/wire"
|
"dappco.re/go/core/blockchain/wire"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestParseTxExtraPublicKey(t *testing.T) {
|
func TestParseTxExtraPublicKey(t *testing.T) {
|
||||||
|
|
|
||||||
|
|
@ -14,9 +14,9 @@ package wallet
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
store "forge.lthn.ai/core/go-store"
|
store "dappco.re/go/core/store"
|
||||||
"forge.lthn.ai/core/go-blockchain/chain"
|
"dappco.re/go/core/blockchain/chain"
|
||||||
"forge.lthn.ai/core/go-blockchain/rpc"
|
"dappco.re/go/core/blockchain/rpc"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestWalletIntegration(t *testing.T) {
|
func TestWalletIntegration(t *testing.T) {
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue