ddcommon

package
v0.0.0-...-374a407 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2021 License: Apache-2.0, MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const FilDefaultLookback = 10
View Source
const FilGenesisUnix = 1598306400

Variables

View Source
var (
	LotusAPI *lotusapi.FullNodeStruct
	Db       *pgxpool.Pool

	PromURL  string
	PromUser string
	PromPass string
)

singletons populated on start

View Source
var CliFlags = []cli.Flag{
	altsrc.NewStringFlag(&cli.StringFlag{
		Name:  "webapi-listen-address",
		Value: "localhost:8080",
	}),
	altsrc.NewStringFlag(&cli.StringFlag{
		Name:  "lotus-api",
		Value: "http://localhost:1234",
	}),
	altsrc.NewStringFlag(&cli.StringFlag{
		Name:        "lotus-api-token",
		DefaultText: "  {{ private, read from config file }}  ",
	}),
	&cli.UintFlag{
		Name:  "lotus-lookback-epochs",
		Value: FilDefaultLookback,
		DefaultText: fmt.Sprintf("%d epochs / %ds",
			FilDefaultLookback,
			filactors.EpochDurationSeconds*FilDefaultLookback,
		),
		Destination: &lotusLookbackEpochs,
	},
	altsrc.NewStringFlag(&cli.StringFlag{
		Name:  "discover-pg-connstring",
		Value: "postgres:///postgres?user=discover&password=&host=/var/run/postgresql",
	}),
	altsrc.NewStringFlag(&cli.StringFlag{
		Name:        "manifests_s3_region",
		DefaultText: "  {{ private, read from config file }}  ",
		Hidden:      true,
	}),
	altsrc.NewStringFlag(&cli.StringFlag{
		Name:        "manifests_s3_bucket",
		DefaultText: "  {{ private, read from config file }}  ",
		Hidden:      true,
	}),
	altsrc.NewStringFlag(&cli.StringFlag{
		Name:        "prometheus_push_url",
		DefaultText: "  {{ private, read from config file }}  ",
		Hidden:      true,
		Destination: &PromURL,
	}),
	altsrc.NewStringFlag(&cli.StringFlag{
		Name:        "prometheus_push_user",
		DefaultText: "  {{ private, read from config file }}  ",
		Hidden:      true,
		Destination: &PromUser,
	}),
	altsrc.NewStringFlag(&cli.StringFlag{
		Name:        "prometheus_push_pass",
		DefaultText: "  {{ private, read from config file }}  ",
		Hidden:      true,
		Destination: &PromPass,
	}),
}
View Source
var IsTerm = isatty.IsTerminal(os.Stderr.Fd())

Functions

func CidV1

func CidV1(c cid.Cid) cid.Cid

func CliBeforeSetup

func CliBeforeSetup(cctx *cli.Context) error

func LotusLookbackTipset

func LotusLookbackTipset(ctx context.Context) (*filtypes.TipSet, error)

func MainnetTime

func MainnetTime(e filabi.ChainEpoch) time.Time

func SpChainIneligibleReason

func SpChainIneligibleReason(ctx context.Context, sp filaddr.Address) (defIneligibleReason string, defErr error)

func TopContext

func TopContext(onCleanup func()) (context.Context, func())

func WallTimeEpoch

func WallTimeEpoch() filabi.ChainEpoch

Types

This section is empty.

Jump to

Keyboard shortcuts

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