Files
dex/cmd/dchain/main.go
zeekay 9d772137fe dex: standalone D-Chain VM (pkg/dchain) + persist + venue cmd/dchain
block.ChainVM on luxfi/consensus via luxfi/vm/rpc.Serve: matcher-at-Verify on a versiondb
overlay -> zapdb commit at Accept; book rebuilt from order:* rows on restart (byte-identical).
pkg/lx/persist.go = DEXOrder<->OrderBook bridge (Q64.64 fixed-point rows, never float).
execution_root reuses xvm crypto/merkle RFC-6962. clob_* handlers return consensus-computed
fills (txID idempotency). cmd/dchain (//go:build dchain&&cgo) boots via rpc.Serve. VM tests +
localnet venue e2e (seed->cross->settle->restart->re-cross) green; race-clean.
2026-06-17 17:12:22 -07:00

30 lines
1.0 KiB
Go

// Copyright (C) 2019-2025, Lux Industries Inc. All rights reserved.
// See the file LICENSE for licensing terms.
//go:build dchain && cgo
// +build dchain,cgo
// Command dchain is the standalone D-Chain DEX VM plugin binary. It is the
// venue entrypoint: a ZAP plugin process the Lux node launches (like the EVM
// plugin), running the lx.OrderBook matcher inside consensus and persisting the
// authoritative order book to its own zapdb. Built under //go:build dchain &&
// cgo so it links the cgo/GPU matching accelerator; CI builds it per org+arch.
//
// The testable VM logic (pkg/dchain) is pure-Go and proven without this binary;
// this file only wires the proven VM into the rpc.Serve plugin harness.
package main
import (
"fmt"
"github.com/luxfi/dex/cmd/dchain/runner"
"github.com/luxfi/dex/pkg/dchain"
"github.com/luxfi/version"
)
func main() {
versionString := fmt.Sprintf("Lux-DChain/%s [node=%s, rpcchainvm=%d]",
dchain.Version, version.Current, version.RPCChainVMProtocol)
runner.Run(versionString)
}