crib

package
v1.35.0 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2024 License: MIT Imports: 6 Imported by: 1

README

CRIB Connector

This is a simple CRIB connector for OCRv1 CRIB This code is temporary and may be removed in the future if connection logic will be simplified with ARC

Example

Go to the CRIB repository and spin up a cluster.

./scripts/cribbit.sh crib-oh-my-crib
devspace deploy --debug --profile local-dev-simulated-core-ocr1

Run an example test

export CRIB_NAMESPACE=crib-oh-my-crib
export CRIB_NETWORK=geth # only "geth" is supported for now
export CRIB_NODES=5 # min 5 nodes
#export SETH_LOG_LEVEL=debug # these two can be enabled to debug connection issues
#export RESTY_DEBUG=true
export GAP_URL=https://localhost:8080/primary # only applicable in CI, unset the var to connect locally
go test -v -run TestCRIB

Documentation

Index

Constants

View Source
const (
	/*
	 These are constants for simulated CRIB that should never change
	 Ideally, they should be placed into CRIB repository, however, for simplicity we keep all environment connectors in CTF
	 CRIB: https://github.com/smartcontractkit/crib/tree/main/core
	 Core Chart: https://github.com/smartcontractkit/infra-charts/tree/main/chainlink-cluster
	*/
	MockserverCRIBTemplate        = "https://%s-mockserver%s"
	InternalNodeDNSTemplate       = "app-node%d"
	IngressNetworkWSURLTemplate   = "wss://%s-geth-%d-ws%s"
	IngressNetworkHTTPURLTemplate = "https://%s-geth-%d-http%s"
	// DefaultSimulatedPrivateKey is a first key used for Geth/Hardhat/Anvil
	DefaultSimulatedPrivateKey = "ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"
	// DefaultSimulatedNetworkChainID is a default chainID we use for Geth/Hardhat/Anvil
	DefaultSimulatedNetworkChainID = 1337
	HostHeader                     = "X-Original-Host"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnectionVars

type ConnectionVars struct {
	IngressSuffix string
	Namespace     string
	Network       string
	Nodes         int
}

ConnectionVars common K8s connection vars

func ReadCRIBVars

func ReadCRIBVars() (*ConnectionVars, error)

ReadCRIBVars read CRIB environment variables

type CoreDONConnectionConfig

type CoreDONConnectionConfig struct {
	*ConnectionVars
	PrivateKeys           []string
	NodeURLs              []string
	NodeInternalDNS       []string
	NodeHeaders           []map[string]string
	BlockchainNodeHeaders http.Header
	MockserverHeaders     map[string]string
	ChainID               int64
	NetworkWSURL          string
	NetworkHTTPURL        string
	MockserverURL         string
}

CoreDONConnectionConfig Chainlink DON connection config

func CoreDONSimulatedConnection

func CoreDONSimulatedConnection() (*CoreDONConnectionConfig, error)

CoreDONSimulatedConnection returns all vars required to connect to core DON Simulated CRIB connects in CI via GAP if GAP_URL is provided

Jump to

Keyboard shortcuts

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