Vistara
  • πŸ‘‹Welcome to Vistara
  • Overview
    • What is Vistara?
    • Vision for Vistara
    • Vistara Network
  • πŸ›°οΈVistara Components
    • What is Hypercore?
      • The Decentralized Hypervisor
    • What is Vimana?
      • API Reference
    • What are Spacecores?
  • πŸ“–Guides
    • Getting Started
    • Building a Spacecore
    • Confidentiality and Verifiability
      • Decentralized approaches
      • What can you do with Vistara?
      • How do we implement it?
  • Blueprints
    • EigenLayer AVSOps
    • Secure Enclaves
    • Open Compute for Morpheus
    • AI Inference Service
  • πŸ‘©β€πŸ’»Getting Involved
    • Contribute to Vistara
    • Community & Support
    • Ecosystem Collaborators
    • πŸ—ΊοΈOpportunities in Vistara
  • πŸŽ“Learn
    • The Decentralized Paradigm
    • Virtualization Demystified
    • Building Consensus
Powered by GitBook
On this page
  1. Guides

Building a Spacecore

Adding a new space core to the Vimana CLI

Estimated time to complete this guide: <30 minutes

  1. Add the configuration to config.toml. e.g.

[components]
[components.dymension]

[components.dymension.full]
binary = "/tmp/vimana/dymension/dymd"
download = "/tmp/vimana/dymension/init.sh"
  1. Implement the NodeCommander interface for that component and mode.

e.g.

type DymensionFullCommander struct {
  *BaseCommander
}

func NewDymensionFullCommander() *DymensionFullCommander {
	return &DymensionFullCommander{
		BaseCommander: BaseCommander{NodeType: "full"},
	}
}

func (c *DymensionFullCommander) Init(cmd *cobra.Command, args []string, mode Mode) error {
	utils.ExecBashCmd(exec.Command("bash", mode.Download), utils.WithOutputToStdout(), utils.WithErrorsToStderr())
	c.initComponentManager(mode.Binary)
	return c.componentMgr.InitializeConfig()
}

func (c *DymensionFullCommander) Run(cmd *cobra.Command, args []string, mode Mode) {
	c.Init(cmd, args, mode)
	cmdexecute := c.componentMgr.GetStartCmd()
	utils.ExecBashCmd(cmdexecute, utils.WithOutputToStdout(), utils.WithErrorsToStderr())
}
  1. Update initComponentManager() and NewComponentManager() to support the new component.

e.g.

func (c *BaseCommander) initComponentManager(binary string) {
	if b.componentMgr == nil {
		b.componentMgr = components.NewComponentManager("dymension", binary, b.NodeType)
	}
}
// In NewComponentManager():
	case config.Celestia:
		component = NewDymensionComponent(root, ".vimana/dymension", nodeType)
  1. Implement NewDymensionComponent and it's methods InitializeConfig() and GetStartCmd().

e.g.

// implement how to initialize dymd
// implement the start command for dymd
  1. Register their implementation in the commanderRegistry.

e.g.

commanderRegistry.Register("dymension", "full", &DymensionFullCommander{})
	"celestia-light":  cli.NewCelestiaLightCommander(),
  1. Add the component to the README.md.

PreviousGetting StartedNextConfidentiality and Verifiability

Last updated 11 months ago

πŸ“–