mirror of
https://github.com/luxfi/lpm.git
synced 2026-10-30 16:20:57 +00:00
The on-disk plugin manifest format wraps every definition in a single
top-level key (`vm:` for VMs, `subnet:` for chains). The previous
yaml.Unmarshal into a bare T silently returned a zero-valued definition
when the wrapper was present (every shipped manifest), causing
`install-vm cevm-darwin-arm64` to crash on a nil URL.
Add decodeWrapped[T] that:
- parses to yaml.Node
- asserts a single top-level mapping containing the expected key
- unmarshals only the value below that key into T
Unwrapped manifests are now rejected with a clear error rather than
producing a silent zero T.
Tests cover wrapped vm, wrapped chain, missing-key rejection, and
empty-input rejection. CI-PREMORTEM.md §12a in luxcpp/cevm has the
full root-cause writeup.
Also:
- .gitignore: ignore bin/ (was leaking 15M lpm builds into git status)
- LLM.md: directory layout reflects reality (main/main.go, not cmd/lpm/),
document on-disk wrapper format and the chains/ vs subnets/ rename
1.5 KiB
1.5 KiB
lpm
Overview
Note: This code is currently in Alpha. Proceed at your own risk. lpm is a command-line tool to manage virtual machines binaries for
Package Information
- Type: go
- Module: github.com/luxfi/lpm
- Repository: github.com/luxfi/lpm
Directory Structure
.
admin
cmd
config
docs
docs/.next
docs/.source
docs/components
docs/out
internal
internal/vmid
main # main package — entry point (NOT cmd/lpm/)
state
types
util
workflow
Key Files
- go.mod
- main/main.go # binary entry point:
go build -o bin/lpm ./main
On-disk Manifest Format
Plugin definitions are YAML files under a repository checkout:
vms/<name>.yaml— wrapped under top-levelvm:keychains/<name>.yaml— wrapped under top-levelsubnet:key (legacy wrapper key kept for backwards-compat with shipped manifests; the on-disk directory moved fromsubnets/tochains/in plugins-core v0.1.3)
state/repository.go enforces the wrapper. Unwrapped manifests are
rejected (was: silently zero-valued T returned, leading to install-vm
crashes — see CI-PREMORTEM.md §12a in luxcpp/cevm).
Development
Prerequisites
- Go 1.21+
Build
go build -o bin/lpm ./main
Test
go test -v ./...
Integration with Lux Ecosystem
This package is part of the Lux blockchain ecosystem. See the main documentation at:
- GitHub: https://github.com/luxfi
- Docs: https://docs.lux.network
Auto-generated for AI assistants. Last updated: 2025-12-24