deps

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package deps provides mechanisms to run Node dependencies using docker

Index

Constants

View Source
const (
	DefaultPostgresDatabase              = "postgres"
	DefaultPostgresDockerImage           = "postgres:16-alpine"
	DefaultPostgresPort                  = "5432"
	DefaultPostgresUser                  = "postgres"
	DefaultPostgresPassword              = "password"
	DefaultDevnetDockerImage             = "cartesi/rollups-node-devnet:devel"
	DefaultDevnetPort                    = "8545"
	DefaultDevnetBlockTime               = "1"
	DefaultDevnetBlockToWaitForOnStartup = "21"
	DefaultDevnetNoMining                = false
)

Variables

This section is empty.

Functions

func Terminate

func Terminate(ctx context.Context, depContainers *DepsContainers) error

Terminate terminates all dependencies containers. This method waits for all the containers to terminate or gives an error if it fails to terminate one of the containers

Types

type DepsConfig

type DepsConfig struct {
	Postgres *PostgresConfig
	Devnet   *DevnetConfig
}

Struct to hold Node dependencies containers configurations

func NewDefaultDepsConfig

func NewDefaultDepsConfig() *DepsConfig

Builds a DepsConfig struct with default values

type DepsContainers

type DepsContainers struct {
	// contains filtered or unexported fields
}

Struct to represent the Node dependencies containers

func Run

func Run(ctx context.Context, depsConfig DepsConfig) (*DepsContainers, error)

Run starts the Node dependencies containers. The returned DepContainers struct can be used to gracefully terminate the containers using the Terminate method

func (*DepsContainers) DevnetEndpoint added in v1.5.0

func (depContainers *DepsContainers) DevnetEndpoint(
	ctx context.Context,
	protocol string,
) (string, error)

func (*DepsContainers) DevnetLogs added in v1.5.0

func (depContainers *DepsContainers) DevnetLogs(ctx context.Context) (io.ReadCloser, error)

func (*DepsContainers) PostgresEndpoint added in v1.5.0

func (depContainers *DepsContainers) PostgresEndpoint(
	ctx context.Context,
	protocol string,
) (string, error)

func (*DepsContainers) PostgresLogs added in v1.5.0

func (depContainers *DepsContainers) PostgresLogs(ctx context.Context) (io.ReadCloser, error)

type DevnetConfig added in v1.4.0

type DevnetConfig struct {
	DockerImage             string
	Port                    string
	BlockTime               string
	BlockToWaitForOnStartup string
	NoMining                bool
}

type PostgresConfig added in v1.4.0

type PostgresConfig struct {
	DockerImage string
	Port        string
	Password    string
}

Jump to

Keyboard shortcuts

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