Files
zeekay 579f53c3cc chore: remove local replace directives and update dependencies
- Update github.com/luxfi/netrunner v1.15.3 → v1.15.4
- Update github.com/luxfi/node v1.22.77 → v1.22.80
- Remove local replace directive for netrunner
- Use published package versions for reproducible builds
2026-01-03 07:09:01 -08:00

41 lines
1.1 KiB
Go

// Copyright (C) 2022-2025, Lux Industries Inc. All rights reserved.
// See the file LICENSE for licensing terms.
package binutils
import (
"fmt"
"github.com/luxfi/cli/pkg/application"
"github.com/luxfi/sdk/models"
)
// UpgradeVM upgrades a VM binary to the specified version.
func UpgradeVM(app *application.Lux, vmID string, vmBinPath string) error {
installer := NewPluginBinaryDownloader(app)
if err := installer.UpgradeVM(vmID, vmBinPath); err != nil {
return fmt.Errorf("failed to upgrade vm: %w", err)
}
return nil
}
// UpdateLocalSidecarRPC updates the RPC version of the VM in the sidecar file.
func UpdateLocalSidecarRPC(app *application.Lux, sc models.Sidecar, rpcVersion int) error {
// find local network deployment info in sidecar
networkData, ok := sc.Networks[models.Local.String()]
if !ok {
return fmt.Errorf("failed to find local network in sidecar")
}
networkData.RPCVersion = rpcVersion
sc.Networks[models.Local.String()] = networkData
if err := app.UpdateSidecar(&sc); err != nil {
return fmt.Errorf("failed to update sidecar: %w", err)
}
return nil
}