cmd

package
v0.0.0-...-e1deddf Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2023 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const Confidence = 9

Variables

View Source
var ChainDisputeSetCmd = cli.Command{
	Name:  "disputer",
	Usage: "interact with the window post disputer",
	Flags: []cli.Flag{

		&cli.StringFlag{
			Name:  "from",
			Usage: "optionally specify the account to send messages from",
		},
	},
	Subcommands: []*cli.Command{
		disputerStartCmd,
	},
}
View Source
var RunCommand = cli.Command{
	Name:      "run",
	Aliases:   []string{"run"},
	Usage:     "start fil-data run service",
	UsageText: `fil-data run`,

	Action: func(cCtx *cli.Context) error {
		ctx := cCtx.Context

		var sm = &intern.ServiceManage{}
		pg_host := os.Getenv("PG_HOST")
		pg_port := os.Getenv("PG_PORT")
		pg_user := os.Getenv("PG_USER")
		pg_password := os.Getenv("PG_PASSWORD")
		pg_db := os.Getenv("PG_DBNAME")
		dsn := fmt.Sprintf("host=%s user=%s password=%s dbname=%s port=%s sslmode=disable TimeZone=Asia/Shanghai", pg_host, pg_user, pg_password, pg_db, pg_port)
		pd_db, err := initDatabase(dsn)
		if err != nil {
			return err
		}

		err = setupDatabase(pd_db)
		if err != nil {
			return err
		}

		sm.DB = pd_db

		return sm.ServeAPI(ctx)

	},
}

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