Files
cli/pkg/vm/createCustomSidecar.go
zeekay fb10b910c4 docs: replace subnet terminology with L2/chain
Update user-facing strings, CLI help text, error messages, README,
and documentation to use "chain" or "L2" instead of "subnet".
Preserves Go variable names, import paths, struct fields, and
GCP networking subnet references.
2026-03-02 10:53:28 -07:00

35 lines
736 B
Go

// Copyright (C) 2022-2025, Lux Industries Inc. All rights reserved.
// See the file LICENSE for licensing terms.
package vm
import (
"github.com/luxfi/cli/pkg/application"
"github.com/luxfi/sdk/models"
)
// CreateCustomSidecar creates a sidecar for custom VMs
func CreateCustomSidecar(
sc *models.Sidecar,
app *application.Lux,
blockchainName string,
vmVersion string,
) (*models.Sidecar, error) {
// If sc is nil, create a new sidecar
if sc == nil {
sc = &models.Sidecar{
Version: "1.0.0",
}
}
// Always set Name and Chain from blockchainName
sc.Name = blockchainName
sc.Chain = blockchainName
// Update sidecar with custom VM information
sc.VM = models.CustomVM
sc.VMVersion = vmVersion
return sc, nil
}