admin

package
v1.0.0-RC2 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2026 License: Apache-2.0, MIT Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var InitCmd = &cli.Command{
	Name:  "init",
	Usage: "Initialize or upgrade the database",
	Flags: []cli.Flag{
		&cli.StringFlag{
			Name:  "identity",
			Usage: "Name of the user or service that is running the Singularity for tracking and logging purpose",
		},
	},
	Description: "This command needs to be run before running any singularity daemon or after any version upgrade",
	Action: func(c *cli.Context) error {
		db, closer, err := database.OpenFromCLI(c)
		if err != nil {
			return errors.WithStack(err)
		}
		defer closer.Close()
		err = admin.Default.InitHandler(c.Context, db)
		if err != nil {
			return errors.WithStack(err)
		}
		if n := wallet.CountLegacyKeys(db); n > 0 {
			return errors.Errorf(
				"%d actor(s) have private keys in the database that are not usable by current code.\n"+
					"Run 'singularity wallet export-keys' to migrate them to the filesystem keystore",
				n)
		}
		if c.IsSet("identity") {
			err = admin.Default.SetIdentityHandler(c.Context, db, admin.SetIdentityRequest{
				Identity: c.String("identity"),
			})
			if err != nil {
				return errors.WithStack(err)
			}
		}
		return nil
	},
}
View Source
var ResetCmd = &cli.Command{
	Name:  "reset",
	Usage: "Reset the database",
	Flags: []cli.Flag{cliutil.ReallyDotItFlag},
	Action: func(c *cli.Context) error {
		if err := cliutil.HandleReallyDoIt(c); err != nil {
			return errors.WithStack(err)
		}
		db, closer, err := database.OpenFromCLI(c)
		if err != nil {
			return errors.WithStack(err)
		}
		defer closer.Close()
		return admin.Default.ResetHandler(c.Context, db)
	},
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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