github.com/MetalBlockchain/metalgo@v1.11.9/vms/example/xsvm/cmd/run/cmd.go (about)

     1  // Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved.
     2  // See the file LICENSE for licensing terms.
     3  
     4  package run
     5  
     6  import (
     7  	"context"
     8  
     9  	"github.com/spf13/cobra"
    10  
    11  	"github.com/MetalBlockchain/metalgo/vms/example/xsvm"
    12  	"github.com/MetalBlockchain/metalgo/vms/rpcchainvm"
    13  )
    14  
    15  func Command() *cobra.Command {
    16  	return &cobra.Command{
    17  		Use:   "xsvm",
    18  		Short: "Runs an XSVM plugin",
    19  		RunE:  runFunc,
    20  	}
    21  }
    22  
    23  func runFunc(*cobra.Command, []string) error {
    24  	return rpcchainvm.Serve(context.Background(), &xsvm.VM{})
    25  }