clnode

package
v0.16.9 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2026 License: MIT Imports: 22 Imported by: 4 modules, 6 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

View Source
const (
	DefaultHTTPPort        = "6688"
	DefaultP2PPort         = "6690"
	DefaultDebuggerPort    = 40000
	TmpImageName           = "chainlink-tmp:latest"
	CustomPortSeparator    = ":"
	DefaultCapabilitiesDir = "/usr/local/bin"
	ConfigVolumeName       = "clnode-config"
	HomeVolumeName         = "clnode-home"
)
View Source
const (
	DefaultTestKeystorePassword = "thispasswordislongenough"
	DefaultPasswordTxt          = `T.tLHkcmwePT/p,]sYuntjwHKAsrhm#4eRs4LuKHwvHejWYAC2JP4M8HimwgmbaZ` //nolint:gosec
	DefaultAPICredentials       = `notreal@fakeemail.ch
fj293fbBnlQ!f9vNs`
	DefaultAPIUser     = `notreal@fakeemail.ch`
	DefaultAPIPassword = `fj293fbBnlQ!f9vNs` //nolint:gosec
)

Variables

This section is empty.

Functions

func NewNetworkCfg

func NewNetworkCfg(in *EVMNetworkConfig, out *blockchain.Output) (string, error)

NewNetworkCfg generate new network configuration from blockchain.Output EVMNodes is used to set priority and primary/secondary for particular nodes

func NewNetworkCfgOneNetworkAllNodes

func NewNetworkCfgOneNetworkAllNodes(out *blockchain.Output) (string, error)

NewNetworkCfgOneNetworkAllNodes is simplified CL node network configuration where we add all the nodes are from the same network

func WriteTmpFile

func WriteTmpFile(data, filePath string) (*os.File, error)

WriteTmpFile writes the provided data string to a specified filepath and returns the file and any error encountered.

Types

type DefaultCLNodeConfig

type DefaultCLNodeConfig struct {
	HTTPPort      string
	SecureCookies bool
}

type DefaultSecretsConfig

type DefaultSecretsConfig struct {
	DatabaseURL string
	Keystore    string
}

type EVMNetworkConfig

type EVMNetworkConfig struct {
	MinIncomingConfirmations int
	MinContractPayment       string
	ChainID                  string
	EVMNodes                 []*EVMNode
}

EVMNetworkConfig is CL node network configuration

type EVMNode

type EVMNode struct {
	Name     string
	WsUrl    string
	HttpUrl  string
	SendOnly bool
	Order    int
}

EVMNode is CL node EVM node

type Input

type Input struct {
	// NoDNS whether to allow DNS in Docker containers or not, useful for isolating containers from network if set to 'false'
	NoDNS bool `` /* 136-byte string literal not displayed */
	// DbInput PostgreSQL database configuration
	DbInput *postgres.Input `toml:"db" validate:"required" comment:"PostgreSQL database configuration"`
	// Node Chainlink node configuration
	Node *NodeInput `toml:"node" validate:"required" comment:"Chainlink node configuration"`
	// Out Chainlink node configuration output
	Out *Output `toml:"out" comment:"Chainlink node configuration output"`
}

Input represents Chainlink node input

type NodeInput

type NodeInput struct {
	// Image Chainlink node Docker image in format $registry:$tag
	Image string `toml:"image" validate:"required" comment:"Chainlink node Docker image in format $registry:$tag"`
	// Name Chainlink node Docker container name
	Name string `toml:"name" comment:"Chainlink node Docker container name"`
	// DockerFilePath Docker file path to rebuild, relative to 'docker_ctx' field path
	DockerFilePath string `toml:"docker_file" comment:"Docker file path to rebuild, relative to 'docker_ctx' field path"`
	// DockerContext Docker build context path
	DockerContext string `toml:"docker_ctx" comment:"Docker build context path"`
	// DockerBuildArgs Docker build args
	DockerBuildArgs map[string]string `` /* 128-byte string literal not displayed */
	// PullImage whether to pull Docker image or not
	PullImage bool `toml:"pull_image" comment:"Whether to pull Docker image or not"`
	// CapabilitiesBinaryPaths Chainlink CRE capabilities paths for WASM binaries
	CapabilitiesBinaryPaths []string `toml:"capabilities" comment:"Chainlink CRE capabilities paths for WASM binaries"`
	// CapabilityContainerDir path to capabilities inside Docker container (capabilities are copied inside container from local path)
	CapabilityContainerDir string `` /* 147-byte string literal not displayed */
	// TestConfigOverrides node config overrides field for programmatic usage in tests
	TestConfigOverrides string `toml:"test_config_overrides" comment:"node config overrides field for programmatic usage in tests"`
	// UserConfigOverrides node config overrides field for manual overrides from env.toml configs
	UserConfigOverrides string `toml:"user_config_overrides" comment:"node config overrides field for manual overrides from env.toml configs"`
	// TestSecretsOverrides node secrets config overrides field for programmatic usage in tests
	TestSecretsOverrides string `toml:"test_secrets_overrides" comment:"node secrets config overrides field for programmatic usage in tests"`
	// UserSecretsOverrides node secrets config overrides field for manual overrides from env.toml configs
	UserSecretsOverrides string `toml:"user_secrets_overrides" comment:"node secrets config overrides field for manual overrides from env.toml configs"`
	// HTTPPort Chainlink node API HTTP port
	HTTPPort int `toml:"port" comment:"Chainlink node API HTTP port"`
	// P2PPort Chainlink node P2P port
	P2PPort int `toml:"p2p_port" comment:"Chainlink node P2P port"`
	// CustomPorts Custom ports pairs in format $host_port_number:$docker_port_number
	CustomPorts []string `toml:"custom_ports" comment:"Custom ports pairs in format $host_port_number:$docker_port_number"`
	// DebuggerPort Delve debugger port
	DebuggerPort int `toml:"debugger_port" comment:"Delve debugger port"`
	// ContainerResources Docker container resources
	ContainerResources *framework.ContainerResources `toml:"resources" comment:"Docker container resources"`
	// EnvVars Docker container environment variables
	EnvVars map[string]string `toml:"env_vars" comment:"Docker container environment variables"`
}

NodeInput is CL nod container inputs

type NodeOut

type NodeOut struct {
	// APIAuthUser user name for basic login/password authorization in Chainlink node
	APIAuthUser string `toml:"api_auth_user" comment:"User name for basic login/password authorization in Chainlink node"`
	// APIAuthPassword password for basic login/password authorization in Chainlink node
	APIAuthPassword string `toml:"api_auth_password" comment:"Password for basic login/password authorization in Chainlink node"`
	// ContainerName node Docker contaienr name
	ContainerName string `toml:"container_name" comment:"Node Docker contaner name"`
	// ExternalURL node external API HTTP URL
	ExternalURL string `toml:"url" comment:"Node external API HTTP URL"`
	// InternalURL node internal API HTTP URL
	InternalURL string `toml:"internal_url" comment:"Node internal API HTTP URL"`
	// InternalP2PUrl node internal P2P URL
	InternalP2PUrl string `toml:"p2p_internal_url" comment:"Node internal P2P URL"`
	// InternalIP node internal IP
	InternalIP string `toml:"internal_ip" comment:"Node internal IP"`
	// K8sService is a Kubernetes service spec used to connect locally
	K8sService *v1.Service `toml:"k8s_service" comment:"Kubernetes service spec used to connect locally"`
}

NodeOut is CL node container output, URLs to connect

type Output

type Output struct {
	// UseCache Whether to respect caching or not, if cache = true component won't be deployed again
	UseCache bool `toml:"use_cache" comment:"Whether to respect caching or not, if cache = true component won't be deployed again"`
	// Node Chainlink node config output
	Node *NodeOut `toml:"node" comment:"Chainlink node config output"`
	// PostgreSQL PostgreSQL config output
	PostgreSQL *postgres.Output `toml:"postgresql" comment:"PostgreSQL config output"`
}

Output represents Chainlink node output, nodes and databases connection URLs

func NewNode

func NewNode(in *Input, pgOut *postgres.Output) (*Output, error)

func NewNodeWithContext added in v0.11.6

func NewNodeWithContext(ctx context.Context, in *Input, pgOut *postgres.Output) (*Output, error)

func NewNodeWithDB added in v0.1.1

func NewNodeWithDB(in *Input) (*Output, error)

NewNodeWithDB create a new Chainlink node with some image:tag and one or several configs see config params: TestConfigOverrides, UserConfigOverrides, etc

func NewNodeWithDBAndContext added in v0.11.6

func NewNodeWithDBAndContext(ctx context.Context, in *Input) (*Output, error)

NewNodeWithDBAndContext create a new Chainlink node with some image:tag and one or several configs see config params: TestConfigOverrides, UserConfigOverrides, etc

Jump to

Keyboard shortcuts

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