guidedsetup

package
v1.27.0-rc3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 17, 2024 License: Apache-2.0, MIT Imports: 43 Imported by: 0

Documentation

Overview

guidedSetup for migration from lotus-miner to Curio

IF STRINGS CHANGED {
		follow instructions at ../internal/translations/translations.go
}

Index

Constants

View Source
const DeveloperFocusRequestURL = "https://curiostorage.org/cgi-bin/savedata.php"

URL to upload user-selected fields to help direct developer's focus.

View Source
const (
	FlagMinerRepo = "miner-repo"
)
View Source
const FlagMinerRepoDeprecation = "storagerepo"

Variables

View Source
var GuidedsetupCmd = &cli.Command{
	Name:  "guided-setup",
	Usage: "Run the guided setup for migrating from lotus-miner to Curio or Creating a new Curio miner",
	Flags: []cli.Flag{
		&cli.StringFlag{
			Name:    "repo",
			EnvVars: []string{"LOTUS_PATH"},
			Hidden:  true,
			Value:   "~/.lotus",
		},
	},
	Action: func(cctx *cli.Context) (err error) {
		T, say := SetupLanguage()
		setupCtrlC(say)

		migrationData := MigrationData{
			T:   T,
			say: say,
			selectTemplates: &promptui.SelectTemplates{
				Help: T("Use the arrow keys to navigate: ↓ ↑ → ← "),
			},
			cctx: cctx,
			ctx:  cctx.Context,
		}

		newOrMigrate(&migrationData)
		if migrationData.init {
			say(header, "This interactive tool creates a new miner actor and creates the basic configuration layer for it.")
			say(notice, "This process is partially idempotent. Once a new miner actor has been created and subsequent steps fail, the user need to run 'curio config new-cluster < miner ID >' to finish the configuration.")
			for _, step := range newMinerSteps {
				step(&migrationData)
			}
		} else {
			say(header, "This interactive tool migrates lotus-miner to Curio in 5 minutes.")
			say(notice, "Each step needs your confirmation and can be reversed. Press Ctrl+C to exit at any time.")

			for _, step := range migrationSteps {
				step(&migrationData)
			}
		}

		for _, closer := range migrationData.closers {
			closer()
		}
		return nil
	},
}

Functions

func SaveConfigToLayer

func SaveConfigToLayer(minerRepoPath, chainApiInfo string) (minerAddress address.Address, err error)

func SetupLanguage

func SetupLanguage() (func(key message.Reference, a ...interface{}) string, func(style lipgloss.Style, key message.Reference, a ...interface{}))

Types

type MigrationData

type MigrationData struct {
	T func(key message.Reference, a ...interface{}) string

	MinerConfigPath string
	MinerConfig     *config.StorageMiner
	DB              *harmonydb.DB
	MinerID         address.Address
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL