starknet

package
v1.9.0-beta0 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2022 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewChain

func NewChain(db *sqlx.DB, ks keystore.StarkNet, dbchain types.DBChain, orm types.ORM, lggr logger.Logger) (ch *chain, err error)

func NewORM

func NewORM(db *sqlx.DB, lggr logger.Logger, cfg pg.LogConfig) types.ORM

func SetupNodes

func SetupNodes(db *sqlx.DB, cfg SetupConfig, lggr logger.Logger) (err error)

SetupNodes is a hack/shim method to allow node operators to specify multiple nodes via ENV. See: https://app.shortcut.com/chainlinklabs/epic/33587/overhaul-config?cf_workflow=500000005&ct_workflow=all

Types

type ChainSet

type ChainSet interface {
	starkchain.ChainSet

	Add(context.Context, string, *db.ChainCfg) (types.DBChain, error)
	Remove(string) error
	Configure(ctx context.Context, id string, enabled bool, config *db.ChainCfg) (types.DBChain, error)
	Show(id string) (types.DBChain, error)
	Index(offset, limit int) ([]types.DBChain, int, error)
	GetNodes(ctx context.Context, offset, limit int) (nodes []db.Node, count int, err error)
	GetNodesForChain(ctx context.Context, chainID string, offset, limit int) (nodes []db.Node, count int, err error)
	CreateNode(ctx context.Context, data db.Node) (db.Node, error)
	DeleteNode(ctx context.Context, id int32) error
}

func NewChainSet

func NewChainSet(opts ChainSetOpts) (ChainSet, error)

NewChainSet returns a new chain set for opts.

type ChainSetOpts

type ChainSetOpts struct {
	Config   coreconfig.GeneralConfig
	Logger   logger.Logger
	DB       *sqlx.DB
	KeyStore keystore.StarkNet
	ORM      types.ORM
}

func (*ChainSetOpts) NewChain

func (o *ChainSetOpts) NewChain(dbchain types.DBChain) (starkchain.Chain, error)

func (*ChainSetOpts) ORMAndLogger

func (o *ChainSetOpts) ORMAndLogger() (chains.ORM[string, *db.ChainCfg, db.Node], logger.Logger)

func (*ChainSetOpts) Validate

func (o *ChainSetOpts) Validate() (err error)

type SetupConfig

type SetupConfig interface {
	StarkNetNodes() string
	LogSQL() bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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