guidedsetup

package
v1.23.0 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2024 License: Apache-2.0, MIT Imports: 49 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 CONFIDENCE = 5
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 EnvFiles = []string{"/etc/curio.env", "./curio/curio.env", "~/config/curio.env"}
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
	},
}
View Source
var StorageMiner storageMiner

Functions

func MigrateSectors

func MigrateSectors(ctx context.Context, maddr address.Address, mmeta datastore.Batching, db *harmonydb.DB, logMig func(int), unmigSectorShouldFail func() bool) error

func SaveConfigToLayerMigrateSectors

func SaveConfigToLayerMigrateSectors(minerRepoPath, chainApiInfo string, unmigSectorShouldFail func() bool) (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
	DB              *harmonydb.DB
	HarmonyCfg      config.HarmonyDB
	MinerID         address.Address
	// contains filtered or unexported fields
}

type SectorInfo added in v1.23.0

type SectorInfo struct {
	State        sector.SectorState
	SectorNumber abi.SectorNumber

	SectorType abi.RegisteredSealProof

	// Packing
	CreationTime int64 // unix seconds
	Pieces       []sector.SafeSectorPiece

	// PreCommit1
	TicketValue   abi.SealRandomness
	TicketEpoch   abi.ChainEpoch
	PreCommit1Out storiface.PreCommit1Out

	PreCommit1Fails uint64

	// PreCommit2
	CommD *cid.Cid
	CommR *cid.Cid // SectorKey
	Proof []byte

	PreCommitDeposit big.Int
	PreCommitMessage *cid.Cid
	PreCommitTipSet  types.TipSetKey

	PreCommit2Fails uint64

	// WaitSeed
	SeedValue abi.InteractiveSealRandomness
	SeedEpoch abi.ChainEpoch

	// Committing
	CommitMessage *cid.Cid
	InvalidProofs uint64 // failed proof computations (doesn't validate with proof inputs; can't compute)

	// CCUpdate
	CCUpdate             bool
	UpdateSealed         *cid.Cid
	UpdateUnsealed       *cid.Cid
	ReplicaUpdateProof   storiface.ReplicaUpdateProof
	ReplicaUpdateMessage *cid.Cid

	// Faults
	FaultReportMsg *cid.Cid

	// Termination
	TerminateMessage *cid.Cid
	TerminatedAt     abi.ChainEpoch

	// Remote import
	RemoteDataUnsealed        *storiface.SectorLocation
	RemoteDataSealed          *storiface.SectorLocation
	RemoteDataCache           *storiface.SectorLocation
	RemoteCommit1Endpoint     string
	RemoteCommit2Endpoint     string
	RemoteSealingDoneEndpoint string
	RemoteDataFinalized       bool

	// Debug
	LastErr string
}

func (*SectorInfo) MarshalCBOR added in v1.23.0

func (t *SectorInfo) MarshalCBOR(w io.Writer) error

func (*SectorInfo) UnmarshalCBOR added in v1.23.0

func (t *SectorInfo) UnmarshalCBOR(r io.Reader) (err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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