Files
chains/dexvm/plugin/main.go
T
zeekay 0d5bc75ef9 feat: move all VM implementations into chains/
VMs now live in ONE place: chains/<name>/ owns the full implementation.
Previously split across node/vms/<name>/ (impl) + chains/<name>/main.go
(plugin wrapper). Now consolidated.

New layout:
  chains/<name>vm/*.go              — package <name>vm (VM code)
  chains/<name>vm/cmd/plugin/main.go — package main (plugin binary)
  chains/<name>vm/go.mod             — module github.com/luxfi/chains/<name>vm

Moved 11 VMs: aivm, bridgevm, dexvm, graphvm, identityvm, keyvm,
oraclevm, quantumvm, relayvm, thresholdvm, zkvm.

External callers now import github.com/luxfi/chains/<name> directly.
2026-04-13 05:27:00 -07:00

38 lines
924 B
Go

//go:build grpc
// Copyright (C) 2019-2025, Lux Industries Inc. All rights reserved.
// See the file LICENSE for licensing terms.
package main
import (
"context"
"fmt"
"os"
"github.com/luxfi/log"
"github.com/luxfi/node/version"
"github.com/luxfi/chains/dexvm"
"github.com/luxfi/node/vms/rpcchainvm"
"github.com/luxfi/sys/ulimit"
)
func main() {
versionStr := fmt.Sprintf("DEX-VM/1.0.0 [node=%s, rpcchainvm=%d]", version.Current, version.RPCChainVMProtocol)
// Set file descriptor limit
if err := ulimit.Set(ulimit.DefaultFDLimit, log.Root()); err != nil {
fmt.Printf("failed to set fd limit: %s\n", err)
os.Exit(1)
}
// Create the DEX ChainVM (wrapper around functional VM)
vm := dexvm.NewChainVM(log.Root())
fmt.Printf("Starting %s\n", versionStr)
if err := rpcchainvm.Serve(context.Background(), log.Root(), vm); err != nil {
fmt.Printf("rpcchainvm.Serve error: %s\n", err)
os.Exit(1)
}
}