mirror of
https://github.com/luxfi/chains.git
synced 2026-09-24 00:26:00 +00:00
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.
38 lines
839 B
Go
38 lines
839 B
Go
// Copyright (C) 2019-2025, Lux Industries Inc. All rights reserved.
|
|
// See the file LICENSE for licensing terms.
|
|
|
|
package quantumvm
|
|
|
|
import (
|
|
"github.com/luxfi/ids"
|
|
"github.com/luxfi/log"
|
|
"github.com/luxfi/node/vms"
|
|
"github.com/luxfi/chains/quantumvm/config"
|
|
)
|
|
|
|
var _ vms.Factory = (*Factory)(nil)
|
|
|
|
// VMID is the unique identifier for QuantumVM (Q-Chain)
|
|
var VMID = ids.ID{'q', 'u', 'a', 'n', 't', 'u', 'm', 'v', 'm'}
|
|
|
|
// Factory implements vms.Factory interface for creating QVM instances
|
|
type Factory struct {
|
|
config.Config
|
|
}
|
|
|
|
// New creates a new QVM instance
|
|
func (f *Factory) New(logger log.Logger) (interface{}, error) {
|
|
// Validate configuration
|
|
if err := f.Config.Validate(); err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
// Create and return new QVM instance
|
|
vm := &VM{
|
|
Config: f.Config,
|
|
log: logger,
|
|
}
|
|
|
|
return vm, nil
|
|
}
|