Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add HyperSDK Functionality to CLI #2369

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ avalanche network start

## Notable Features

- Creation of Subnet-EVM, and custom virtual machine subnet configurations
- Creation of Subnet-EVM
- Creation of HyperVMs and custom virtual machine subnet configurations
- Precompile integration and configuration
- Local deployment of L1s for development and rapid prototyping
- Fuji Testnet and Avalanche Mainnet deployment of L1s
Expand Down
79 changes: 70 additions & 9 deletions cmd/blockchaincmd/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"errors"
"fmt"
"os"
"os/exec"
"sort"
"strconv"
"strings"
Expand Down Expand Up @@ -38,6 +39,7 @@ const (

type CreateFlags struct {
useSubnetEvm bool
useHyperVM bool
useCustomVM bool
chainID uint64
tokenSymbol string
Expand All @@ -59,11 +61,12 @@ type CreateFlags struct {
}

var (
createFlags CreateFlags
forceCreate bool
genesisPath string
vmFile string
useRepo bool
createFlags CreateFlags
createGenesisFromBinary bool
forceCreate bool
genesisPath string
vmFile string
useRepo bool

errEmptyBlockchainName = errors.New("invalid empty name")
errIllegalNameCharacter = errors.New("illegal name character: only letters, no special characters allowed")
Expand Down Expand Up @@ -95,6 +98,7 @@ configuration, pass the -f flag.`,
}
cmd.Flags().StringVar(&genesisPath, "genesis", "", "file path of genesis to use")
cmd.Flags().BoolVar(&createFlags.useSubnetEvm, "evm", false, "use the Subnet-EVM as the base template")
cmd.Flags().BoolVar(&createFlags.useHyperVM, "hypervm", false, "use a HyperVM as the template")
cmd.Flags().BoolVar(&createFlags.useCustomVM, "custom", false, "use a custom VM template")
cmd.Flags().StringVar(&createFlags.vmVersion, "vm-version", "", "version of Subnet-EVM template to use")
cmd.Flags().BoolVar(&createFlags.useLatestPreReleasedVMVersion, preRelease, false, "use latest Subnet-EVM pre-released version, takes precedence over --vm-version")
Expand Down Expand Up @@ -202,7 +206,7 @@ func createBlockchainConfig(cmd *cobra.Command, args []string) error {
}

// vm type exclusiveness
if !flags.EnsureMutuallyExclusive([]bool{createFlags.useSubnetEvm, createFlags.useCustomVM}) {
if !flags.EnsureMutuallyExclusive([]bool{createFlags.useSubnetEvm, createFlags.useHyperVM, createFlags.useCustomVM}) {
return errors.New("flags --evm,--custom are mutually exclusive")
}

Expand All @@ -221,7 +225,7 @@ func createBlockchainConfig(cmd *cobra.Command, args []string) error {
}

// get vm kind
vmType, err := vm.PromptVMType(app, createFlags.useSubnetEvm, createFlags.useCustomVM)
vmType, err := vm.PromptVMType(app, createFlags.useSubnetEvm, createFlags.useHyperVM, createFlags.useCustomVM)
if err != nil {
return err
}
Expand Down Expand Up @@ -253,7 +257,8 @@ func createBlockchainConfig(cmd *cobra.Command, args []string) error {
}
}

if vmType == models.SubnetEvm {
switch vmType {
case models.SubnetEvm:
if sovereign {
// if validatorManagerOwner flag is used, we get the C Chain address of the key used
if createFlags.validatorManagerOwner != "" {
Expand Down Expand Up @@ -367,7 +372,55 @@ func createBlockchainConfig(cmd *cobra.Command, args []string) error {
); err != nil {
return err
}
} else {
case models.HyperVM:
if genesisPath == "" {
providePath := "I'll provide the genesis path"
binaryGen := "The VM binary will generate the genesis"
defaultGen := "Use the DefaultGenesis for my VM"
option, err := app.Prompt.CaptureList(
"How would you like to provide the genesis file?",
[]string{providePath, binaryGen, defaultGen},
)
if err != nil {
return err
}
switch option {
case providePath:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need to add another prompt to ask for path. better UX is to just ask user to provide path to genesis right away and use it after checking if file exists. So this case branch is not needed here and can be moved up to How would you like to provide the genesis file? prompt

genesisPath, err = app.Prompt.CaptureExistingFilepath("Enter path to custom genesis")
if err != nil {
return err
}
genesisBytes, err = os.ReadFile(genesisPath)
if err != nil {
return err
}
case binaryGen:
createGenesisFromBinary = true
case defaultGen:
gb, err := vm.CreateDefaultHyperSDKGenesis(app)
if err != nil {
return err
}
genesisBytes = gb
}
}
var tokenSymbol string
sc, err = vm.CreateCustomSidecar(
sc,
app,
blockchainName,
useRepo,
customVMRepoURL,
customVMBranch,
customVMBuildScript,
vmFile,
tokenSymbol,
sovereign,
)
if err != nil {
return err
}
default:
if genesisPath == "" {
genesisPath, err = app.Prompt.CaptureExistingFilepath("Enter path to custom genesis")
if err != nil {
Expand Down Expand Up @@ -428,6 +481,14 @@ func createBlockchainConfig(cmd *cobra.Command, args []string) error {
}
}

if createGenesisFromBinary {
output, err := exec.Command(sc.CustomVMBinaryPath, "genesis").Output()
if err != nil {
return err
}
genesisBytes = output
}

if err = app.WriteGenesisFile(blockchainName, genesisBytes); err != nil {
return err
}
Expand Down
4 changes: 3 additions & 1 deletion cmd/blockchaincmd/import_public.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ var (
blockchainIDstr string
nodeURL string
useSubnetEvm bool
useHyperVM bool
useCustomVM bool
)

Expand All @@ -52,6 +53,7 @@ flag.`,
cmd.Flags().StringVar(&nodeURL, "node-url", "", "[optional] URL of an already running subnet validator")

cmd.Flags().BoolVar(&useSubnetEvm, "evm", false, "import a subnet-evm")
cmd.Flags().BoolVar(&useHyperVM, "hypervm", false, "import a hypervm")
cmd.Flags().BoolVar(&useCustomVM, "custom", false, "use a custom VM template")
cmd.Flags().BoolVar(
&overwriteImport,
Expand Down Expand Up @@ -140,7 +142,7 @@ func importPublic(*cobra.Command, []string) error {
// TODO: it's probably possible to deploy VMs with the same name on a public network
// In this case, an import could clash because the tool supports unique names only

vmType, err := vm.PromptVMType(app, useSubnetEvm, useCustomVM)
vmType, err := vm.PromptVMType(app, useSubnetEvm, useHyperVM, useCustomVM)
if err != nil {
return err
}
Expand Down
6 changes: 6 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ require (
github.com/ava-labs/avalanchego v1.12.0-initial-poc.9.0.20241125192703-8c538e65af03
github.com/ava-labs/awm-relayer v1.4.1-0.20241126163322-f9c590e20b65
github.com/ava-labs/coreth v0.13.9-rc.1
github.com/ava-labs/hypersdk v0.0.18-0.20241122232249-bb043da89f7a
github.com/ava-labs/subnet-evm v0.6.12
github.com/aws/aws-sdk-go-v2 v1.32.5
github.com/aws/aws-sdk-go-v2/config v1.28.5
Expand Down Expand Up @@ -58,6 +59,7 @@ require (
cloud.google.com/go/auth/oauth2adapt v0.2.2 // indirect
cloud.google.com/go/compute/metadata v0.5.0 // indirect
dario.cat/mergo v1.0.0 // indirect
filippo.io/edwards25519 v1.0.0 // indirect
github.com/DataDog/zstd v1.5.2 // indirect
github.com/FactomProject/basen v0.0.0-20150613233007-fe3947df716e // indirect
github.com/FactomProject/btcutilecc v0.0.0-20130527213604-d3a63a5752ec // indirect
Expand Down Expand Up @@ -143,6 +145,7 @@ require (
github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/hdevalence/ed25519consensus v0.2.0 // indirect
github.com/holiman/billy v0.0.0-20240216141850-2abb0c79d3c4 // indirect
github.com/holiman/bloomfilter/v2 v2.0.3 // indirect
github.com/holiman/uint256 v1.2.4 // indirect
Expand All @@ -168,6 +171,7 @@ require (
github.com/mr-tron/base58 v1.2.0 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/nbutton23/zxcvbn-go v0.0.0-20210217022336-fa2cb2858354 // indirect
github.com/openzipkin/zipkin-go v0.4.1 // indirect
github.com/otiai10/copy v1.11.0 // indirect
github.com/pelletier/go-toml/v2 v2.2.2 // indirect
github.com/pires/go-proxyproto v0.6.2 // indirect
Expand Down Expand Up @@ -211,10 +215,12 @@ require (
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.22.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.22.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.22.0 // indirect
go.opentelemetry.io/otel/exporters/zipkin v1.11.2 // indirect
go.opentelemetry.io/otel/metric v1.24.0 // indirect
go.opentelemetry.io/otel/sdk v1.24.0 // indirect
go.opentelemetry.io/otel/trace v1.24.0 // indirect
go.opentelemetry.io/proto/otlp v1.0.0 // indirect
go.uber.org/atomic v1.11.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/sys v0.27.0 // indirect
golang.org/x/term v0.26.0 // indirect
Expand Down
20 changes: 18 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ collectd.org v0.3.0/go.mod h1:A/8DzQBkF6abtvrT2j/AU/4tiBgJWYyh0y/oB/4MlWE=
dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk=
dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek=
filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns=
github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8=
github.com/Azure/azure-pipeline-go v0.2.1/go.mod h1:UGSo8XybXnIGZ3epmeBw7Jdz+HiUVpqIlpz/HKHylF4=
github.com/Azure/azure-pipeline-go v0.2.2/go.mod h1:4rQ/NZncSvGqNkkOsNpOU1tgoNuIlp9AfUH5G1tvCHc=
Expand Down Expand Up @@ -91,6 +93,8 @@ github.com/ava-labs/awm-relayer v1.4.1-0.20241126163322-f9c590e20b65 h1:0/tUtrvR
github.com/ava-labs/awm-relayer v1.4.1-0.20241126163322-f9c590e20b65/go.mod h1:gW5X5k2CspCKo+1yKVhFLriK2pl80hLjheF1521aIqs=
github.com/ava-labs/coreth v0.13.9-rc.1 h1:qIICpC/OZGYUP37QnLgIqqwGmxnLwLpZaUlqJNI85vU=
github.com/ava-labs/coreth v0.13.9-rc.1/go.mod h1:7aMsRIo/3GBE44qWZMjnfqdqfcfZ5yShTTm2LObLaYo=
github.com/ava-labs/hypersdk v0.0.18-0.20241122232249-bb043da89f7a h1:QhjkEu9nmc6sP4DuvF7vcUFepS2P1NAaySGzKJ0k3WI=
github.com/ava-labs/hypersdk v0.0.18-0.20241122232249-bb043da89f7a/go.mod h1:jossurv8TsQZ6yXDHRnawOllPaVjro9S7OUSO5U149U=
github.com/ava-labs/ledger-avalanche/go v0.0.0-20241009183145-e6f90a8a1a60 h1:EL66gtXOAwR/4KYBjOV03LTWgkEXvLePribLlJNu4g0=
github.com/ava-labs/ledger-avalanche/go v0.0.0-20241009183145-e6f90a8a1a60/go.mod h1:/7qKobTfbzBu7eSTVaXMTr56yTYk4j2Px6/8G+idxHo=
github.com/ava-labs/subnet-evm v0.6.12 h1:jL3FmjdFcNfS0qwbehwN6DkAg9y7zexB1riiGBxRsM0=
Expand Down Expand Up @@ -491,6 +495,8 @@ github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs
github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM=
github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
github.com/hdevalence/ed25519consensus v0.2.0 h1:37ICyZqdyj0lAZ8P4D1d1id3HqbbG1N3iBb1Tb4rdcU=
github.com/hdevalence/ed25519consensus v0.2.0/go.mod h1:w3BHWjwJbFU29IRHL1Iqkw3sus+7FctEyM4RqDxYNzo=
github.com/holiman/billy v0.0.0-20240216141850-2abb0c79d3c4 h1:X4egAf/gcS1zATw6wn4Ej8vjuVGxeHdan+bRb2ebyv4=
github.com/holiman/billy v0.0.0-20240216141850-2abb0c79d3c4/go.mod h1:5GuXa7vkL8u9FkFuWdVvfR5ix8hRB7DbOAaYULamFpc=
github.com/holiman/bloomfilter/v2 v2.0.3 h1:73e0e/V0tCydx14a0SCYS/EWCxgwLZ18CZcZKVu0fao=
Expand Down Expand Up @@ -667,9 +673,13 @@ github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxzi
github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c=
github.com/nbutton23/zxcvbn-go v0.0.0-20210217022336-fa2cb2858354 h1:4kuARK6Y6FxaNu/BnU2OAaLF86eTVhP2hjTB6iMvItA=
github.com/nbutton23/zxcvbn-go v0.0.0-20210217022336-fa2cb2858354/go.mod h1:KSVJerMDfblTH7p5MZaTt+8zaT2iEk3AkVb9PQdZuE8=
github.com/neilotoole/errgroup v0.1.6 h1:PODGqPXdT5BC/zCYIMoTrwV+ujKcW+gBXM6Ye9Ve3R8=
github.com/neilotoole/errgroup v0.1.6/go.mod h1:Q2nLGf+594h0CLBs/Mbg6qOr7GtqDK7C2S41udRnToE=
github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=
github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU=
github.com/oasisprotocol/curve25519-voi v0.0.0-20230110094441-db37f07504ce h1:/pEpMk55wH0X+E5zedGEMOdLuWmV8P4+4W3+LZaM6kg=
github.com/oasisprotocol/curve25519-voi v0.0.0-20230110094441-db37f07504ce/go.mod h1:hVoHR2EVESiICEMbg137etN/Lx+lSrHPTD39Z/uE+2s=
github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U=
github.com/okteto/remote v0.0.0-20210428052247-99de42c04148 h1:urr6T7QLPi0DFHFCJvX1JFLu8QgGRD8MFaQBv1UC7sM=
github.com/okteto/remote v0.0.0-20210428052247-99de42c04148/go.mod h1:aRwo2ZLFsZWAFnIQGdk7ReXeMNk0+n0nDANPZK3Kmm8=
Expand Down Expand Up @@ -697,6 +707,8 @@ github.com/onsi/gomega v1.35.1/go.mod h1:PvZbdDc8J6XJEpDK4HCuRBm8a6Fzp9/DmhC9C7y
github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o=
github.com/opentracing/opentracing-go v1.0.3-0.20180606204148-bd9c31933947/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o=
github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o=
github.com/openzipkin/zipkin-go v0.4.1 h1:kNd/ST2yLLWhaWrkgchya40TJabe8Hioj9udfPcEO5A=
github.com/openzipkin/zipkin-go v0.4.1/go.mod h1:qY0VqDSN1pOBN94dBc6w2GJlWLiovAyg7Qt6/I9HecM=
github.com/otiai10/copy v1.11.0 h1:OKBD80J/mLBrwnzXqGtFCzprFSGioo30JcmR4APsNwc=
github.com/otiai10/copy v1.11.0/go.mod h1:rSaLseMUsZFFbsFGc7wCJnnkTAvdc5L6VWxPE4308Ww=
github.com/otiai10/mint v1.5.1 h1:XaPLeE+9vGbuyEHem1JNk3bYc7KKqyI/na0/mLd/Kks=
Expand Down Expand Up @@ -848,8 +860,8 @@ github.com/syndtr/goleveldb v1.0.1-0.20210305035536-64b5b1c73954/go.mod h1:u2MKk
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc=
github.com/syndtr/goleveldb v1.0.1-0.20220614013038-64ee5596c38a h1:1ur3QoCqvE5fl+nylMaIr9PVV1w343YRDtsy+Rwu7XI=
github.com/syndtr/goleveldb v1.0.1-0.20220614013038-64ee5596c38a/go.mod h1:RRCYJbIwD5jmqPI9XoAFR0OcDxqUctll6zUj/+B4S48=
github.com/thepudds/fzgen v0.4.2 h1:HlEHl5hk2/cqEomf2uK5SA/FeJc12s/vIHmOG+FbACw=
github.com/thepudds/fzgen v0.4.2/go.mod h1:kHCWdsv5tdnt32NIHYDdgq083m6bMtaY0M+ipiO9xWE=
github.com/thepudds/fzgen v0.4.3 h1:srUP/34BulQaEwPP/uHZkdjUcUjIzL7Jkf4CBVryiP8=
github.com/thepudds/fzgen v0.4.3/go.mod h1:BhhwtRhzgvLWAjjcHDJ9pEiLD2Z9hrVIFjBCHJ//zJ4=
github.com/tinylib/msgp v1.0.2/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE=
github.com/tklauser/go-sysconf v0.3.5/go.mod h1:MkWzOF4RMCshBAMXuhXJs64Rte09mITnppBXY/rYEFI=
github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU=
Expand Down Expand Up @@ -914,6 +926,8 @@ go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.22.0 h1:H2JFg
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.22.0/go.mod h1:WfCWp1bGoYK8MeULtI15MmQVczfR+bFkk0DF3h06QmQ=
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.22.0 h1:FyjCyI9jVEfqhUh2MoSkmolPjfh5fp2hnV0b0irxH4Q=
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.22.0/go.mod h1:hYwym2nDEeZfG/motx0p7L7J1N1vyzIThemQsb4g2qY=
go.opentelemetry.io/otel/exporters/zipkin v1.11.2 h1:wGdWn04d1sEnxfO4TUF/UcQfEIu80IvqUXU1lENKyFg=
go.opentelemetry.io/otel/exporters/zipkin v1.11.2/go.mod h1:I60/FdYilVKkuDOzenyp8LqJLryRC/Mr918G5hchvkM=
go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI=
go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco=
go.opentelemetry.io/otel/sdk v1.24.0 h1:YMPPDNymmQN3ZgczicBY3B6sf9n62Dlj9pWD3ucgoDw=
Expand All @@ -923,6 +937,8 @@ go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw
go.opentelemetry.io/proto/otlp v1.0.0 h1:T0TX0tmXU8a3CbNXzEKGeU5mIVOdf0oykP+u2lIVU/I=
go.opentelemetry.io/proto/otlp v1.0.0/go.mod h1:Sy6pihPLfYHkr3NkUbEhGHFhINUSI/v80hjKIs5JXpM=
go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE=
go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
go.uber.org/mock v0.5.0 h1:KAMbZvZPyBPWgD14IrIQ38QCyjwpvVVV6K/bHl1IwQU=
Expand Down
1 change: 1 addition & 0 deletions pkg/models/sidecar.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ type Sidecar struct {
Networks map[string]NetworkData
ImportedFromAPM bool
ImportedVMID string
CustomVMBinaryPath string
CustomVMRepoURL string
CustomVMBranch string
CustomVMBuildScript string
Expand Down
12 changes: 6 additions & 6 deletions pkg/models/vm.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import "github.com/ava-labs/avalanche-cli/pkg/constants"
type VMType string

const (
SubnetEvm = "Subnet-EVM"
BlobVM = "Blob VM"
TimestampVM = "Timestamp VM"
CustomVM = "Custom"
SubnetEvm = "Subnet-EVM"
BlobVM = "Blob VM"
HyperVM = "HyperVM"
CustomVM = "Custom"
)

func VMTypeFromString(s string) VMType {
Expand All @@ -19,8 +19,8 @@ func VMTypeFromString(s string) VMType {
return SubnetEvm
case BlobVM:
return BlobVM
case TimestampVM:
return TimestampVM
case HyperVM:
return HyperVM
default:
return CustomVM
}
Expand Down
1 change: 1 addition & 0 deletions pkg/vm/create_custom.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ func CreateCustomSidecar(
if err != nil {
return nil, err
}
sc.CustomVMBinaryPath = vmPath
}
}
if useRepo {
Expand Down
Loading
Loading