{"modulePath":"github.com/smartcontractkit/chainlink-testing-framework/framework","version":"v0.17.3","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package framework\n\n## Constants\n\n```go\nconst (\n\tEnvVarTestConfigs = \"CTF_CONFIGS\"\n\t//nolint\n\tEnvVarAWSSecretsManager = \"CTF_AWS_SECRETS_MANAGER\"\n\t// EnvVarCI this is a default env variable many CI runners use so code can detect we run in CI\n\tEnvVarCI = \"CI\"\n)\n```\n\n```go\nconst (\n\tDefaultConfigFilePath    = \"env.toml\"\n\tDefaultOverridesFilePath = \"overrides.toml\"\n)\n```\n\n```go\nconst (\n\tEnvVarIgnoreCriticalLogs = \"CTF_IGNORE_CRITICAL_LOGS\"\n\tDefaultCTFLogsDir        = \"logs/docker\"\n)\n```\n\n```go\nconst (\n\tLGTMDockerComposePath            = \"compose\"\n\tVictoriaMetricsDockerComposePath = \"compose-victoria-metrics\"\n\n\tLocalVictoriaMetrics   = \"http://localhost:8428\"\n\tLocalVictoriaLogs      = \"http://localhost:9428\"\n\tLocalOTELCollectorHTTP = \"http://localhost:4318\"\n\tLocalOTELCollectorgRPC = \"http://localhost:4317\"\n\tLocalGrafanaBaseURL    = \"http://localhost:3000\"\n\tLocalLokiBaseURL       = \"http://localhost:3030\"\n\tLocalPrometheusBaseURL = \"http://localhost:9099\"\n\tLocalPyroscopeBaseURL  = \"http://localhost:4040\"\n\tLocalCLNodeErrorsURL   = \"http://localhost:3000/d/a7de535b-3e0f-4066-bed7-d505b6ec9ef1/cl-node-errors?orgId=1\u0026refresh=5s\"\n\tLocalWorkflowEngineURL = \"http://localhost:3000/d/ce589a98-b4be-4f80-bed1-bc62f3e4414a/workflow-engine?orgId=1\u0026refresh=5s\u0026from=now-15m\u0026to=now\"\n\tLocalLogsURL           = \"http://localhost:3000/explore?panes=%7B%22qZw%22:%7B%22datasource%22:%22P8E80F9AEF21F6940%22,%22queries%22:%5B%7B%22refId%22:%22A%22,%22expr%22:%22%7Bjob%3D%5C%22ctf%5C%22%7D%22,%22queryType%22:%22range%22,%22datasource%22:%7B%22type%22:%22loki%22,%22uid%22:%22P8E80F9AEF21F6940%22%7D,%22editorMode%22:%22code%22%7D%5D,%22range%22:%7B%22from%22:%22now-15m%22,%22to%22:%22now%22%7D%7D%7D\u0026schemaVersion=1\u0026orgId=1\"\n\tLocalPrometheusURL     = \"http://localhost:3000/explore?panes=%7B%22qZw%22:%7B%22datasource%22:%22PBFA97CFB590B2093%22,%22queries%22:%5B%7B%22refId%22:%22A%22,%22expr%22:%22%22,%22range%22:true,%22datasource%22:%7B%22type%22:%22prometheus%22,%22uid%22:%22PBFA97CFB590B2093%22%7D%7D%5D,%22range%22:%7B%22from%22:%22now-15m%22,%22to%22:%22now%22%7D%7D%7D\u0026schemaVersion=1\u0026orgId=1\"\n\tLocalPostgresDebugURL  = \"http://localhost:3000/d/000000039/postgresql-database?orgId=1\u0026refresh=5s\u0026var-DS_PROMETHEUS=PBFA97CFB590B2093\u0026var-interval=$__auto_interval_interval\u0026var-namespace=\u0026var-release=\u0026var-instance=postgres_exporter_0:9187\u0026var-datname=All\u0026var-mode=All\u0026from=now-15m\u0026to=now\"\n\tLocalPyroScopeURL      = \"http://localhost:4040/?query=process_cpu%3Acpu%3Ananoseconds%3Acpu%3Ananoseconds%7Bservice_name%3D%22chainlink-node%22%7D\u0026from=now-15m\"\n\n\tCTFObservabilityCacheDir      = \".local/share/ctf\"\n\tCTFLocalDashboardsDirRelative = \"dashboards\"\n)\n```\n\n```go\nconst (\n\t// ProductDashboardUUID is a default product dashboard uuid, can be static since it's our local environment\n\tProductDashboardUUID = \"f8a04cef-653f-46d3-86df-87c532300672\"\n\n\tReadmeTmpl = `## Chainlink Developer Environment\n\nThis template provides a complete Chainlink development environment with pre-configured infrastructure and observability tools.\n\nThe goal of this local environment is to:\n- Provide a simple and modular environment harness for developers to accelerate \"inner\" developer loop\n- Implement standard functional system-level tests\n- Implement standard non-functional system-level tests\n- Implement standard 3rd party dependencies fakes so other teams can see your product requirements clearly\n\n💻 Enter the shell to start:\n` + \"```\" + `bash\njust cli \u0026\u0026 {{ .CLIName }} sh\n` + \"```\" + `\n\n## Functional Testing\n\n🔍 Implement your product configuration (see comnents in [configurator.go](./products/productone/configurator.go))\n\nAdd any additional product services using this [template](./services/svc.go)\n\nStart the environment.\n` + \"```\" + `bash\nup ↵\n` + \"```\" + `\n\n🔍 Implement system-level functional tests [func_test.go](./tests/{{ .ProductName }}/func_test.go) and run them:\n` + \"```\" + `bash\ntest func ↵\n` + \"```\" + `\n\nYou can use ` + \"`\" + `restart ↵` + \"`\" + ` for quick iteration or ` + \"`\" + `{{ .CLIName }} r` + \"`\" + `\n\n🔄 **Enforce** quality standards in CI: copy [workflow](.github/workflows/devenv-func-test.yml) to your CI folder, commit and make them pass\n\n## Non-functional Testing\n\n📈 Start the observability stack\n` + \"```\" + `bash\nobs u -f ↵\n` + \"```\" + `\n\n📈 Implement your product observability and [dashboard](http://localhost:3000/dashboards) (your dashboard is local/{{ .ProductName }} Services)\nTo reflect changes you can restart the environment and it'd be uploaded automatically from [dashboards](./dashboards/{{ .ProductName }}.json)\n\n📈 Implement load/chaos tests [perf_test.go](./tests/{{ .ProductName }}/perf_test.go) and run them:\n` + \"```\" + `bash\nobs up -f ↵ # spin up the observability stack first\ntest perf ↵\n` + \"```\" + `\n\nYou can use ` + \"`\" + `restart ↵` + \"`\" + ` for quick iteration or ` + \"`\" + `mycli r` + \"`\" + `\nThe same works for observability stack: ` + \"`\" + `obs r -f ↵` + \"`\" + ` or ` + \"`\" + `{{ .CLIName }} obs r -f` + \"`\" + `\n\nWe are using WASP load generator to make our tests composable and protocol agnostic, read more [here](https://smartcontractkit.github.io/chainlink-testing-framework/libs/wasp/overview.html?highlight=wasp#wasp---overview).\n\n🔄 **Enforce** quality standards in CI: copy [workflow](.github/workflows/devenv-perf-test.yml) to your CI folder, commit and make them pass\n\n## Fakes (HTTP)\n\nTo speed up development and integration with 3rd party services we have a \"fakes\" Docker container ready.\n\n🔍 Implement [fakes](./fakes/main.go) for 3rd party services your need, rebuild the container and run:\n` + \"```\" + `bash\njust build-fakes\n` + \"```\" + `\n\nSee how you can access your fake HTTP methods in [functional tests](./tests/{{ .ProductName }}/func_test.go)\n\n## Running multiple instances of a product on a single environment\n\nJust increase the amount of instances in [env.toml](./env.toml)\n` + \"```\" + `bash\n[[products]]\nname = \"{{ .ProductName }}\"\ninstances = 20\n` + \"```\" + `\n\nYour implementation of ` + \"`\" + `ConfigureJobsAndContracts` + \"`\" + ` method should be able to deploy multiple instances.\n\nYou may use ` + \"`\" + `instanceIdx` + \"`\" + ` to run different deployments for each instance.\n\n\n## Running multiple products in a single environment\n\nIs simple, just copy [{{ .ProductName }}](./products/{{ .ProductName }})) and [tests/{{ .ProductName }}](./tests/{{ .ProductName }}) directories and add a new entry [here](./environment.go) in \"newProduct\" function.\n\n## Adding more Node sets (DONs)\n\nSee [env.toml](./env.toml) comments.\n\n`\n\t// AgentsTmpl is an AGENTS.md guide that teaches AI agents how to extend this devenv\n\tAgentsTmpl = `# AGENTS.md — how to extend this developer environment\n\nThis is a **code-generated Chainlink developer environment** (generated by ` + \"`\" + `ctf gen env` + \"`\" + `).\nIt composes Docker containers (blockchains, CL node sets, fakes, custom services) and exposes\nan interactive CLI called **` + \"`\" + `{{ .CLIName }}` + \"`\" + `** with autocompletion. This file tells an AI agent how to\nunderstand and extend it **following the existing patterns**. Keep changes minimal and idiomatic.\n\n## Layout\n\n| Path | What it is |\n|------|------------|\n| ` + \"`\" + `cmd/{{ .CLIName }}/{{ .CLIName }}.go` + \"`\" + ` | CLI commands (cobra). Add commands here. |\n| ` + \"`\" + `cmd/{{ .CLIName }}/completion.go` + \"`\" + ` | Shell autocompletion suggestions. Mirror every CLI command here. |\n| ` + \"`\" + `environment.go` + \"`\" + ` | Wiring: reads ` + \"`\" + `Cfg` + \"`\" + ` from TOML, spins up all Docker components in order. |\n| ` + \"`\" + `services/svc.go` + \"`\" + ` | Template for a custom Docker component (container). Copy this to add services. |\n| ` + \"`\" + `products/{{ .ProductName }}/configurator.go` + \"`\" + ` | Product logic: CL node configs, secrets, jobs \u0026 contracts. |\n| ` + \"`\" + `products/{{ .ProductName }}/*.toml` + \"`\" + ` | Product config profiles (` + \"`\" + `basic.toml` + \"`\" + `, ` + \"`\" + `soak.toml` + \"`\" + `). |\n| ` + \"`\" + `fakes/main.go` + \"`\" + ` | HTTP fakes for 3rd-party dependencies (separate Docker image + go.mod). |\n| ` + \"`\" + `tests/{{ .ProductName }}/{func,perf}_test.go` + \"`\" + ` | System-level functional / performance (WASP) tests. |\n| ` + \"`\" + `env.toml` + \"`\" + ` | Default environment config: blockchains, nodesets, services, products. |\n| ` + \"`\" + `Justfile` + \"`\" + ` | Build recipes: ` + \"`\" + `just cli` + \"`\" + `, ` + \"`\" + `just build-fakes` + \"`\" + `. |\n| ` + \"`\" + `dashboards/{{ .ProductName }}.json` + \"`\" + ` | Grafana dashboard, auto-uploaded on ` + \"`\" + `up` + \"`\" + `. |\n\n## Build \u0026 run\n\n` + \"```\" + `bash\njust cli          # rebuild the {{ .CLIName }} binary after editing cmd/{{ .CLIName }}/*\n{{ .CLIName }} sh           # enter the interactive shell (autocompletion)\nup                # spin up env (inside shell); or: {{ .CLIName }} up\ntest func         # run functional tests; test perf for performance\n` + \"```\" + `\n\nConfig is selected via the ` + \"`\" + `CTF_CONFIGS` + \"`\" + ` env var, a comma-separated list of TOML files\n(e.g. ` + \"`\" + `env.toml,products/{{ .ProductName }}/basic.toml` + \"`\" + `). ` + \"`\" + `up` + \"`\" + `/` + \"`\" + `restart` + \"`\" + ` set this for you.\n\n## Add a CLI command\n\nCommands are [cobra](https://github.com/spf13/cobra) commands in ` + \"`\" + `cmd/{{ .CLIName }}/{{ .CLIName }}.go` + \"`\" + `.\n\n1. Declare a ` + \"`\" + `*cobra.Command` + \"`\" + ` var with ` + \"`\" + `Use` + \"`\" + `, ` + \"`\" + `Aliases` + \"`\" + `, ` + \"`\" + `Short` + \"`\" + `, and a ` + \"`\" + `RunE` + \"`\" + ` func.\n2. Register it in ` + \"`\" + `init()` + \"`\" + ` with ` + \"`\" + `rootCmd.AddCommand(myCmd)` + \"`\" + ` (or ` + \"`\" + `parent.AddCommand(child)` + \"`\" + ` for subcommands; set flags via ` + \"`\" + `parent.PersistentFlags()` + \"`\" + ` — see ` + \"`\" + `bsCmd` + \"`\" + `/` + \"`\" + `obsCmd` + \"`\" + `).\n3. **Always** add a matching entry in ` + \"`\" + `cmd/{{ .CLIName }}/completion.go` + \"`\" + `:\n   - top-level command → add to ` + \"`\" + `getCommands()` + \"`\" + `\n   - subcommands/args → add a ` + \"`\" + `case \"\u003ccmd\u003e\":` + \"`\" + ` in ` + \"`\" + `getSubCommands()` + \"`\" + `\n4. ` + \"`\" + `just cli` + \"`\" + ` to rebuild.\n\nBusiness logic lives in the ` + \"`\" + `framework` + \"`\" + ` package (e.g. ` + \"`\" + `framework.ObservabilityUp()` + \"`\" + `,\n` + \"`\" + `framework.BlockScoutUp()` + \"`\" + `); the CLI is a thin wrapper. Prefer reusing framework helpers.\n\n## Wire up a new Docker component (service)\n\n1. Copy ` + \"`\" + `services/svc.go` + \"`\" + ` to ` + \"`\" + `services/\u003cname\u003e.go` + \"`\" + `. Each service = an ` + \"`\" + `Input` + \"`\" + ` struct (with\n   ` + \"`\" + `Default()` + \"`\" + `), an ` + \"`\" + `Output` + \"`\" + ` struct (with an ` + \"`\" + `out` + \"`\" + ` TOML tag), and a ` + \"`\" + `New\u003cName\u003e(in)` + \"`\" + ` deploy func\n   using ` + \"`\" + `testcontainers` + \"`\" + `. Use ` + \"`\" + `framework.DefaultTCLabels()` + \"`\" + `, ` + \"`\" + `framework.DefaultNetworkName` + \"`\" + `,\n   and static host ports.\n2. Add the input field to the ` + \"`\" + `Cfg` + \"`\" + ` struct in ` + \"`\" + `environment.go` + \"`\" + ` (with a ` + \"`\" + `toml` + \"`\" + ` tag).\n3. Call ` + \"`\" + `New\u003cName\u003e(in.\u003cField\u003e)` + \"`\" + ` inside ` + \"`\" + `NewEnvironment()` + \"`\" + `, alongside ` + \"`\" + `services.NewService` + \"`\" + `.\n4. Add its config block to ` + \"`\" + `env.toml` + \"`\" + `.\n5. A deployed service must guard on ` + \"`\" + `in == nil || in.Out != nil` + \"`\" + ` to stay idempotent (see ` + \"`\" + `NewService` + \"`\" + `).\n\n## Add a product\n\n1. Copy ` + \"`\" + `products/{{ .ProductName }}/` + \"`\" + ` → ` + \"`\" + `products/\u003cnewproduct\u003e/` + \"`\" + ` and ` + \"`\" + `tests/{{ .ProductName }}/` + \"`\" + ` → ` + \"`\" + `tests/\u003cnewproduct\u003e/` + \"`\" + `.\n2. Implement the ` + \"`\" + `Product` + \"`\" + ` interface (` + \"`\" + `interface.go` + \"`\" + `) in ` + \"`\" + `configurator.go` + \"`\" + `:\n   ` + \"`\" + `Load` + \"`\" + `, ` + \"`\" + `Store` + \"`\" + `, ` + \"`\" + `GenerateNodesConfig` + \"`\" + `, ` + \"`\" + `GenerateNodesSecrets` + \"`\" + `, ` + \"`\" + `ConfigureJobsAndContracts` + \"`\" + `.\n3. Register it in ` + \"`\" + `newProduct(name)` + \"`\" + ` in ` + \"`\" + `environment.go` + \"`\" + ` with a new ` + \"`\" + `case` + \"`\" + `.\n4. Add a ` + \"`\" + `[[products]]` + \"`\" + ` entry (with ` + \"`\" + `name` + \"`\" + `, ` + \"`\" + `instances` + \"`\" + `) in ` + \"`\" + `env.toml` + \"`\" + `.\n   Multiple instances → your ` + \"`\" + `ConfigureJobsAndContracts` + \"`\" + ` must handle ` + \"`\" + `productIdx` + \"`\" + `.\n\n## Add / change fakes (3rd-party HTTP)\n\nEdit ` + \"`\" + `fakes/main.go` + \"`\" + ` (its own Docker image + ` + \"`\" + `go.mod` + \"`\" + `), then ` + \"`\" + `just build-fakes` + \"`\" + `.\nTests reach fakes via the ` + \"`\" + `fake_server` + \"`\" + ` output; see ` + \"`\" + `tests/{{ .ProductName }}/func_test.go` + \"`\" + `.\n\n## Conventions (do not break)\n\n- Docker components: static ports, ` + \"`\" + `framework.DefaultTCLabels()` + \"`\" + `, ` + \"`\" + `framework.DefaultNetworkName` + \"`\" + `.\n- Config is TOML-driven; every new component/product needs a ` + \"`\" + `Cfg` + \"`\" + `/` + \"`\" + `env.toml` + \"`\" + ` entry.\n- Idempotent deploys: skip if output already set.\n- Every CLI command has a completion entry.\n- Address any ` + \"`\" + `// TODO` + \"`\" + ` comments the generator left before shipping.\n`\n\t// ProductsInterfaceTmpl common interface for arbitrary products deployed in devenv\n\tProductsInterfaceTmpl = `package {{ .PackageName }}\n\nimport (\n\t\"context\"\n\n\t\"github.com/smartcontractkit/chainlink-testing-framework/framework/components/blockchain\"\n\t\"github.com/smartcontractkit/chainlink-testing-framework/framework/components/fake\"\n\n\tnodeset \"github.com/smartcontractkit/chainlink-testing-framework/framework/components/simple_node_set\"\n)\n\n// Product describes a minimal set of methods that each product should implement\n// some methods may be empty in case you don't need them (GenerateNodesSecrets for example)\ntype Product interface {\n\t// Load describes how to load your product-specific config\n\tLoad() error\n\n\t// Store describes how to store your product-speicifc config output\n\t// The output may include URLs to you services, CLDF contracts addresses and more\n\tStore(path string, instanceIdx int) error\n\n\t// GenerateNodesSecrets describes how to generate secrets for Chainlink nodes for your product\n\t// deployed on multiple blockchains and nodesets\n\tGenerateNodesSecrets(\n\t\tctx context.Context,\n\t\tfs *fake.Input,\n\t\tbc []*blockchain.Input,\n\t\tns []*nodeset.Input,\n\t) (string, error)\n\n\t// GenerateNodesConfig describes how to generate Chainlink node config\n\t// specific to your product deployed on multiple blockchains and nodesets\n\tGenerateNodesConfig(\n\t\tctx context.Context,\n\t\tfs *fake.Input,\n\t\tbc []*blockchain.Input,\n\t\tns []*nodeset.Input,\n\t) (string, error)\n\n\t// ConfigureJobsAndContracts describe how to configure jobs and contracts\n\t// specifically to your product deployed on multiple blockchains and nodesets\n\t// Configuration may be called multiple times if \"instances\" key is specificed in \"env.toml\"\n\t// the implementation should be aware of it and be able to configure multiple instances of the product\n\tConfigureJobsAndContracts(\n\t\tctx context.Context,\n\t\tinstanceIdx int,\n\t\tfs *fake.Input,\n\t\tbc []*blockchain.Input,\n\t\tns []*nodeset.Input,\n\t) error\n}\n`\n\n\t// GoModTemplate go module template\n\tGoModTemplate = `module {{.ModuleName}}\n\ngo {{.RuntimeVersion}}\n\nrequire (\n\tgithub.com/smartcontractkit/chainlink-evm v0.0.0-20250709215002-07f34ab867df\n\tgithub.com/smartcontractkit/chainlink-deployments-framework v0.17.0\n\tgithub.com/smartcontractkit/chainlink-testing-framework/framework v0.13.5\n)\n\nreplace github.com/fbsobreira/gotron-sdk =\u003e github.com/smartcontractkit/chainlink-tron/relayer/gotron-sdk v0.0.5-0.20250528121202-292529af39df\n\nreplace (\n\tgithub.com/gogo/protobuf =\u003e github.com/regen-network/protobuf v1.3.3-alpha.regen.1\n\tgithub.com/prometheus/common =\u003e github.com/prometheus/common v0.62.0\n\tgithub.com/smartcontractkit/chainlink-testing-framework/lib =\u003e github.com/smartcontractkit/chainlink-testing-framework/lib v1.54.4\n)\n`\n\t// GitIgnoreTmpl default gitignore template\n\tGitIgnoreTmpl = `compose/\nblockscout/\nenv-out.toml`\n\n\t// GrafanaDashboardTmpl is a Grafana dashboard template for your product\n\tGrafanaDashboardTmpl = `{\n  \"annotations\": {\n    \"list\": [\n      {\n        \"builtIn\": 1,\n        \"datasource\": {\n          \"type\": \"grafana\",\n          \"uid\": \"-- Grafana --\"\n        },\n        \"enable\": true,\n        \"hide\": true,\n        \"iconColor\": \"rgba(0, 211, 255, 1)\",\n        \"name\": \"Annotations \u0026 Alerts\",\n        \"type\": \"dashboard\"\n      }\n    ]\n  },\n  \"editable\": true,\n  \"fiscalYearStartMonth\": 0,\n  \"graphTooltip\": 0,\n  \"links\": [],\n  \"liveNow\": false,\n  \"panels\": [\n    {\n      \"collapsed\": false,\n      \"gridPos\": {\n        \"h\": 1,\n        \"w\": 24,\n        \"x\": 0,\n        \"y\": 0\n      },\n      \"id\": 34,\n      \"panels\": [],\n      \"title\": \"Container Resources\",\n      \"type\": \"row\"\n    },\n    {\n      \"datasource\": {\n        \"type\": \"prometheus\",\n        \"uid\": \"PBFA97CFB590B2093\"\n      },\n      \"fieldConfig\": {\n        \"defaults\": {\n          \"color\": {\n            \"mode\": \"palette-classic\"\n          },\n          \"custom\": {\n            \"axisCenteredZero\": false,\n            \"axisColorMode\": \"text\",\n            \"axisLabel\": \"\",\n            \"axisPlacement\": \"auto\",\n            \"barAlignment\": 0,\n            \"drawStyle\": \"line\",\n            \"fillOpacity\": 10,\n            \"gradientMode\": \"none\",\n            \"hideFrom\": {\n              \"legend\": false,\n              \"tooltip\": false,\n              \"viz\": false\n            },\n            \"insertNulls\": false,\n            \"lineInterpolation\": \"linear\",\n            \"lineWidth\": 1,\n            \"pointSize\": 5,\n            \"scaleDistribution\": {\n              \"type\": \"linear\"\n            },\n            \"showPoints\": \"never\",\n            \"spanNulls\": false,\n            \"stacking\": {\n              \"group\": \"A\",\n              \"mode\": \"normal\"\n            },\n            \"thresholdsStyle\": {\n              \"mode\": \"off\"\n            }\n          },\n          \"mappings\": [],\n          \"thresholds\": {\n            \"mode\": \"absolute\",\n            \"steps\": [\n              {\n                \"color\": \"green\",\n                \"value\": null\n              },\n              {\n                \"color\": \"red\",\n                \"value\": 80\n              }\n            ]\n          },\n          \"unit\": \"percent\"\n        },\n        \"overrides\": []\n      },\n      \"gridPos\": {\n        \"h\": 7,\n        \"w\": 12,\n        \"x\": 0,\n        \"y\": 1\n      },\n      \"id\": 2,\n      \"options\": {\n        \"legend\": {\n          \"calcs\": [\n            \"mean\",\n            \"max\"\n          ],\n          \"displayMode\": \"table\",\n          \"placement\": \"right\",\n          \"showLegend\": true\n        },\n        \"tooltip\": {\n          \"mode\": \"multi\",\n          \"sort\": \"none\"\n        }\n      },\n      \"pluginVersion\": \"10.1.0\",\n      \"targets\": [\n        {\n          \"datasource\": {\n            \"type\": \"prometheus\",\n            \"uid\": \"PBFA97CFB590B2093\"\n          },\n          \"editorMode\": \"code\",\n          \"expr\": \"sum(rate(container_cpu_usage_seconds_total{name=~\\\".*don.*|.*fake.*\\\"}[5m])) by (name) *100\",\n          \"hide\": false,\n          \"interval\": \"\",\n          \"legendFormat\": \"{{\"{{\"}}name{{\"}}\"}}\",\n          \"range\": true,\n          \"refId\": \"A\"\n        }\n      ],\n      \"title\": \"CPU Usage\",\n      \"transparent\": true,\n      \"type\": \"timeseries\"\n    },\n    {\n      \"datasource\": {\n        \"type\": \"prometheus\",\n        \"uid\": \"PBFA97CFB590B2093\"\n      },\n      \"fieldConfig\": {\n        \"defaults\": {\n          \"color\": {\n            \"mode\": \"palette-classic\"\n          },\n          \"custom\": {\n            \"axisCenteredZero\": false,\n            \"axisColorMode\": \"text\",\n            \"axisLabel\": \"\",\n            \"axisPlacement\": \"auto\",\n            \"barAlignment\": 0,\n            \"drawStyle\": \"line\",\n            \"fillOpacity\": 10,\n            \"gradientMode\": \"none\",\n            \"hideFrom\": {\n              \"legend\": false,\n              \"tooltip\": false,\n              \"viz\": false\n            },\n            \"insertNulls\": false,\n            \"lineInterpolation\": \"linear\",\n            \"lineWidth\": 1,\n            \"pointSize\": 5,\n            \"scaleDistribution\": {\n              \"type\": \"linear\"\n            },\n            \"showPoints\": \"never\",\n            \"spanNulls\": false,\n            \"stacking\": {\n              \"group\": \"A\",\n              \"mode\": \"none\"\n            },\n            \"thresholdsStyle\": {\n              \"mode\": \"off\"\n            }\n          },\n          \"mappings\": [],\n          \"thresholds\": {\n            \"mode\": \"absolute\",\n            \"steps\": [\n              {\n                \"color\": \"green\",\n                \"value\": null\n              },\n              {\n                \"color\": \"red\",\n                \"value\": 80\n              }\n            ]\n          },\n          \"unit\": \"Bps\"\n        },\n        \"overrides\": []\n      },\n      \"gridPos\": {\n        \"h\": 7,\n        \"w\": 12,\n        \"x\": 12,\n        \"y\": 1\n      },\n      \"id\": 4,\n      \"options\": {\n        \"legend\": {\n          \"calcs\": [\n            \"mean\",\n            \"max\"\n          ],\n          \"displayMode\": \"table\",\n          \"placement\": \"right\",\n          \"showLegend\": true\n        },\n        \"tooltip\": {\n          \"mode\": \"multi\",\n          \"sort\": \"none\"\n        }\n      },\n      \"pluginVersion\": \"10.1.0\",\n      \"targets\": [\n        {\n          \"datasource\": {\n            \"type\": \"prometheus\",\n            \"uid\": \"PBFA97CFB590B2093\"\n          },\n          \"editorMode\": \"code\",\n          \"expr\": \"sum(rate(container_network_receive_bytes_total{name=~\\\".*don.*|.*fake.*\\\"}[5m])) by (name)\",\n          \"hide\": false,\n          \"interval\": \"\",\n          \"legendFormat\": \"{{\"{{\"}}name{{\"}}\"}}\",\n          \"range\": true,\n          \"refId\": \"A\"\n        }\n      ],\n      \"title\": \"Received Network Traffic\",\n      \"transparent\": true,\n      \"type\": \"timeseries\"\n    },\n    {\n      \"datasource\": {\n        \"type\": \"prometheus\",\n        \"uid\": \"PBFA97CFB590B2093\"\n      },\n      \"fieldConfig\": {\n        \"defaults\": {\n          \"color\": {\n            \"mode\": \"palette-classic\"\n          },\n          \"custom\": {\n            \"axisCenteredZero\": false,\n            \"axisColorMode\": \"text\",\n            \"axisLabel\": \"\",\n            \"axisPlacement\": \"auto\",\n            \"barAlignment\": 0,\n            \"drawStyle\": \"line\",\n            \"fillOpacity\": 10,\n            \"gradientMode\": \"none\",\n            \"hideFrom\": {\n              \"legend\": false,\n              \"tooltip\": false,\n              \"viz\": false\n            },\n            \"insertNulls\": false,\n            \"lineInterpolation\": \"linear\",\n            \"lineWidth\": 1,\n            \"pointSize\": 5,\n            \"scaleDistribution\": {\n              \"type\": \"linear\"\n            },\n            \"showPoints\": \"never\",\n            \"spanNulls\": false,\n            \"stacking\": {\n              \"group\": \"A\",\n              \"mode\": \"normal\"\n            },\n            \"thresholdsStyle\": {\n              \"mode\": \"off\"\n            }\n          },\n          \"mappings\": [],\n          \"thresholds\": {\n            \"mode\": \"absolute\",\n            \"steps\": [\n              {\n                \"color\": \"green\",\n                \"value\": null\n              },\n              {\n                \"color\": \"red\",\n                \"value\": 80\n              }\n            ]\n          },\n          \"unit\": \"bytes\"\n        },\n        \"overrides\": []\n      },\n      \"gridPos\": {\n        \"h\": 7,\n        \"w\": 12,\n        \"x\": 0,\n        \"y\": 8\n      },\n      \"id\": 3,\n      \"options\": {\n        \"legend\": {\n          \"calcs\": [\n            \"mean\",\n            \"max\"\n          ],\n          \"displayMode\": \"table\",\n          \"placement\": \"right\",\n          \"showLegend\": true\n        },\n        \"tooltip\": {\n          \"mode\": \"multi\",\n          \"sort\": \"none\"\n        }\n      },\n      \"pluginVersion\": \"10.1.0\",\n      \"targets\": [\n        {\n          \"datasource\": {\n            \"type\": \"prometheus\",\n            \"uid\": \"PBFA97CFB590B2093\"\n          },\n          \"editorMode\": \"code\",\n          \"expr\": \"sum(container_memory_rss{name=~\\\".*don.*|.*fake.*\\\"}) by (name)\",\n          \"hide\": false,\n          \"interval\": \"\",\n          \"legendFormat\": \"{{\"{{\"}}name{{\"}}\"}}\",\n          \"range\": true,\n          \"refId\": \"A\"\n        }\n      ],\n      \"title\": \"Memory Usage\",\n      \"transparent\": true,\n      \"type\": \"timeseries\"\n    },\n    {\n      \"datasource\": {\n        \"type\": \"prometheus\",\n        \"uid\": \"PBFA97CFB590B2093\"\n      },\n      \"fieldConfig\": {\n        \"defaults\": {\n          \"color\": {\n            \"mode\": \"palette-classic\"\n          },\n          \"custom\": {\n            \"axisCenteredZero\": false,\n            \"axisColorMode\": \"text\",\n            \"axisLabel\": \"\",\n            \"axisPlacement\": \"auto\",\n            \"barAlignment\": 0,\n            \"drawStyle\": \"line\",\n            \"fillOpacity\": 10,\n            \"gradientMode\": \"none\",\n            \"hideFrom\": {\n              \"legend\": false,\n              \"tooltip\": false,\n              \"viz\": false\n            },\n            \"insertNulls\": false,\n            \"lineInterpolation\": \"linear\",\n            \"lineWidth\": 1,\n            \"pointSize\": 5,\n            \"scaleDistribution\": {\n              \"type\": \"linear\"\n            },\n            \"showPoints\": \"never\",\n            \"spanNulls\": false,\n            \"stacking\": {\n              \"group\": \"A\",\n              \"mode\": \"none\"\n            },\n            \"thresholdsStyle\": {\n              \"mode\": \"off\"\n            }\n          },\n          \"mappings\": [],\n          \"thresholds\": {\n            \"mode\": \"absolute\",\n            \"steps\": [\n              {\n                \"color\": \"green\",\n                \"value\": null\n              },\n              {\n                \"color\": \"red\",\n                \"value\": 80\n              }\n            ]\n          },\n          \"unit\": \"Bps\"\n        },\n        \"overrides\": []\n      },\n      \"gridPos\": {\n        \"h\": 7,\n        \"w\": 12,\n        \"x\": 12,\n        \"y\": 8\n      },\n      \"id\": 5,\n      \"options\": {\n        \"legend\": {\n          \"calcs\": [\n            \"mean\",\n            \"max\"\n          ],\n          \"displayMode\": \"table\",\n          \"placement\": \"right\",\n          \"showLegend\": true\n        },\n        \"tooltip\": {\n          \"mode\": \"multi\",\n          \"sort\": \"none\"\n        }\n      },\n      \"pluginVersion\": \"10.1.0\",\n      \"targets\": [\n        {\n          \"datasource\": {\n            \"type\": \"prometheus\",\n            \"uid\": \"PBFA97CFB590B2093\"\n          },\n          \"editorMode\": \"code\",\n          \"expr\": \"sum(rate(container_network_transmit_bytes_total{name=~\\\".*don.*|.*fake.*\\\"}[5m])) by (name)\",\n          \"interval\": \"\",\n          \"legendFormat\": \"{{\"{{\"}}name{{\"}}\"}}\",\n          \"range\": true,\n          \"refId\": \"A\"\n        }\n      ],\n      \"title\": \"Sent Network Traffic\",\n      \"transparent\": true,\n      \"type\": \"timeseries\"\n    },\n    {\n      \"collapsed\": true,\n      \"gridPos\": {\n        \"h\": 1,\n        \"w\": 24,\n        \"x\": 0,\n        \"y\": 15\n      },\n      \"id\": 11,\n      \"panels\": [\n        {\n          \"datasource\": {\n            \"type\": \"loki\",\n            \"uid\": \"P8E80F9AEF21F6940\"\n          },\n          \"description\": \"CL Node Logs\",\n          \"gridPos\": {\n            \"h\": 5,\n            \"w\": 24,\n            \"x\": 0,\n            \"y\": 16\n          },\n          \"id\": 6,\n          \"options\": {\n            \"dedupStrategy\": \"none\",\n            \"enableLogDetails\": true,\n            \"prettifyLogMessage\": false,\n            \"showCommonLabels\": false,\n            \"showLabels\": false,\n            \"showTime\": false,\n            \"sortOrder\": \"Descending\",\n            \"wrapLogMessage\": false\n          },\n          \"targets\": [\n            {\n              \"datasource\": {\n                \"type\": \"loki\",\n                \"uid\": \"P8E80F9AEF21F6940\"\n              },\n              \"editorMode\": \"code\",\n              \"expr\": \"{job=\\\"ctf\\\", container=~\\\".*don-node.*\\\"}\",\n              \"queryType\": \"range\",\n              \"refId\": \"A\"\n            }\n          ],\n          \"title\": \"CL Node Logs\",\n          \"transparent\": true,\n          \"type\": \"logs\"\n        },\n        {\n          \"datasource\": {\n            \"type\": \"loki\",\n            \"uid\": \"P8E80F9AEF21F6940\"\n          },\n          \"description\": \"P2P Discovery Report\",\n          \"gridPos\": {\n            \"h\": 5,\n            \"w\": 24,\n            \"x\": 0,\n            \"y\": 21\n          },\n          \"id\": 8,\n          \"options\": {\n            \"dedupStrategy\": \"none\",\n            \"enableLogDetails\": true,\n            \"prettifyLogMessage\": false,\n            \"showCommonLabels\": false,\n            \"showLabels\": false,\n            \"showTime\": false,\n            \"sortOrder\": \"Descending\",\n            \"wrapLogMessage\": false\n          },\n          \"targets\": [\n            {\n              \"datasource\": {\n                \"type\": \"loki\",\n                \"uid\": \"P8E80F9AEF21F6940\"\n              },\n              \"editorMode\": \"code\",\n              \"expr\": \"{job=\\\"ctf\\\"} |= \\\"DiscoveryProtocol: Status report\\\"\",\n              \"queryType\": \"range\",\n              \"refId\": \"A\"\n            }\n          ],\n          \"title\": \"P2P Discovery Report\",\n          \"transparent\": true,\n          \"type\": \"logs\"\n        }\n      ],\n      \"title\": \"CL Node Stats\",\n      \"type\": \"row\"\n    },\n    {\n      \"collapsed\": true,\n      \"gridPos\": {\n        \"h\": 1,\n        \"w\": 24,\n        \"x\": 0,\n        \"y\": 16\n      },\n      \"id\": 35,\n      \"panels\": [\n        {\n          \"datasource\": {\n            \"type\": \"loki\",\n            \"uid\": \"P8E80F9AEF21F6940\"\n          },\n          \"gridPos\": {\n            \"h\": 4,\n            \"w\": 24,\n            \"x\": 0,\n            \"y\": 17\n          },\n          \"id\": 40,\n          \"options\": {\n            \"code\": {\n              \"language\": \"plaintext\",\n              \"showLineNumbers\": false,\n              \"showMiniMap\": false\n            },\n            \"content\": \"# Pprof profiling with Pyroscope\\nSelect \\\"service_name\\\" variable to start.\\n\\nFor more info you can also use native [UI](http://localhost:4040)\",\n            \"mode\": \"markdown\"\n          },\n          \"pluginVersion\": \"10.1.0\",\n          \"transparent\": true,\n          \"type\": \"text\"\n        },\n        {\n          \"datasource\": {\n            \"type\": \"grafana-pyroscope-datasource\",\n            \"uid\": \"P02E4190217B50628\"\n          },\n          \"description\": \"CPU\",\n          \"gridPos\": {\n            \"h\": 9,\n            \"w\": 24,\n            \"x\": 0,\n            \"y\": 21\n          },\n          \"id\": 36,\n          \"targets\": [\n            {\n              \"datasource\": {\n                \"type\": \"grafana-pyroscope-datasource\",\n                \"uid\": \"P02E4190217B50628\"\n              },\n              \"groupBy\": [],\n              \"labelSelector\": \"{service_name=\\\"${service_name}\\\"}\",\n              \"profileTypeId\": \"process_cpu:cpu:nanoseconds:cpu:nanoseconds\",\n              \"queryType\": \"profile\",\n              \"refId\": \"A\"\n            }\n          ],\n          \"title\": \"CPU\",\n          \"transparent\": true,\n          \"type\": \"flamegraph\"\n        },\n        {\n          \"datasource\": {\n            \"type\": \"grafana-pyroscope-datasource\",\n            \"uid\": \"P02E4190217B50628\"\n          },\n          \"description\": \"Memory (alloc_objects)\",\n          \"gridPos\": {\n            \"h\": 9,\n            \"w\": 24,\n            \"x\": 0,\n            \"y\": 30\n          },\n          \"id\": 37,\n          \"targets\": [\n            {\n              \"datasource\": {\n                \"type\": \"grafana-pyroscope-datasource\",\n                \"uid\": \"P02E4190217B50628\"\n              },\n              \"groupBy\": [],\n              \"labelSelector\": \"{service_name=\\\"${service_name}\\\"}\",\n              \"profileTypeId\": \"memory:alloc_objects:count:space:bytes\",\n              \"queryType\": \"profile\",\n              \"refId\": \"A\"\n            }\n          ],\n          \"title\": \"Memory (alloc_objects)\",\n          \"transparent\": true,\n          \"type\": \"flamegraph\"\n        },\n        {\n          \"datasource\": {\n            \"type\": \"grafana-pyroscope-datasource\",\n            \"uid\": \"P02E4190217B50628\"\n          },\n          \"description\": \"Goroutines\",\n          \"gridPos\": {\n            \"h\": 9,\n            \"w\": 24,\n            \"x\": 0,\n            \"y\": 39\n          },\n          \"id\": 39,\n          \"targets\": [\n            {\n              \"datasource\": {\n                \"type\": \"grafana-pyroscope-datasource\",\n                \"uid\": \"P02E4190217B50628\"\n              },\n              \"groupBy\": [],\n              \"labelSelector\": \"{service_name=\\\"${service_name}\\\"}\",\n              \"profileTypeId\": \"goroutines:goroutine:count:goroutine:count\",\n              \"queryType\": \"profile\",\n              \"refId\": \"A\"\n            }\n          ],\n          \"title\": \"Goroutines\",\n          \"transparent\": true,\n          \"type\": \"flamegraph\"\n        },\n        {\n          \"datasource\": {\n            \"type\": \"grafana-pyroscope-datasource\",\n            \"uid\": \"P02E4190217B50628\"\n          },\n          \"description\": \"Mutex\",\n          \"gridPos\": {\n            \"h\": 9,\n            \"w\": 24,\n            \"x\": 0,\n            \"y\": 48\n          },\n          \"id\": 38,\n          \"targets\": [\n            {\n              \"datasource\": {\n                \"type\": \"grafana-pyroscope-datasource\",\n                \"uid\": \"P02E4190217B50628\"\n              },\n              \"groupBy\": [],\n              \"labelSelector\": \"{service_name=\\\"${service_name}\\\"}\",\n              \"profileTypeId\": \"mutex:contentions:count:contentions:count\",\n              \"queryType\": \"profile\",\n              \"refId\": \"A\"\n            }\n          ],\n          \"title\": \"Mutex\",\n          \"transparent\": true,\n          \"type\": \"flamegraph\"\n        }\n      ],\n      \"title\": \"Pyroscope\",\n      \"type\": \"row\"\n    }\n  ],\n  \"refresh\": \"5s\",\n  \"schemaVersion\": 38,\n  \"style\": \"dark\",\n  \"tags\": [],\n  \"templating\": {\n    \"list\": [\n      {\n        \"current\": {\n          \"selected\": false,\n          \"text\": \"chainlink-node\",\n          \"value\": \"chainlink-node\"\n        },\n        \"description\": \"service_name\",\n        \"hide\": 0,\n        \"includeAll\": false,\n        \"label\": \"service_name\",\n        \"multi\": false,\n        \"name\": \"service_name\",\n        \"options\": [\n          {\n            \"selected\": true,\n            \"text\": \"chainlink-node\",\n            \"value\": \"chainlink-node\"\n          }\n        ],\n        \"query\": \"chainlink-node\",\n        \"queryValue\": \"\",\n        \"skipUrlSync\": false,\n        \"type\": \"custom\"\n      }\n    ]\n  },\n  \"time\": {\n    \"from\": \"now-1h\",\n    \"to\": \"now\"\n  },\n  \"timepicker\": {},\n  \"timezone\": \"\",\n  \"title\": \"{{ .ProductName }} Services\",\n  \"uid\": \"{{ .UUID }}\",\n  \"version\": 1,\n  \"weekStart\": \"\"\n}`\n\t// ConfigTOMLTmpl is a default env.toml template for devenv describind components configuration\n\tConfigTOMLTmpl = `\n[[products]]\nname = \"{{ .ProductName }}\"\ninstances = 1\n\n[fake_server]\n  image = \"{{ .ProductName }}-fakes:latest\"\n  port = 9111\n\n[example_service]\n  image = \"busybox:latest\"\n  port = 9501\n\n[[blockchains]]\n  chain_id = \"1337\"\n  docker_cmd_params = [\"-b\", \"1\", \"--mixed-mining\", \"--slots-in-an-epoch\", \"1\"]\n  image = \"ghcr.io/foundry-rs/foundry:stable\"\n  port = \"8545\"\n  type = \"anvil\"\n\n[[nodesets]]\n  name = \"don\"\n  nodes = {{ .Nodes }}\n  http_port_range_start = 10000\n  override_mode = \"each\"\n\n  [nodesets.db]\n    image = \"postgres:15.0\"\n\n\t{{- range .NodeIndices }}\n\t[[nodesets.node_specs]]\n\t    [nodesets.node_specs.node]\n\t    image = \"public.ecr.aws/chainlink/chainlink:2.49.1-rc.2\"\n\t{{- end }}\n# additional nodeset to demonstrate how to add many\n# you need to add \"nodesets.http_port_range_start\" and \"nodesets.db.port\" so these nodesets\n# can be separated\n[[nodesets]]\n  name = \"don-2\"\n  nodes = 1\n  http_port_range_start = 20000\n  override_mode = \"each\"\n\n  [nodesets.db]\n    image = \"postgres:15.0\"\n    port = 13001\n\t[[nodesets.node_specs]]\n\t    [nodesets.node_specs.node]\n\t    image = \"public.ecr.aws/chainlink/chainlink:2.49.1-rc.2\"\n\n`\n\n\t// CINonFunctionalTmpl is a continuous integration template for end-to-end load/chaos tests\n\tCINonFunctionalTmpl = `name: End-to-end {{ .ProductName }} Perf Tests\n\non:\n pull_request:\n\ndefaults:\n run:\n   working-directory: {{ .DevEnvRelPath }}\n\nconcurrency:\n group: {{\"${{\"}} github.workflow {{\"}}\"}}-{{\"${{\"}} github.ref {{\"}}\"}}\n cancel-in-progress: true\n\njobs:\n e2e-tests:\n   permissions:\n     id-token: write\n     contents: read\n     pull-requests: write\n   runs-on: ubuntu-latest\n   strategy:\n     matrix:\n       include:\n         - name: LoadChaos\n           config: env.toml\n         # TODO: Add more test and environment configurations as needed\n   steps:\n     - name: Checkout code\n       uses: actions/checkout@v5\n       with:\n         fetch-depth: 0\n\n     - name: Set up Docker Buildx\n       uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1\n\n     - name: Install Just\n       uses: extractions/setup-just@e33e0265a09d6d736e2ee1e0eb685ef1de4669ff # v3\n       with:\n         just-version: '1.40.0'\n\n     - name: Authenticate to AWS ECR\n       uses: ./.github/actions/aws-ecr-auth\n       with:\n         role-to-assume: {{\"${{\"}} secrets.CCV_IAM_ROLE {{\"}}\"}}\n         aws-region: us-east-1\n         registry-type: public\n\n     - name: Authenticate to AWS ECR (JD)\n       uses: ./.github/actions/aws-ecr-auth\n       with:\n         role-to-assume: {{\"${{\"}} secrets.CCV_IAM_ROLE {{\"}}\"}}\n         aws-region: us-west-2\n         registry-type: private\n         registries: {{\"${{\"}} secrets.JD_REGISTRY {{\"}}\"}}\n\n     - name: Set up Go\n       uses: actions/setup-go@v6 # v6\n       with:\n         cache: true\n         go-version-file: {{ .DevEnvRelPath }}/go.mod\n         cache-dependency-path: {{ .DevEnvRelPath }}/go.sum\n\n     - name: Download Go dependencies\n       run: |\n         go mod download\n\n     - name: Run CCV environment\n       env:\n         JD_IMAGE: {{\"${{\"}} secrets.JD_IMAGE {{\"}}\"}}\n       run: |\n         cd cmd/{{ .CLIName }} \u0026\u0026 go install . \u0026\u0026 cd -\n         {{ .CLIName }} u {{\"${{\"}} matrix.config {{\"}}\"}}\n         {{ .CLIName }} obs u -f\n\n     - name: Run tests\n       working-directory: {{ .DevEnvRelPath }}/tests/{{ .ProductName }}\n       run: |\n         set -o pipefail\n         go test -v -count=1 -run 'Test{{\"${{\"}} matrix.name {{\"}}\"}}'\n\n     - name: Upload Logs\n       if: always()\n       uses: actions/upload-artifact@v4\n       with:\n         name: container-logs-{{\"${{\"}} matrix.name {{\"}}\"}}\n         path: {{ .DevEnvRelPath }}/tests/{{ .ProductName }}/logs\n         retention-days: 1\n`\n\n\tCIECRAuthActionTmpl = `name: 'AWS ECR Authentication'\ndescription: 'Configure AWS credentials and authenticate to ECR Public'\ninputs:\n  role-to-assume:\n    description: 'IAM role to assume'\n    required: true\n  aws-region:\n    description: 'AWS region'\n    required: true\n    default: 'us-west-2'\n  registry-type:\n    description: 'ECR registry type'\n    required: false\n    default: 'private'\n  registries:\n    description: 'ECR registry to login'\n    required: false\n\nruns:\n  using: \"composite\"\n  steps:\n    - name: Configure AWS credentials using OIDC\n      uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2\n      with:\n        role-to-assume: {{\"${{\"}} inputs.role-to-assume {{\"}}\"}}\n        aws-region: {{\"${{\"}} inputs.aws-region {{\"}}\"}}\n    - name: Authenticate to ECR\n      id: login-ecr\n      uses: aws-actions/amazon-ecr-login@062b18b96a7aff071d4dc91bc00c4c1a7945b076 # v2.0.1\n      with:\n        registry-type: {{\"${{\"}} inputs.registry-type {{\"}}\"}}\n        registries: {{\"${{\"}} inputs.registries {{\"}}\"}}\n        `\n\n\t// CIFunctionalTmpl is a continuous integration template for end-to-end smoke tests\n\tCIFunctionalTmpl = `name: End-to-end {{ .ProductName }} Tests\n\non:\n  pull_request:\n\ndefaults:\n  run:\n    working-directory: {{ .DevEnvRelPath }}\n\nconcurrency:\n  group: {{\"${{\"}} github.workflow {{\"}}\"}}-{{\"${{\"}} github.ref {{\"}}\"}}\n  cancel-in-progress: true\n\njobs:\n  e2e-tests:\n    permissions:\n      id-token: write\n      contents: read\n      pull-requests: write\n    runs-on: ubuntu-latest\n    strategy:\n      matrix:\n        include:\n          - name: Smoke\n            config: env.toml\n          # TODO: Add more test and environment configurations as needed\n    steps:\n      - name: Checkout code\n        uses: actions/checkout@v5\n        with:\n          fetch-depth: 0\n\n      - name: Set up Docker Buildx\n        uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1\n\n      - name: Install Just\n        uses: extractions/setup-just@e33e0265a09d6d736e2ee1e0eb685ef1de4669ff # v3\n        with:\n          just-version: '1.40.0'\n\n      - name: Authenticate to AWS ECR\n        uses: ./.github/actions/aws-ecr-auth\n        with:\n          role-to-assume: {{\"${{\"}} secrets.CCV_IAM_ROLE {{\"}}\"}}\n          aws-region: us-east-1\n          registry-type: public\n\n      - name: Authenticate to AWS ECR (JD)\n        uses: ./.github/actions/aws-ecr-auth\n        with:\n          role-to-assume: {{\"${{\"}} secrets.CCV_IAM_ROLE {{\"}}\"}}\n          aws-region: us-west-2\n          registry-type: private\n          registries: {{\"${{\"}} secrets.JD_REGISTRY {{\"}}\"}}\n\n      - name: Set up Go\n        uses: actions/setup-go@v6 # v6\n        with:\n          cache: true\n          go-version-file: {{ .DevEnvRelPath }}/go.mod\n          cache-dependency-path: {{ .DevEnvRelPath }}/go.sum\n\n      - name: Download Go dependencies\n        run: |\n          go mod download\n\n      - name: Run CCV environment\n        env:\n          JD_IMAGE: {{\"${{\"}} secrets.JD_IMAGE {{\"}}\"}}\n        run: |\n          cd cmd/{{ .CLIName }} \u0026\u0026 go install . \u0026\u0026 cd -\n          {{ .CLIName }} u {{\"${{\"}} matrix.config {{\"}}\"}}\n\n      - name: Run tests\n        working-directory: {{ .DevEnvRelPath }}/tests/{{ .ProductName }}\n        run: |\n          set -o pipefail\n          go test -v -count=1 -run 'Test{{\"${{\"}} matrix.name {{\"}}\"}}'\n\n      - name: Upload Logs\n        if: always()\n        uses: actions/upload-artifact@v4\n        with:\n          name: container-logs-{{\"${{\"}} matrix.name {{\"}}\"}}\n          path: {{ .DevEnvRelPath }}/tests/{{ .ProductName }}/logs\n          retention-days: 1\n`\n\n\t// CompletionTmpl is a go-prompt library completion template providing interactive prompt\n\tCompletionTmpl = `package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"os/exec\"\n\t\"strings\"\n\n\t\"github.com/c-bata/go-prompt\"\n)\n\nfunc getCommands() []prompt.Suggest {\n\treturn []prompt.Suggest{\n\t\t{Text: \"\", Description: \"Choose command, press \u003cspace\u003e for more options after selecting command\"},\n\t\t{Text: \"up\", Description: \"Spin up the development environment\"},\n\t\t{Text: \"down\", Description: \"Tear down the development environment\"},\n\t\t{Text: \"restart\", Description: \"Restart the development environment\"},\n\t\t{Text: \"test\", Description: \"Perform functional/non-functional testing\"},\n\t\t{Text: \"bs\", Description: \"Manage the Blockscout EVM block explorer\"},\n\t\t{Text: \"obs\", Description: \"Manage the observability stack\"},\n\t\t{Text: \"exit\", Description: \"Exit the interactive shell\"},\n\t}\n}\n\nfunc getSubCommands(parent string) []prompt.Suggest {\n\tswitch parent {\n\tcase \"test\":\n\t\treturn []prompt.Suggest{\n\t\t\t{Text: \"func\", Description: \"Run {{ .CLIName }} functional tests\"},\n\t\t\t{Text: \"perf\", Description: \"Run {{ .CLIName }} non-functional (performance) tests\"},\n\t\t}\n\tcase \"bs\":\n\t\treturn []prompt.Suggest{\n\t\t\t{Text: \"up\", Description: \"Spin up Blockscout and listen to dst chain (8555)\"},\n\t\t\t{Text: \"up -u http://host.docker.internal:8545 -c 1337\", Description: \"Spin up Blockscout and listen to src chain (8545)\"},\n\t\t\t{Text: \"down\", Description: \"Remove Blockscout stack\"},\n\t\t\t{Text: \"restart\", Description: \"Restart Blockscout and listen to dst chain (8555)\"},\n\t\t\t{Text: \"restart -u http://host.docker.internal:8545 -c 1337\", Description: \"Restart Blockscout and listen to src chain (8545)\"},\n\t\t}\n\tcase \"obs\":\n\t\treturn []prompt.Suggest{\n\t\t\t{Text: \"up\", Description: \"Spin up observability stack (Loki/Prometheus/Grafana)\"},\n\t\t\t{Text: \"up -f\", Description: \"Spin up full observability stack (Pyroscope, cadvisor, postgres exporter)\"},\n\t\t\t{Text: \"down\", Description: \"Spin down observability stack\"},\n\t\t\t{Text: \"restart\", Description: \"Restart observability stack\"},\n\t\t\t{Text: \"restart -f\", Description: \"Restart full observability stack\"},\n\t\t}\n\tcase \"u\":\n\t\tfallthrough\n\tcase \"up\":\n\t\tfallthrough\n\tcase \"r\":\n\t\tfallthrough\n\tcase \"restart\":\n\t\treturn []prompt.Suggest{\n\t\t\t{Text: \"env.toml,products/{{ .ProductName }}/basic.toml\", Description: \"Spin up Anvil \u003c\u003e Anvil local chains, all services, 4 CL nodes\"},\n\t\t\t{Text: \"env.toml,products/{{ .ProductName }}/basic.toml,products/{{ .ProductName }}/soak.toml\", Description: \"Spin up Anvil \u003c\u003e Anvil local chains, all services, 4 CL nodes\"},\n\t\t\t{Text: \"env.toml,products/{{ .ProductName }}/basic.toml,env-cl-rebuild.toml\", Description: \"Spin up Anvil \u003c\u003e Anvil local chains, all services, 4 CL nodes (custom build)\"},\n\t\t\t{Text: \"env.toml,products/{{ .ProductName }}/basic.toml,env-geth.toml\", Description: \"Spin up Geth \u003c\u003e Geth local chains (clique), all services, 4 CL nodes\"},\n\t\t\t{Text: \"env.toml,products/{{ .ProductName }}/basic.toml,env-fuji-fantom.toml\", Description: \"Spin up testnets: Fuji \u003c\u003e Fantom, all services, 4 CL nodes\"},\n\t\t}\n\tdefault:\n\t\treturn []prompt.Suggest{}\n\t}\n}\n\nfunc executor(in string) {\n\tcheckDockerIsRunning()\n\tin = strings.TrimSpace(in)\n\tif in == \"\" {\n\t\treturn\n\t}\n\tif in == \"exit\" {\n\t\tfmt.Println(\"Goodbye!\")\n\t\tos.Exit(0)\n\t}\n\n\targs := strings.Fields(in)\n\tos.Args = append([]string{\"{{ .CLIName }}\"}, args...)\n\tif err := rootCmd.Execute(); err != nil {\n\t\tfmt.Printf(\"Error: %v\\n\", err)\n\t}\n}\n\n// completer provides autocomplete suggestions for multi-word commands.\nfunc completer(in prompt.Document) []prompt.Suggest {\n\ttext := in.TextBeforeCursor()\n\twords := strings.Fields(text)\n\tlastCharIsSpace := len(text) \u003e 0 \u0026\u0026 text[len(text)-1] == ' '\n\n\tswitch {\n\tcase len(words) == 0:\n\t\treturn getCommands()\n\tcase len(words) == 1:\n\t\tif lastCharIsSpace {\n\t\t\treturn getSubCommands(words[0])\n\t\t} else {\n\t\t\treturn prompt.FilterHasPrefix(getCommands(), words[0], true)\n\t\t}\n\n\tcase len(words) \u003e= 2:\n\t\tif lastCharIsSpace {\n\t\t\treturn []prompt.Suggest{}\n\t\t} else {\n\t\t\tparent := words[0]\n\t\t\tcurrentWord := words[len(words)-1]\n\t\t\treturn prompt.FilterHasPrefix(getSubCommands(parent), currentWord, true)\n\t\t}\n\tdefault:\n\t\treturn []prompt.Suggest{}\n\t}\n}\n\n// resetTerm resets terminal settings to Unix defaults.\nfunc resetTerm() {\n\tcmd := exec.Command(\"stty\", \"sane\")\n\tcmd.Stdin = os.Stdin\n\tcmd.Stdout = os.Stdout\n\tcmd.Stderr = os.Stderr\n\tcmd.Run()\n}\n\nfunc StartShell() {\n\tdefer resetTerm()\n\tp := prompt.New(\n\t\texecutor,\n\t\tcompleter,\n\t\tprompt.OptionPrefix(\"{{ .CLIName }}\u003e \"),\n\t\tprompt.OptionPrefixTextColor(prompt.Yellow),\n\t\tprompt.OptionTitle(\"CCIP Interactive Shell\"),\n\t\tprompt.OptionMaxSuggestion(15),\n\t\tprompt.OptionShowCompletionAtStart(),\n\t\tprompt.OptionCompletionWordSeparator(\" \"),\n\t\tprompt.OptionSelectedSuggestionBGColor(prompt.LightGray),\n\t\tprompt.OptionSelectedSuggestionTextColor(prompt.Black),\n\t\tprompt.OptionDescriptionBGColor(prompt.DarkGray),\n\t\tprompt.OptionDescriptionTextColor(prompt.White),\n\t\tprompt.OptionSuggestionBGColor(prompt.Black),\n\t\tprompt.OptionSuggestionTextColor(prompt.Green),\n\t\tprompt.OptionScrollbarThumbColor(prompt.DarkGray),\n\t\tprompt.OptionScrollbarBGColor(prompt.Black),\n\t\tprompt.OptionAddKeyBind(prompt.KeyBind{\n\t\t\tKey: prompt.ControlC,\n\t\t\tFn: func(buf *prompt.Buffer) {\n\t\t\t\tfmt.Println(\"Interrupted, exiting...\")\n\t\t\t\tresetTerm()\n\t\t\t\tos.Exit(0)\n\t\t\t},\n\t\t}),\n\t)\n\tp.Run()\n}\n`\n\t// CLITmpl is a Cobra library CLI template with basic devenv commands\n\tCLITmpl = `package main\n\nimport (\n\t\t\"context\"\n\t\t\"fmt\"\n\t\t\"os\"\n\t\t\"os/exec\"\n\t\t\"syscall\"\n\n\t\t\"github.com/moby/moby/client\"\n\t\t\"github.com/spf13/cobra\"\n\n\t\t\"github.com/smartcontractkit/chainlink-testing-framework/framework\"\n\t\t\"{{ .DevEnvPkgImport }}\"\n)\n\nconst (\n\t\tLocalWASPLoadDashboard = \"http://localhost:3000/d/WASPLoadTests/wasp-load-test?orgId=1\u0026from=now-5m\u0026to=now\u0026refresh=5s\"\n\t\tLocal{{ .ProductName }}Dashboard      = \"http://localhost:3000/d/{{ .DashboardUUID }}/{{ .ProductName}}?orgId=1\u0026refresh=5s\"\n)\n\nvar rootCmd = \u0026cobra.Command{\n\tUse:   \"{{ .CLIName }}\",\n\tShort: \"A {{ .ProductName }} local environment tool\",\n\tPersistentPreRunE: func(cmd *cobra.Command, args []string) error {\n\t\tdebug, err := cmd.Flags().GetBool(\"debug\")\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif debug {\n\t\t\tframework.L.Info().Msg(\"Debug mode enabled, setting CTF_CLNODE_DLV=true\")\n\t\t\tos.Setenv(\"CTF_CLNODE_DLV\", \"true\")\n\t\t}\n\t\treturn nil\n\t},\n}\n\nvar restartCmd = \u0026cobra.Command{\n\tUse:     \"restart\",\n\tAliases: []string{\"r\"},\n\tArgs:    cobra.RangeArgs(0, 1),\n\tShort:   \"Restart development environment, remove apps and apply default configuration again\",\n\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\tvar configFile string\n\t\tif len(args) \u003e 0 {\n\t\t\tconfigFile = args[0]\n\t\t} else {\n\t\t\tconfigFile = \"env.toml,products/{{ .ProductName }}/basic.toml\"\n\t\t}\n\t\tframework.L.Info().Str(\"Config\", configFile).Msg(\"Reconfiguring development environment\")\n\t\t_ = os.Setenv(\"CTF_CONFIGS\", configFile)\n\t\t_ = os.Setenv(\"TESTCONTAINERS_RYUK_DISABLED\", \"true\")\n\t\tframework.L.Info().Msg(\"Tearing down the development environment\")\n\t\terr := framework.RemoveTestContainers()\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to clean Docker resources: %w\", err)\n\t\t}\n\t\treturn devenv.NewEnvironment(context.Background())\n\t},\n}\n\nvar upCmd = \u0026cobra.Command{\n\tUse:     \"up\",\n\tAliases: []string{\"u\"},\n\tShort:   \"Spin up the development environment\",\n\tArgs:    cobra.RangeArgs(0, 1),\n\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\tvar configFile string\n\t\tif len(args) \u003e 0 {\n\t\t\tconfigFile = args[0]\n\t\t} else {\n\t\t\tconfigFile = \"env.toml,products/{{ .ProductName }}/basic.toml\"\n\t\t}\n\t\tframework.L.Info().Str(\"Config\", configFile).Msg(\"Creating development environment\")\n\t\t_ = os.Setenv(\"CTF_CONFIGS\", configFile)\n\t\t_ = os.Setenv(\"TESTCONTAINERS_RYUK_DISABLED\", \"true\")\n\t\treturn devenv.NewEnvironment(context.Background())\n\t},\n}\n\nvar downCmd = \u0026cobra.Command{\n\tUse:     \"down\",\n\tAliases: []string{\"d\"},\n\tShort:   \"Tear down the development environment\",\n\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\tframework.L.Info().Msg(\"Tearing down the development environment\")\n\t\terr := framework.RemoveTestContainers()\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to clean Docker resources: %w\", err)\n\t\t}\n\t\treturn nil\n\t},\n}\n\nvar bsCmd = \u0026cobra.Command{\n\tUse:   \"bs\",\n\tShort: \"Manage the Blockscout EVM block explorer\",\n\tLong:  \"Spin up or down the Blockscout EVM block explorer\",\n}\n\nvar bsUpCmd = \u0026cobra.Command{\n\tUse:     \"up\",\n\tAliases: []string{\"u\"},\n\tShort:   \"Spin up Blockscout EVM block explorer\",\n\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\turl, _ := bsCmd.Flags().GetString(\"url\")\n\t\tchainID, _ := bsCmd.Flags().GetString(\"chain-id\")\n\t\treturn framework.BlockScoutUp(url, chainID)\n\t},\n}\n\nvar bsDownCmd = \u0026cobra.Command{\n\tUse:     \"down\",\n\tAliases: []string{\"d\"},\n\tShort:   \"Spin down Blockscout EVM block explorer\",\n\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\turl, _ := bsCmd.Flags().GetString(\"url\")\n\t\treturn framework.BlockScoutDown(url)\n\t},\n}\n\nvar bsRestartCmd = \u0026cobra.Command{\n\tUse:     \"restart\",\n\tAliases: []string{\"r\"},\n\tShort:   \"Restart the Blockscout EVM block explorer\",\n\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\turl, _ := bsCmd.Flags().GetString(\"url\")\n\t\tchainID, _ := bsCmd.Flags().GetString(\"chain-id\")\n\t\tif err := framework.BlockScoutDown(url); err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn framework.BlockScoutUp(url, chainID)\n\t},\n}\n\nvar obsCmd = \u0026cobra.Command{\n\tUse:   \"obs\",\n\tShort: \"Manage the observability stack\",\n\tLong:  \"Spin up or down the observability stack with subcommands 'up' and 'down'\",\n}\n\nvar obsUpCmd = \u0026cobra.Command{\n\tUse:     \"up\",\n\tAliases: []string{\"u\"},\n\tShort:   \"Spin up the observability stack\",\n\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\tfull, _ := cmd.Flags().GetBool(\"full\")\n\t\tvar err error\n\t\tif full {\n\t\t\terr = framework.ObservabilityUpFull()\n\t\t} else {\n\t\t\terr = framework.ObservabilityUp()\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"observability up failed: %w\", err)\n\t\t}\n\t\tdevenv.L.Info().Msgf(\"{{ .ProductName }} Dashboard: %s\", Local{{ .ProductName }}Dashboard)\n\t\tdevenv.L.Info().Msgf(\"{{ .ProductName }} Perf Test Dashboard: %s\", LocalWASPLoadDashboard)\n\t\treturn nil\n\t},\n}\n\nvar obsDownCmd = \u0026cobra.Command{\n\tUse:     \"down\",\n\tAliases: []string{\"d\"},\n\tShort:   \"Spin down the observability stack\",\n\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\treturn framework.ObservabilityDown()\n\t},\n}\n\nvar obsRestartCmd = \u0026cobra.Command{\n\tUse:     \"restart\",\n\tAliases: []string{\"r\"},\n\tShort:   \"Restart the observability stack (data wipe)\",\n\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\tif err := framework.ObservabilityDown(); err != nil {\n\t\t\treturn fmt.Errorf(\"observability down failed: %w\", err)\n\t\t}\n\t\tfull, _ := cmd.Flags().GetBool(\"full\")\n\t\tvar err error\n\t\tif full {\n\t\t\terr = framework.ObservabilityUpFull()\n\t\t} else {\n\t\t\terr = framework.ObservabilityUp()\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"observability up failed: %w\", err)\n\t\t}\n\t\tdevenv.L.Info().Msgf(\"{{ .ProductName }} Dashboard: %s\", Local{{ .ProductName }}Dashboard)\n\t\tdevenv.L.Info().Msgf(\"{{ .ProductName }} Perf Dashboard: %s\", LocalWASPLoadDashboard)\n\t\treturn nil\n\t},\n}\n\nvar testCmd = \u0026cobra.Command{\n\tUse:     \"test\",\n\tAliases: []string{\"t\"},\n\tShort:   \"Run the tests\",\n\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\tif len(args) != 1 {\n\t\t\treturn fmt.Errorf(\"specify the test suite: func or perf\")\n\t\t}\n\t\tvar testPattern string\n\t\tswitch args[0] {\n\t\tcase \"func\":\n\t\t\ttestPattern = \"TestFunctional\"\n\t\tcase \"perf\":\n\t\t\ttestPattern = \"TestNonFunctional\"\n\t\tdefault:\n\t\t\treturn fmt.Errorf(\"test suite %s is unknown, choose between smoke or load\", args[0])\n\t\t}\n\n\t\ttestCmd := exec.Command(\"go\", \"test\", \"-v\", \"-run\", testPattern)\n\t\ttestCmd.Dir = \"./tests/{{ .ProductName }}\"\n\t\ttestCmd.Stdout = os.Stdout\n\t\ttestCmd.Stderr = os.Stderr\n\t\ttestCmd.Stdin = os.Stdin\n\n\t\tif err := testCmd.Run(); err != nil {\n\t\t\tif exitError, ok := err.(*exec.ExitError); ok {\n\t\t\t\tif status, ok := exitError.Sys().(syscall.WaitStatus); ok {\n\t\t\t\t\tos.Exit(status.ExitStatus())\n\t\t\t\t}\n\t\t\t\tos.Exit(1)\n\t\t\t}\n\t\t\treturn fmt.Errorf(\"failed to run test command: %w\", err)\n\t\t}\n\t\treturn nil\n\t},\n}\n\nfunc init() {\n\trootCmd.PersistentFlags().BoolP(\"debug\", \"d\", false, \"Enable running services with dlv to allow remote debugging.\")\n\n\trootCmd.AddCommand(testCmd)\n\n\t// Blockscout, on-chain debug\n\tbsCmd.PersistentFlags().StringP(\"url\", \"u\", \"http://host.docker.internal:8555\", \"EVM RPC node URL (default to dst chain on 8555\")\n\tbsCmd.PersistentFlags().StringP(\"chain-id\", \"c\", \"2337\", \"RPC's Chain ID\")\n\tbsCmd.AddCommand(bsUpCmd)\n\tbsCmd.AddCommand(bsDownCmd)\n\tbsCmd.AddCommand(bsRestartCmd)\n\trootCmd.AddCommand(bsCmd)\n\n\t// observability\n\tobsCmd.PersistentFlags().BoolP(\"full\", \"f\", false, \"Enable full observability stack with additional components\")\n\tobsCmd.AddCommand(obsRestartCmd)\n\tobsCmd.AddCommand(obsUpCmd)\n\tobsCmd.AddCommand(obsDownCmd)\n\trootCmd.AddCommand(obsCmd)\n\n\t// main env commands\n\trootCmd.AddCommand(upCmd)\n\trootCmd.AddCommand(restartCmd)\n\trootCmd.AddCommand(downCmd)\n}\n\nfunc checkDockerIsRunning() {\n\tcli, err := client.NewClientWithOpts(client.FromEnv)\n\tif err != nil {\n\t\tfmt.Println(\"Can't create Docker client, please check if Docker daemon is running!\")\n\t\tos.Exit(1)\n\t}\n\tdefer cli.Close()\n\t_, err = cli.Ping(context.Background(), client.PingOptions{})\n\tif err != nil {\n\t\tfmt.Println(\"Docker is not running, please start Docker daemon first!\")\n\t\tos.Exit(1)\n\t}\n}\n\nfunc main() {\n\tcheckDockerIsRunning()\n\tif len(os.Args) == 2 \u0026\u0026 (os.Args[1] == \"shell\" || os.Args[1] == \"sh\") {\n\t\t_ = os.Setenv(\"CTF_CONFIGS\", \"env.toml\") // Set default config for shell\n\n\t\tStartShell()\n\t\treturn\n\t}\n\tif err := rootCmd.Execute(); err != nil {\n\t\tdevenv.L.Err(err).Send()\n\t\tos.Exit(1)\n\t}\n}`\n\t// LoadTestTmpl is a load/chaos test template\n\tLoadTestTmpl = `package devenv_test\n\nimport (\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/go-resty/resty/v2\"\n\t\"github.com/stretchr/testify/require\"\n\n\tde \"{{ .GoModName }}\"\n\n\t\"github.com/smartcontractkit/{{ .ProductName }}/devenv/products\"\n\t\"github.com/smartcontractkit/{{ .ProductName }}/devenv/products/{{ .ProductName }}\"\n\n\t\"github.com/smartcontractkit/chainlink-testing-framework/framework/chaos\"\n\t\"github.com/smartcontractkit/chainlink-testing-framework/framework/clclient\"\n\t\"github.com/smartcontractkit/chainlink-testing-framework/wasp\"\n)\n\ntype ExampleGun struct {\n\ttarget string\n\tclient *resty.Client\n\tData   []string\n}\n\nfunc NewExampleHTTPGun(target string) *ExampleGun {\n\treturn \u0026ExampleGun{\n\t\tclient: resty.New(),\n\t\ttarget: target,\n\t\tData:   make([]string, 0),\n\t}\n}\n\n// Call implements example gun call, assertions on response bodies should be done here\nfunc (m *ExampleGun) Call(l *wasp.Generator) *wasp.Response {\n\tvar result map[string]any\n\tr, err := m.client.R().\n\t\tSetResult(\u0026result).\n\t\tGet(m.target)\n\tif err != nil {\n\t\treturn \u0026wasp.Response{Data: result, Error: err.Error()}\n\t}\n\tif r.Status() != \"200 OK\" {\n\t\treturn \u0026wasp.Response{Data: result, Error: \"not 200\", Failed: true}\n\t}\n\treturn \u0026wasp.Response{Data: result}\n}\n\nfunc TestNonFunctional(t *testing.T) {\n\tin, err := de.LoadOutput[de.Cfg](\"../../env-out.toml\")\n\trequire.NoError(t, err)\n\tinProduct, err := products.LoadOutput[{{ .ProductName }}.Configurator](\"../../env-out.toml\")\n\trequire.NoError(t, err)\n\n\t_ = inProduct\n\n\tclNodes, err := clclient.New(in.NodeSets[0].Out.CLNodes)\n\trequire.NoError(t, err)\n\n\t// use local observability stack for Docker load/chaos tests\n\tt.Setenv(\"LOKI_URL\", \"http://localhost:3030/loki/api/v1/push\")\n\n\t// define labels for differentiate one run from another\n\tlabels := map[string]string{\n\t\t\"go_test_name\": \"generator_healthcheck\",\n\t\t\"gen_name\":     \"generator_healthcheck\",\n\t\t\"branch\":       \"test\",\n\t\t\"commit\":       \"test\",\n\t}\n\n\t// create a WASP generator\n\tgen, err := wasp.NewGenerator(\u0026wasp.Config{\n\t\tLoadType: wasp.RPS,\n\t\tT:        t,\n\t\t// just use plain line profile - 1 RPS for 60s\n\t\tSchedule:   wasp.Plain(1, 60*time.Second),\n\t\tGun:        NewExampleHTTPGun(\"https://example.com\"),\n\t\tLabels:     labels,\n\t\tLokiConfig: wasp.NewEnvLokiConfig(),\n\t})\n\trequire.NoError(t, err)\n\tgen.Run(false)\n\n\t// define chaos test cases\n\ttestCases := []struct {\n\t\tname     string\n\t\tcommand  string\n\t\twait     time.Duration\n\t\tvalidate func(c []*clclient.ChainlinkClient) error\n\t}{\n\t\t{\n\t\t\tname:    \"Reboot the pods\",\n\t\t\twait:    20 * time.Second,\n\t\t\tcommand: \"stop --duration=20s --restart re2:don-node0\",\n\t\t\tvalidate: func(c []*clclient.ChainlinkClient) error {\n\t\t\t\treturn nil\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname:    \"Introduce network delay\",\n\t\t\twait:    20 * time.Second,\n\t\t\tcommand: \"netem --tc-image=gaiadocker/iproute2 --duration=20s delay --time=1000 re2:don-node.*\",\n\t\t\tvalidate: func(c []*clclient.ChainlinkClient) error {\n\t\t\t\treturn nil\n\t\t\t},\n\t\t},\n\t}\n\n\t// Run chaos test cases\n\tfor _, tc := range testCases {\n\t\tt.Run(tc.name, func(t *testing.T) {\n\t\t\tt.Log(tc.name)\n\t\t\t_, err = chaos.ExecPumba(tc.command, tc.wait)\n\t\t\trequire.NoError(t, err)\n\t\t\terr = tc.validate(clNodes)\n\t\t\trequire.NoError(t, err)\n\t\t})\n\t}\n\t// wait for the workload to finish\n\t_, failed := gen.Wait()\n\trequire.False(t, failed)\n}\n`\n\n\tSmokeTestImplTmpl = `package devenv_test\n\nimport (\n\t\"testing\"\n\n\t\"github.com/go-resty/resty/v2\"\n\tde \"{{ .GoModName }}\"\n\n\t\"github.com/smartcontractkit/{{ .ProductName }}/devenv/products\"\n\t\"github.com/smartcontractkit/{{ .ProductName }}/devenv/products/{{ .ProductName }}\"\n\n\t\"github.com/smartcontractkit/chainlink-testing-framework/framework/clclient\"\n\t\"github.com/stretchr/testify/require\"\n)\n\nvar L = de.L\n\nfunc TestFunctional(t *testing.T) {\n\tin, err := de.LoadOutput[de.Cfg](\"../../env-out.toml\")\n\trequire.NoError(t, err)\n\tinProduct, err := products.LoadOutput[{{ .ProductName }}.Configurator](\"../../env-out.toml\")\n\trequire.NoError(t, err)\n\tclNodes, err := clclient.New(in.NodeSets[0].Out.CLNodes)\n\trequire.NoError(t, err)\n\n\t// environment TOML config\n\t_ = in\n\t// fake server endpoint\n\tr := resty.New().SetBaseURL(in.FakeServer.Out.BaseURLHost)\n\t_, _ = r.R().Get(\"/my-fake-endpoint\")\n\t// product config\n\t_ = inProduct\n\n\ttests := []struct {\n\t\tname    string\n\t\tclNodes []*clclient.ChainlinkClient\n\t}{\n\t\t{\n\t\t\tname: \"feature_1\",\n\t\t},\n\t\t{\n\t\t\tname: \"feature_2\",\n\t\t},\n\t}\n\n\tfor _, tt := range tests {\n\t\tt.Run(tt.name, func(t *testing.T) {\n\t\t\t_ = clNodes\n\t\t})\n\t}\n}\n`\n\t// JDTmpl is a JobDistributor client wrappers\n\tJDTmpl = `package {{ .PackageName }}\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\n\t\"google.golang.org/grpc\"\n\t\"google.golang.org/grpc/credentials/insecure\"\n\n\tcsav1 \"github.com/smartcontractkit/chainlink-protos/job-distributor/v1/csa\"\n\tjobv1 \"github.com/smartcontractkit/chainlink-protos/job-distributor/v1/job\"\n\tnodev1 \"github.com/smartcontractkit/chainlink-protos/job-distributor/v1/node\"\n)\n\ntype JobDistributor struct {\n\tnodev1.NodeServiceClient\n\tjobv1.JobServiceClient\n\tcsav1.CSAServiceClient\n\tWSRPC string\n}\n\ntype JDConfig struct {\n\tGRPC  string\n\tWSRPC string\n}\n\nfunc (jd JobDistributor) GetCSAPublicKey(ctx context.Context) (string, error) {\n\tkeypairs, err := jd.ListKeypairs(ctx, \u0026csav1.ListKeypairsRequest{})\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tif keypairs == nil || len(keypairs.Keypairs) == 0 {\n\t\treturn \"\", errors.New(\"no keypairs found\")\n\t}\n\tcsakey := keypairs.Keypairs[0].PublicKey\n\treturn csakey, nil\n}\n\n// ProposeJob proposes jobs through the jobService and accepts the proposed job on selected node based on ProposeJobRequest.NodeId.\nfunc (jd JobDistributor) ProposeJob(ctx context.Context, in *jobv1.ProposeJobRequest, opts ...grpc.CallOption) (*jobv1.ProposeJobResponse, error) {\n\tres, err := jd.JobServiceClient.ProposeJob(ctx, in, opts...)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to propose job. err: %w\", err)\n\t}\n\tif res.Proposal == nil {\n\t\treturn nil, errors.New(\"failed to propose job. err: proposal is nil\")\n\t}\n\n\treturn res, nil\n}\n\n// NewJDConnection creates new gRPC connection with JobDistributor.\nfunc NewJDConnection(cfg JDConfig) (*grpc.ClientConn, error) {\n\topts := []grpc.DialOption{\n\t\tgrpc.WithTransportCredentials(insecure.NewCredentials()),\n\t}\n\tinterceptors := []grpc.UnaryClientInterceptor{}\n\n\tif len(interceptors) \u003e 0 {\n\t\topts = append(opts, grpc.WithChainUnaryInterceptor(interceptors...))\n\t}\n\n\tconn, err := grpc.NewClient(cfg.GRPC, opts...)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to connect Job Distributor service. Err: %w\", err)\n\t}\n\n\treturn conn, nil\n}\n`\n\t// DebugToolsTmpl is a template for various debug tools, tracing, tx debug, etc\n\tDebugToolsTmpl = `package {{ .PackageName }}\n\nimport (\n\t\"os\"\n\t\"runtime/trace\"\n)\n\n\nfunc tracing() func() {\n\tf, err := os.Create(\"trace.out\")\n\tif err != nil {\n\t\tpanic(\"can't create trace.out file\")\n\t}\n\tif err := trace.Start(f); err != nil {\n\t\tpanic(\"can't start tracing\")\n\t}\n\treturn func() {\n\t\ttrace.Stop()\n\t\tf.Close()\n\t}\n}\n`\n\t// ConfigTmpl is a template for reading and writing devenv configuration (env.toml, env-out.toml)\n\tConfigTmpl = `package {{ .PackageName }}\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strings\"\n\n\t\"github.com/davecgh/go-spew/spew\"\n\t\"github.com/pelletier/go-toml/v2\"\n\t\"github.com/rs/zerolog\"\n)\n\nconst (\n\t// DefaultConfigDir is the default directory we are expecting TOML config to be.\n\tDefaultConfigDir = \".\"\n\t// EnvVarTestConfigs is the environment variable name to read config paths from, ex.: CTF_CONFIGS=env.toml,overrides.toml.\n\tEnvVarTestConfigs = \"CTF_CONFIGS\"\n\t// DefaultOverridesFilePath is the default overrides.toml file path.\n\tDefaultOverridesFilePath = \"overrides.toml\"\n\t// DefaultAnvilKey is a default, well-known Anvil first key\n\tDefaultAnvilKey = \"ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80\"\n)\n\n// Load loads TOML configurations from environment variable, ex.: CTF_CONFIGS=env.toml,overrides.toml\n// and unmarshalls the files from left to right overriding keys.\nfunc Load[T any]() (*T, error) {\n\tvar config T\n\tpaths := strings.Split(os.Getenv(EnvVarTestConfigs), \",\")\n\tfor _, path := range paths {\n\t\tL.Info().Str(\"Path\", path).Msg(\"Loading configuration input\")\n\t\tdata, err := os.ReadFile(filepath.Join(DefaultConfigDir, path)) //nolint:gosec\n\t\tif err != nil {\n\t\t\tif path == DefaultOverridesFilePath {\n\t\t\t\tL.Info().Str(\"Path\", path).Msg(\"Overrides file not found or empty\")\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\treturn nil, fmt.Errorf(\"error reading config file %s: %w\", path, err)\n\t\t}\n\t\tif L.GetLevel() == zerolog.TraceLevel {\n\t\t\tfmt.Println(string(data)) //nolint:forbidigo\n\t\t}\n\n\t\tdecoder := toml.NewDecoder(strings.NewReader(string(data)))\n\n\t\tif err := decoder.Decode(\u0026config); err != nil {\n\t\t\tvar details *toml.StrictMissingError\n\t\t\tif errors.As(err, \u0026details) {\n\t\t\t\tfmt.Println(details.String()) //nolint:forbidigo\n\t\t\t}\n\t\t\treturn nil, fmt.Errorf(\"failed to decode TOML config, strict mode: %s\", err)\n\t\t}\n\t}\n\tif L.GetLevel() == zerolog.TraceLevel {\n\t\tL.Trace().Msg(\"Merged inputs\")\n\t\tspew.Dump(config) //nolint:forbidigo\n\t}\n\treturn \u0026config, nil\n}\n\n// Store writes config to a file, adds -cache.toml suffix if it's an initial configuration.\nfunc Store[T any](cfg *T) error {\n\tbaseConfigPath, err := BaseConfigPath()\n\tif err != nil {\n\t\treturn err\n\t}\n\tnewCacheName := strings.ReplaceAll(baseConfigPath, \".toml\", \"\")\n\tvar outCacheName string\n\tif strings.Contains(newCacheName, \"cache\") {\n\t\tL.Info().Str(\"Cache\", baseConfigPath).Msg(\"Cache file already exists, overriding\")\n\t\toutCacheName = baseConfigPath\n\t} else {\n\t\toutCacheName = fmt.Sprintf(\"%s-out.toml\", strings.ReplaceAll(baseConfigPath, \".toml\", \"\"))\n\t}\n\tL.Info().Str(\"OutputFile\", outCacheName).Msg(\"Storing configuration output\")\n\td, err := toml.Marshal(cfg)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn os.WriteFile(filepath.Join(DefaultConfigDir, outCacheName), d, 0o644)\n}\n\n// LoadOutput loads config output file from path.\nfunc LoadOutput[T any](path string) (*T, error) {\n\t_ = os.Setenv(EnvVarTestConfigs, path)\n\treturn Load[T]()\n}\n\n// BaseConfigPath returns base config path, ex. env.toml,overrides.toml -\u003e env.toml.\nfunc BaseConfigPath() (string, error) {\n\tconfigs := os.Getenv(EnvVarTestConfigs)\n\tif configs == \"\" {\n\t\treturn \"\", fmt.Errorf(\"no %s env var is provided, you should provide at least one test config in TOML\", EnvVarTestConfigs)\n\t}\n\tL.Debug().Str(\"Configs\", configs).Msg(\"Getting base config path\")\n\treturn strings.Split(configs, \",\")[0], nil\n}\n\n// GetNetworkPrivateKey gets network private key or fallback to default simulator key (Anvil's first key)\nfunc GetNetworkPrivateKey() string {\n\tpk := os.Getenv(\"PRIVATE_KEY\")\n\tif pk == \"\" {\n\t\t// that's the first Anvil and Geth private key, serves as a fallback for local testing if not overridden\n\t\treturn DefaultAnvilKey\n\t}\n\treturn pk\n}\n`\n\n\t// EnvironmentTmpl is an environment.go template - main file for environment composition\n\tEnvironmentTmpl = `package {{ .PackageName }}\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n\n\t\"github.com/rs/zerolog\"\n\t\"github.com/rs/zerolog/log\"\n\n\t\"github.com/smartcontractkit/chainlink-testing-framework/framework\"\n\t\"github.com/smartcontractkit/chainlink-testing-framework/framework/components/blockchain\"\n\t\"github.com/smartcontractkit/chainlink-testing-framework/framework/components/fake\"\n\t\"github.com/smartcontractkit/chainlink-testing-framework/framework/components/jd\"\n\t\"github.com/smartcontractkit/{{ .ProductName }}/devenv/products/{{ .ProductName }}\"\n\t\"github.com/smartcontractkit/{{ .ProductName }}/devenv/services\"\n\n\tns \"github.com/smartcontractkit/chainlink-testing-framework/framework/components/simple_node_set\"\n)\n\nvar L = log.Output(zerolog.ConsoleWriter{Out: os.Stderr}).Level(zerolog.DebugLevel).With().Fields(map[string]any{\"component\": \"{{ .ProductName }}\"}).Logger()\n\ntype ProductInfo struct {\n\tName      string ` + \"`\" + `toml:\"name\"` + \"`\" + `\n\tInstances int    ` + \"`\" + `toml:\"instances\"` + \"`\" + `\n}\n\ntype Cfg struct {\n\tProducts    []*ProductInfo      ` + \"`\" + `toml:\"products\"` + \"`\" + `\n\tService     *services.ExampleSvcInput ` + \"`\" + `toml:\"example_service\"` + \"`\" + `\n\tBlockchains []*blockchain.Input ` + \"`\" + `toml:\"blockchains\" validate:\"required\"` + \"`\" + `\n\tFakeServer  *fake.Input         ` + \"`\" + `toml:\"fake_server\" validate:\"required\"` + \"`\" + `\n\tNodeSets    []*ns.Input         ` + \"`\" + `toml:\"nodesets\"    validate:\"required\"` + \"`\" + `\n\tJD          *jd.Input           ` + \"`\" + `toml:\"jd\"` + \"`\" + `\n}\n\nfunc newProduct(name string) (Product, error) {\n\tswitch name {\n\tcase \"{{ .ProductName }}\":\n\t\treturn {{ .ProductName }}.NewConfigurator(), nil\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"unknown product type: %s\", name)\n\t}\n}\n\nfunc NewEnvironment(ctx context.Context) error {\n\tif err := framework.DefaultNetwork(nil); err != nil {\n\t\treturn err\n\t}\n\tin, err := Load[Cfg]()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to load configuration: %w\", err)\n\t}\n\tfor _, bcNet := range in.Blockchains {\n\t\t_, err = blockchain.NewBlockchainNetwork(bcNet)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to create blockchain network %s: %w\", bcNet.ChainID, err)\n\t\t}\n\t}\n\tif os.Getenv(\"FAKE_SERVER_IMAGE\") != \"\" {\n\t\tin.FakeServer.Image = os.Getenv(\"FAKE_SERVER_IMAGE\")\n\t}\n\t_, err = fake.NewDockerFakeDataProvider(in.FakeServer)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to create fake data provider: %w\", err)\n\t}\n\n\tif err := services.NewService(in.Service); err != nil {\n\t\treturn fmt.Errorf(\"failed to create example service: %w\", err)\n\t}\n\n\t// get all the product orchestrations, generate product specific overrides\n\tproductConfigurators := make([]Product, 0)\n\tnodeConfigs := make([]string, 0)\n\tnodeSecrets := make([]string, 0)\n\tfor _, product := range in.Products {\n\t\tp, err := newProduct(product.Name)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif err = p.Load(); err != nil {\n\t\t\treturn fmt.Errorf(\"failed to load product config: %w\", err)\n\t\t}\n\n\t\tcfg, err := p.GenerateNodesConfig(ctx, in.FakeServer, in.Blockchains, in.NodeSets)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to generate CL nodes config: %w\", err)\n\t\t}\n\t\tnodeConfigs = append(nodeConfigs, cfg)\n\n\t\tsecrets, err := p.GenerateNodesSecrets(ctx, in.FakeServer, in.Blockchains, in.NodeSets)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to generate CL nodes config: %w\", err)\n\t\t}\n\t\tnodeSecrets = append(nodeSecrets, secrets)\n\n\t\tproductConfigurators = append(productConfigurators, p)\n\t}\n\n\t// merge overrides, spin up node sets and write infrastructure outputs\n\t// infra is always common for all the products, if it can't be we should fail\n\t// user should use different infra layout in env.toml then\n\tfor _, nodeSet := range in.NodeSets {\n\t\tfor _, nodeSpec := range nodeSet.NodeSpecs {\n\t\t\tnodeSpec.Node.TestConfigOverrides = strings.Join(nodeConfigs, \"\\n\")\n\t\t\tnodeSpec.Node.TestSecretsOverrides = strings.Join(nodeSecrets, \"\\n\")\n\t\t\tif os.Getenv(\"CHAINLINK_IMAGE\") != \"\" {\n\t\t\t\tnodeSpec.Node.Image = os.Getenv(\"CHAINLINK_IMAGE\")\n\t\t\t}\n\t\t}\n\t\t_, err = ns.NewSharedDBNodeSet(nodeSet, nil)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to create new shared db node set: %w\", err)\n\t\t}\n\t}\n\tif err := Store(in); err != nil {\n\t\treturn err\n\t}\n\n\t// deploy all products and all instances,\n\t// product config function controls what to read and how to orchestrate each instance\n\t// via their own TOML part, we only deploy N instances of product M\n\tfor productIdx, productInfo := range in.Products {\n\t\tfor productInstance := range productInfo.Instances {\n\t\t\terr = productConfigurators[productIdx].ConfigureJobsAndContracts(\n\t\t\t\tctx,\n\t\t\t\tproductInstance,\n\t\t\t\tin.FakeServer,\n\t\t\t\tin.Blockchains,\n\t\t\t\tin.NodeSets,\n\t\t\t)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"failed to setup default product deployment: %w\", err)\n\t\t\t}\n\t\t\tif err := productConfigurators[productIdx].Store(\"env-out.toml\", productInstance); err != nil {\n\t\t\t\treturn errors.New(\"failed to store product config\")\n\t\t\t}\n\t\t}\n\t}\n\tfor nsIdx, ns := range in.NodeSets {\n\t\tL.Info().Int(\"Idx\", nsIdx).Str(\"Name\", ns.Name).Msg(\"Created node set\")\n\t\tfor _, n := range ns.Out.CLNodes {\n\t\t\tL.Info().Str(\"Node\", n.Node.ExternalURL).Send()\n\t\t}\n\t}\n\treturn nil\n}\n`\n\t// JustFileTmpl is a Justfile template used for building and publishing Docker images\n\tJustFileTmpl = `set fallback\n\n# Default: show available recipes\ndefault:\n    just --list\n\nclean:\n    rm -rf compose/ blockscout/\n\nbuild-fakes:\n    just fakes/build\n\npush-fakes:\n    just fakes/push\n\n# Rebuild CLI\n@cli:\n    pushd cmd/{{ .CLIName }} \u003e /dev/null \u0026\u0026 go install -ldflags=\"-X main.Version=1.0.0\" . \u0026\u0026 popd \u003e /dev/null`\n)\n```\n\n```go\nconst (\n\tProductSoakConfigTmpl = `# This file describes how many instances of your product we should deploy for soak test\n# you can also override keys from other configs here, for example your [[{{ .ProductName }}]] or [[blockchains]] / [[nodesets]]\n[[products]]\nname = \"{{ .ProductName }}\"\ninstances = 10\n`\n\n\tProductBasicConfigTmpl = `# TODO: define your product configuration here, see configurator.go ProductConfig\n[[{{ .ProductName}}]]\n# TODO: define your product configurator outputs so tests can verify your product\n[{{ .ProductName }}.out]\n`\n\n\tProductsImplTmpl = `package {{ .ProductName }}\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\n\t\"github.com/rs/zerolog\"\n\t\"github.com/rs/zerolog/log\"\n\n\t\"github.com/smartcontractkit/chainlink-testing-framework/framework/components/blockchain\"\n\t\"github.com/smartcontractkit/chainlink-testing-framework/framework/components/fake\"\n\t\"github.com/smartcontractkit/chainlink-testing-framework/framework/clclient\"\n\tnodeset \"github.com/smartcontractkit/chainlink-testing-framework/framework/components/simple_node_set\"\n\t\"github.com/smartcontractkit/{{ .ProductName }}/devenv/products\"\n)\n\n/*\nThis is the implementation of your product configuration running on Chainlink platform.\n*/\n\nvar L = log.Output(zerolog.ConsoleWriter{Out: os.Stderr}).Level(zerolog.DebugLevel).With().Fields(map[string]any{\"component\": \"{{ .ProductName }}\"}).Logger()\n\n// ProductConfig contains fields you want to be configurable for your product setup, don't forget to add \"toml\" annotations, use snake_case.\n// Out field is mandatory if you want tests to read some data about your product.\ntype ProductConfig struct {\n\tOut *ProductConfigOutput ` + \"`\" + `toml:\"out\"` + \"`\" + `\n}\n\n// ProductConfigOutput contains fields that are exposed after your product is deployed,\n// for example: contract addresses, services URLs, etc.\ntype ProductConfigOutput struct {\n\tExampleField string ` + \"`\" + `toml:\"example\"` + \"`\" + `\n}\n\n// Configurator is your product configurator, it may contain configs for multiple instances of your product deployed on a single environment.\n// For example, for soak/volume testing it makes sense to deploy 10-100 feeds with slightly different configurations to figure out performance and resource consumption.\ntype Configurator struct {\n\tConfig []*ProductConfig ` + \"`\" + `toml:\"{{ .ProductName }}\"` + \"`\" + `\n}\n\n// NewConfigurator creates new configurator instance\nfunc NewConfigurator() *Configurator {\n\treturn \u0026Configurator{}\n}\n\n// Load implements loading product-specific config from TOML file, see products/config.go\n// Most of the time you don't need to change anything here.\nfunc (m *Configurator) Load() error {\n\tcfg, err := products.Load[Configurator]()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to load product config: %w\", err)\n\t}\n\tm.Config = cfg.Config\n\treturn nil\n}\n\n// Store implements storing your configuration outputs in \"env-out.toml\" file.\n// You may store different outputs for each instance of your product (for example different outputs for each OCR feed when you deploy tens of them).\n// Most of the time you don't need to change anything here.\nfunc (m *Configurator) Store(path string, idx int) error {\n\tif err := products.Store(\".\", m); err != nil {\n\t\treturn fmt.Errorf(\"failed to store product config: %w\", err)\n\t}\n\treturn nil\n}\n\n// GenerateNodesConfig implements how your product configures Chainlink nodes via TOML config\n// Use Chainlink client from framework if needed and generate TOML config for Chainlink nodes.\nfunc (m *Configurator) GenerateNodesConfig(\n\tctx context.Context,\n\tfs *fake.Input,\n\tbc []*blockchain.Input,\n\tns []*nodeset.Input,\n) (string, error) {\n\tL.Info().Msg(\"Generating Chainlink node config\")\n\t// in this case we have only a single node set\n\tfirstNodeSet := ns[0]\n\t_ = firstNodeSet\n\n\t// in this case we only have a single blockchain type\n\tfirstBlockchain := bc[0]\n\n\t// environment config for CL nodes\n\t_ = firstBlockchain.Out.Nodes[0]\n\t// chain ID\n\t_ = firstBlockchain.Out.ChainID\n\treturn \"\", nil\n}\n\nfunc (m *Configurator) GenerateNodesSecrets(\n\tctx context.Context,\n\tfs *fake.Input,\n\tbc []*blockchain.Input,\n\tns []*nodeset.Input,\n) (string, error) {\n\tL.Info().Msg(\"Generating Chainlink node secrets\")\n\t// in this case we only have a single blockchain type\n\tfirstBlockchain := bc[0]\n\t// blockchain info for blockchain 0 and node 0\n\t_ = firstBlockchain.Out.Nodes[0]\n\t// chain ID for blockchain 0\n\t_ = firstBlockchain.Out.ChainID\n\treturn \"\", nil\n}\n\nfunc (m *Configurator) ConfigureJobsAndContracts(\n\tctx context.Context,\n\tproductIdx int,\n\tfake *fake.Input,\n\tbc []*blockchain.Input,\n\tns []*nodeset.Input,\n) error {\n\t// in this case we have only a single node set\n\tfirstNodeSet := ns[0]\n\t// connect to Chainlink nodes and use the client to get keys and other data if needed\n\tcl, err := clclient.New(firstNodeSet.Out.CLNodes)\n\tif err != nil {\n\t\treturn err\n\t}\n\t_ = cl\n\n\t// write an example output of your product configuration\n\t// contract addresses, URLs, etc\n\t// in soak test case it may hold multiple configs and have different outputs\n\t// for each instance\n\tm.Config[0].Out = \u0026ProductConfigOutput{ExampleField: \"my_data\"}\n\tL.Info().Msg(\"Configuring product: {{ .ProductName }}\")\n\treturn nil\n}\n`\n\n\tProductsConfigTmpl = `package products\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strings\"\n\n\t\"github.com/pelletier/go-toml/v2\"\n\t\"github.com/rs/zerolog\"\n\t\"github.com/rs/zerolog/log\"\n)\n\nconst (\n\tEnvVarTestConfigs = \"CTF_CONFIGS\"\n)\n\nvar L = log.Output(zerolog.ConsoleWriter{Out: os.Stderr}).Level(zerolog.DebugLevel).With().Fields(map[string]any{\"component\": \"product_config\"}).Logger()\n\nfunc Load[T any]() (*T, error) {\n\tvar config T\n\tpaths := strings.Split(os.Getenv(EnvVarTestConfigs), \",\")\n\tfor _, path := range paths {\n\t\tdata, err := os.ReadFile(path)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to read product config file path %s: %w\", path, err)\n\t\t}\n\t\tL.Trace().Str(\"ProductConfig\", string(data)).Send()\n\n\t\tdecoder := toml.NewDecoder(strings.NewReader(string(data)))\n\n\t\tif err := decoder.Decode(\u0026config); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to decode TOML config, strict mode: %w\", err)\n\t\t}\n\t}\n\treturn \u0026config, nil\n}\n\n// Store writes config to a file, adds -cache.toml suffix if it's an initial configuration.\nfunc Store[T any](path string, cfg *T) error {\n\tbaseConfigPath, err := BaseConfigPath(EnvVarTestConfigs)\n\tif err != nil {\n\t\treturn err\n\t}\n\tnewCacheName := strings.ReplaceAll(baseConfigPath, \".toml\", \"\")\n\tvar outCacheName string\n\tif strings.Contains(newCacheName, \"cache\") {\n\t\tL.Info().Str(\"Cache\", baseConfigPath).Msg(\"Cache file already exists, overriding\")\n\t\toutCacheName = baseConfigPath\n\t} else {\n\t\toutCacheName = strings.ReplaceAll(baseConfigPath, \".toml\", \"\") + \"-out.toml\"\n\t}\n\tL.Info().Str(\"OutputFile\", outCacheName).Msg(\"Storing configuration output\")\n\td, err := toml.Marshal(cfg)\n\tif err != nil {\n\t\treturn err\n\t}\n\tf, err := os.OpenFile(filepath.Join(path, outCacheName), os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0o644)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer f.Close()\n\tif _, err := f.Write(d); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// LoadOutput loads config output file from path.\nfunc LoadOutput[T any](path string) (*T, error) {\n\t_ = os.Setenv(EnvVarTestConfigs, path)\n\treturn Load[T]()\n}\n\n// BaseConfigPath returns base config path, ex. env.toml,overrides.toml -\u003e env.toml.\nfunc BaseConfigPath(envVar string) (string, error) {\n\tconfigs := os.Getenv(envVar)\n\tif configs == \"\" {\n\t\treturn \"\", fmt.Errorf(\"no %s env var is provided, you should provide at least one test config in TOML\", envVar)\n\t}\n\tL.Debug().Str(\"Configs\", configs).Msg(\"Getting base config path\")\n\treturn strings.Split(configs, \",\")[0], nil\n}\n`\n\tProductsCommonTmpl = `package products\n\nimport (\n\"context\"\n\t\"crypto/ecdsa\"\n\t\"errors\"\n\t\"fmt\"\n\t\"math/big\"\n\t\"os\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/ethereum/go-ethereum/accounts/abi/bind\"\n\t\"github.com/ethereum/go-ethereum/common\"\n\t\"github.com/ethereum/go-ethereum/crypto\"\n\t\"github.com/ethereum/go-ethereum/ethclient\"\n\t\"github.com/rs/zerolog\"\n\n\t\"github.com/ethereum/go-ethereum/core/types\"\n)\n\nconst (\n\tAnvilKey0                     = \"ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80\"\n\tDefaultNativeTransferGasPrice = 21000\n)\n\n// FundNodeEIP1559 funds CL node using RPC URL, recipient address and amount of funds to send (ETH).\n// Uses EIP-1559 transaction type.\nfunc FundNodeEIP1559(ctx context.Context, c *ethclient.Client, pkey, recipientAddress string, amountOfFundsInETH float64) error {\n\tl := zerolog.Ctx(ctx)\n\tamount := new(big.Float).Mul(big.NewFloat(amountOfFundsInETH), big.NewFloat(1e18))\n\tamountWei, _ := amount.Int(nil)\n\tl.Info().Str(\"Addr\", recipientAddress).Str(\"Wei\", amountWei.String()).Msg(\"Funding Node\")\n\n\tchainID, err := c.NetworkID(context.Background())\n\tif err != nil {\n\t\treturn err\n\t}\n\tprivateKeyStr := strings.TrimPrefix(pkey, \"0x\")\n\tprivateKey, err := crypto.HexToECDSA(privateKeyStr)\n\tif err != nil {\n\t\treturn err\n\t}\n\tpublicKey := privateKey.Public()\n\tpublicKeyECDSA, ok := publicKey.(*ecdsa.PublicKey)\n\tif !ok {\n\t\treturn errors.New(\"error casting public key to ECDSA\")\n\t}\n\tfromAddress := crypto.PubkeyToAddress(*publicKeyECDSA)\n\n\tnonce, err := c.PendingNonceAt(context.Background(), fromAddress)\n\tif err != nil {\n\t\treturn err\n\t}\n\tfeeCap, err := c.SuggestGasPrice(context.Background())\n\tif err != nil {\n\t\treturn err\n\t}\n\ttipCap, err := c.SuggestGasTipCap(context.Background())\n\tif err != nil {\n\t\treturn err\n\t}\n\trecipient := common.HexToAddress(recipientAddress)\n\ttx := types.NewTx(\u0026types.DynamicFeeTx{\n\t\tChainID:   chainID,\n\t\tNonce:     nonce,\n\t\tTo:        \u0026recipient,\n\t\tValue:     amountWei,\n\t\tGas:       DefaultNativeTransferGasPrice,\n\t\tGasFeeCap: feeCap,\n\t\tGasTipCap: tipCap,\n\t})\n\tsignedTx, err := types.SignTx(tx, types.NewLondonSigner(chainID), privateKey)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = c.SendTransaction(context.Background(), signedTx)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif _, err := WaitMinedFast(context.Background(), c, signedTx.Hash()); err != nil {\n\t\treturn err\n\t}\n\tl.Info().Str(\"Wei\", amountWei.String()).Msg(\"Funded with ETH\")\n\treturn nil\n}\n\n// ETHClient creates a basic Ethereum client using PRIVATE_KEY env var and tip/cap gas settings\nfunc ETHClient(ctx context.Context, rpcURL string, feeCapMult int64, tipCapMult int64) (*ethclient.Client, *bind.TransactOpts, string, error) {\n\tl := zerolog.Ctx(ctx)\n\tclient, err := ethclient.Dial(rpcURL)\n\tif err != nil {\n\t\treturn nil, nil, \"\", fmt.Errorf(\"could not connect to eth client: %w\", err)\n\t}\n\tprivateKey, err := crypto.HexToECDSA(getNetworkPrivateKey())\n\tif err != nil {\n\t\treturn nil, nil, \"\", fmt.Errorf(\"could not parse private key: %w\", err)\n\t}\n\tpublicKey := privateKey.PublicKey\n\taddress := crypto.PubkeyToAddress(publicKey).String()\n\tchainID, err := client.ChainID(context.Background())\n\tif err != nil {\n\t\treturn nil, nil, \"\", fmt.Errorf(\"could not get chain ID: %w\", err)\n\t}\n\tauth, err := bind.NewKeyedTransactorWithChainID(privateKey, chainID)\n\tif err != nil {\n\t\treturn nil, nil, \"\", fmt.Errorf(\"could not create transactor: %w\", err)\n\t}\n\tfc, tc, err := multiplyEIP1559GasPrices(client, feeCapMult, tipCapMult)\n\tif err != nil {\n\t\treturn nil, nil, \"\", fmt.Errorf(\"could not get bumped gas price: %w\", err)\n\t}\n\tauth.GasFeeCap = fc\n\tauth.GasTipCap = tc\n\tl.Info().\n\t\tStr(\"GasFeeCap\", fc.String()).\n\t\tStr(\"GasTipCap\", tc.String()).\n\t\tMsg(\"Default gas prices set\")\n\treturn client, auth, address, nil\n}\n\n// multiplyEIP1559GasPrices returns bumped EIP1159 gas prices increased by multiplier\nfunc multiplyEIP1559GasPrices(client *ethclient.Client, fcMult, tcMult int64) (*big.Int, *big.Int, error) { //nolint:revive // trivial function\n\tfeeCap, err := client.SuggestGasPrice(context.Background())\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\ttipCap, err := client.SuggestGasTipCap(context.Background())\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\treturn new(big.Int).Mul(feeCap, big.NewInt(fcMult)), new(big.Int).Mul(tipCap, big.NewInt(tcMult)), nil\n}\n\nfunc getNetworkPrivateKey() string {\n\tpk := os.Getenv(\"PRIVATE_KEY\")\n\tif pk == \"\" {\n\t\t// that's the first Anvil and Geth private key, serves as a fallback for local testing if not overridden\n\t\treturn AnvilKey0\n\t}\n\treturn pk\n}\n\n// WaitMinedFast is a method for Anvil's instant blocks mode to ovecrome bind.WaitMined ticker hardcode.\nfunc WaitMinedFast(ctx context.Context, b bind.DeployBackend, txHash common.Hash) (*types.Receipt, error) {\n\tqueryTicker := time.NewTicker(5 * time.Millisecond)\n\tdefer queryTicker.Stop()\n\tfor {\n\t\treceipt, err := b.TransactionReceipt(ctx, txHash)\n\t\tif err == nil {\n\t\t\treturn receipt, nil\n\t\t}\n\t\tselect {\n\t\tcase \u003c-ctx.Done():\n\t\t\treturn nil, ctx.Err()\n\t\tcase \u003c-queryTicker.C:\n\t\t}\n\t}\n}\n\t`\n)\n```\n\n```go\nconst (\n\tProductFakesJustfile = `IMAGE_NAME := \"{{ .ProductName }}-fakes\"\n\nrun:\n    docker run --rm -it -v $(pwd):/app -p 9111:9111 {{ \"{{\" }}IMAGE_NAME{{ \"}}\" }}:latest\n\nbuild:\n    docker build -f Dockerfile -t {{ \"{{\" }}IMAGE_NAME{{ \"}}\" }}:latest .\n\npush registry:\n    docker build --platform linux/amd64 -f Dockerfile -t {{ \"{{\" }}IMAGE_NAME{{ \"}}\" }}:latest .\n    aws ecr get-login-password --region us-west-2 | docker login --username AWS --password-stdin {{ \"{{\" }}registry{{ \"}}\" }}\n    docker tag {{ \"{{\" }}IMAGE_NAME{{ \"}}\" }}:latest {{ \"{{\" }}registry{{ \"}}\" }}/{{ \"{{\" }}IMAGE_NAME{{ \"}}\" }}\n    docker push {{ \"{{\" }}registry{{ \"}}\" }}/{{ \"{{\" }}IMAGE_NAME{{ \"}}\" }}\n\nclean:\n    docker rmi {{ \"{{\" }}IMAGE_NAME{{ \"}}\" }}:latest\n`\n\tProductFakesImplTmpl = `package main\n\nimport (\n\t\"os\"\n\n\t\"github.com/rs/zerolog\"\n\t\"github.com/rs/zerolog/log\"\n\n\t\"github.com/gin-gonic/gin\"\n\n\t\"github.com/smartcontractkit/chainlink-testing-framework/framework/components/fake\"\n)\n\nvar L = log.Output(zerolog.ConsoleWriter{Out: os.Stderr}).Level(zerolog.DebugLevel).With().Fields(map[string]any{\"component\": \"ocr2\"}).Logger()\n\n// example mock service\nfunc main() {\n\t_, err := fake.NewFakeDataProvider(\u0026fake.Input{Port: fake.DefaultFakeServicePort})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\terr = fake.Func(\"POST\", \"/example_fake\", func(ctx *gin.Context) {\n\t\tctx.JSON(200, gin.H{\n\t\t\t\"data\": map[string]any{\n\t\t\t\t\"result\": \"ok\",\n\t\t\t},\n\t\t})\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tselect {}\n}\n`\n\tProductFakesGoModuleTmpl = `module github.com/smartcontractkit/{{ .ProductName}}/devenv/fakes\n\ngo {{.RuntimeVersion}}\n\nrequire (\n\tgithub.com/gin-gonic/gin v1.10.1\n\tgithub.com/rs/zerolog v1.34.0\n\tgithub.com/smartcontractkit/chainlink-testing-framework/framework v0.10.1\n\tgithub.com/smartcontractkit/chainlink-testing-framework/framework/components/fake v0.10.1-0.20250711120409-5078050f9db4\n)`\n\n\tProductFakesDockerfileTmpl = `FROM golang:1.25 AS builder\n\nENV GOPRIVATE=github.com/smartcontractkit/*\n\nWORKDIR /app\nCOPY go.mod go.sum ./\nRUN go mod download\nCOPY ../.. .\nRUN CGO_ENABLED=0 GOOS=linux go build -o /fake main.go\n\nFROM alpine:latest\nRUN apk --no-cache add ca-certificates\nCOPY --from=builder /fake /fake\nEXPOSE 9111\nCMD [\"/fake\"]\n`\n)\n```\n\n```go\nconst (\n\tCISummaryFile = \"ci_summary.txt\"\n)\n```\n\n```go\nconst (\n\tDefaultConfigDir = \".\"\n)\n```\n\n```go\nconst (\n\tEnvVarLogLevel = \"CTF_LOG_LEVEL\"\n)\n```\n\n```go\nconst (\n\tProductComponentImpl = `\n\tpackage services\n\n/*\n * A simple template to add your project services to devenv.\n * Each service should have a file with Input/Output struct and a function deploying it.\n */\n\nimport (\n\t\t\"context\"\n\t\t\"fmt\"\n\t\t\"os\"\n\t\t\"strconv\"\n\n\t\t\"github.com/rs/zerolog\"\n\t\t\"github.com/rs/zerolog/log\"\n\n\t\t\"net/netip\"\n\n\t\t\"github.com/moby/moby/api/types/container\"\n\t\t\"github.com/moby/moby/api/types/network\"\n\t\t\"github.com/smartcontractkit/chainlink-testing-framework/framework\"\n\t\t\"github.com/testcontainers/testcontainers-go\"\n)\n\nvar L = log.Output(zerolog.ConsoleWriter{Out: os.Stderr}).Level(zerolog.DebugLevel).With().Fields(map[string]any{\"component\": \"datastreams\"}).Logger()\n\nconst (\n\t\tDefaultExampleSvcName  = \"example-service\"\n\t\tDefaultExampleSvcImage = \"busybox:latest\"\n)\n\n// ExampleSvcInput example service input\ntype ExampleSvcInput struct {\n\t\tImage         string            ` + \"`\" + `toml:\"image\"` + \"`\" + `\n\t\tPort          int               ` + \"`\" + `toml:\"port\"` + \"`\" + `\n\t\tContainerName string            ` + \"`\" + `toml:\"container_name\"` + \"`\" + `\n\t\tEnvVars       map[string]string ` + \"`\" + `toml:\"env_vars\"` + \"`\" + `\n\t\tOut           *ExampleSvcOutput ` + \"`\" + `toml:\"out\"` + \"`\" + `\n}\n\n// Default is a default input configuration\nfunc (s *ExampleSvcInput) Default() {\n\t\tif s.Image == \"\" {\n\t\t\ts.Image = DefaultExampleSvcImage\n\t\t}\n\t\tif s.Port == 0 {\n\t\t\ts.Port = 9501\n\t\t}\n\t\tif s.ContainerName == \"\" {\n\t\t\ts.ContainerName = DefaultExampleSvcName\n\t\t}\n}\n\n// ExampleSvcOutput represents service connection details which can be consumed by tests\n// or environment.go, or any other metadata your need to expose to clients\ntype ExampleSvcOutput struct {\n\t\tServiceURL string ` + \"`\" + `toml:\"service_url\"` + \"`\" + `\n}\n\n// NewService deploys an example service and populates output data\nfunc NewService(in *ExampleSvcInput) error {\n\t\tif in == nil || in.Out != nil {\n\t\t\t// either service key is not present in configuration\n\t\t\t// or it is already deployed because we have an output, skipping\n\t\t\tL.Info().Str(\"ServiceName\", DefaultExampleSvcName).Msg(\"service is skipped or already deployed\")\n\t\t\treturn nil\n\t\t}\n\t\tctx := context.Background()\n\t\t// read and apply default inputs\n\t\tin.Default()\n\t\t// create your service container, use static ports\n\t\treq := testcontainers.ContainerRequest{\n\t\t\tImage:    in.Image,\n\t\t\tName:     in.ContainerName,\n\t\t\tLabels:   framework.DefaultTCLabels(),\n\t\t\tNetworks: []string{framework.DefaultNetworkName},\n\t\t\tNetworkAliases: map[string][]string{\n\t\t\t\tframework.DefaultNetworkName: {in.ContainerName},\n\t\t\t},\n\t\t\tEnv: in.EnvVars,\n\t\t\tCmd: []string{\"sleep\", \"infinity\"},\n\t\t\t// add more internal ports here with /tcp suffix, ex.: 9501/tcp\n\t\t\tExposedPorts: []string{\"9501/tcp\"},\n\t\t\tHostConfigModifier: func(h *container.HostConfig) {\n\t\t\t\th.PortBindings = network.PortMap{\n\t\t\t\t\t// add more internal/external pairs here, ex.: 9501/tcp as a key and HostPort is the exposed port (no /tcp prefix!)\n\t\t\t\t\tnetwork.MustParsePort(\"9501/tcp\"): []network.PortBinding{\n\t\t\t\t\t\t{HostIP: netip.MustParseAddr(\"0.0.0.0\"), HostPort: strconv.Itoa(in.Port)},\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t},\n\t\t\t// for complex services wait for specific log message\n\t\t\t// WaitingFor: wait.ForLog(\"Some log message\").\n\t\t\t// \tWithStartupTimeout(120 * time.Second).\n\t\t\t// \tWithPollInterval(3 * time.Second),\n\t\t}\n\t\t_, err := testcontainers.GenericContainer(ctx, testcontainers.GenericContainerRequest{\n\t\t\tContainerRequest: req,\n\t\t\tStarted:          true,\n\t\t})\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to setup %s service\", in.ContainerName)\n\t\t}\n\n\t\t// write outputs on a shared struct\n\t\tin.Out = \u0026ExampleSvcOutput{\n\t\t\tServiceURL: \"https://example.com\",\n\t\t}\n\t\treturn nil\n}\n\t`\n)\n```\n\n## Variables\n\n```go\nvar (\n\tDefaultNetworkName  = \"ctf\"\n\tValidator           = validator.New(validator.WithRequiredStructEnabled())\n\tValidatorTranslator ut.Translator\n)\n```\n\n```go\nvar EmbeddedObservabilityFiles embed.FS\n```\n\n```go\nvar ExitedCtfContainersListOpts = client.ContainerListOptions{\n\tAll:     true,\n\tFilters: make(client.Filters).Add(\"label\", \"framework=ctf\").Add(\"status\", \"exited\", \"dead\"),\n}\n```\n\n```go\nvar (\n\tL zerolog.Logger\n)\n```\n\n```go\nvar (\n\tPathRoot = filepath.Join(filepath.Dir(b), \".\")\n)\n```\n\n## Functions\n\n```go\nfunc BaseCacheName() (string, error)\n```\nBaseCacheName returns base cache file name, ex.: env.toml -\u003e env-cache.toml\n\n```go\nfunc BaseConfigName() (string, error)\n```\nBaseConfigName returns base config name, ex. env.toml -\u003e env\n\n```go\nfunc BaseConfigPath() (string, error)\n```\nBaseConfigPath returns base config path, ex. env.toml,overrides.toml -\u003e env.toml\n\n```go\nfunc BlockScoutDown(url string) error\n```\n\n```go\nfunc BlockScoutUp(url, chainID string) error\n```\n\n```go\nfunc BuildImage(dctx, dfile, nameAndTag string, buildArgs map[string]string) error\n```\n\n```go\nfunc BuildImageOnce(once *sync.Once, dctx, dfile, nameAndTag string, buildArgs map[string]string) error\n```\n\n```go\nfunc CTFContainersListOpts() client.ContainerListOptions\n```\n\n```go\nfunc CTFContainersLogsOpts() client.ContainerLogsOptions\n```\n\n```go\nfunc CheckContainersForPanics(maxLinesAfterPanic int) bool\n```\n\n```go\nfunc CheckContainersForPanicsFromStreams(logStream map[string]io.ReadCloser, maxLinesAfterPanic int) bool\n```\nCheckContainersForPanicsFromStreams scans the provided stream (usually Docker container logs) for panic-related patterns. When a panic is detected, it displays the panic line and up to maxLinesAfterPanic lines following it.\n\nThis is useful for debugging test failures where a Docker container may have panicked. The function searches for common panic patterns including:\n\n  - \"panic:\" - Standard Go panic\n  - \"runtime error:\" - Runtime errors (nil pointer, index out of bounds, etc.)\n  - \"fatal error:\" - Fatal errors\n  - \"goroutine N \\[running]\" - Stack trace indicators\n\nThe function scans all containers in parallel and stops as soon as the first panic is found.\n\nParameters:\n\n  - logStream: Map of container names to their log streams (io.ReadCloser).\n  - maxLinesAfterPanic: Maximum number of lines to show after the panic line (including stack trace). Recommended: 50-200 depending on how much context you want.\n\nReturns:\n\n  - true if any panics were found in any container, false otherwise\n\n```go\nfunc CheckOut(ref string) error\n```\n\n```go\nfunc DefaultNetwork(_ *sync.Once) error\n```\n\n```go\nfunc DefaultTCLabels() map[string]string\n```\n\n```go\nfunc DefaultTCName(name string) string\n```\n\n```go\nfunc ExecCmd(command string) ([]byte, error)\n```\nExecCmd executes a command and logs the output interactively\n\n```go\nfunc ExecCmdWithContext(ctx context.Context, command string) ([]byte, error)\n```\nExecCmdWithContext a command and logs the output interactively\n\n```go\nfunc ExecCmdWithOpts(ctx context.Context, command string, stdoutFunc func(string), stderrFunc func(string)) ([]byte, error)\n```\n\n```go\nfunc FilterSemverTags(versions []string, include []string, exclude []string, tagVersionCeiling string) []string\n```\nFilterSemverTags parses valid versions and returns them sorted from latest to lowest\n\n```go\nfunc FindNOPsVersionsByProduct(url string, product string, exclude []string) ([]string, error)\n```\nFindNOPsVersionsByProduct finds all the versions of a given product from a RANE SOT source across all the NOPs\n\n```go\nfunc FindSemVerRefSequence(tagsBack int, include, exclude []string, tagVersionCeiling string) ([]string, error)\n```\nFindSemVerRefSequence gets all semver tags, sorts them, and rolls back to the earliest tag returns all the tags starting from the oldest one\n\n```go\nfunc GenerateCustomPortsData(portsProvided []string) ([]string, network.PortMap, error)\n```\nGenerateCustomPortsData generate custom ports data: exposed and forwarded port map\n\n```go\nfunc GetHost(container tc.Container) (string, error)\n```\n\n```go\nfunc GetHostWithContext(ctx context.Context, container tc.Container) (string, error)\n```\n\n```go\nfunc HostDockerInternal() string\n```\nHostDockerInternal returns host.docker.internal that works both locally and in GHA\n\n```go\nfunc IsDockerRunning() bool\n```\n\n```go\nfunc Load[X any](t *testing.T) (*X, error)\n```\n\n```go\nfunc LoadCache[X any](t *testing.T) (*X, error)\n```\nLoadCache loads cached config with environment values\n\n```go\nfunc MapTheSamePort(ports ...string) network.PortMap\n```\n\n```go\nfunc MustParseDuration(s string) time.Duration\n```\nMustParseDuration parses a duration string in Go's format and returns the corresponding time.Duration. It panics if the string cannot be parsed, ensuring that the caller receives a valid duration.\n\n```go\nfunc NewPromtail() error\n```\n\n```go\nfunc ObservabilityDown() error\n```\n\n```go\nfunc ObservabilityUp() error\n```\nObservabilityUp standard stack with logs/metrics for load testing and observability\n\n```go\nfunc ObservabilityUpFull() error\n```\nObservabilityUpFull full stack for load testing and performance investigations\n\n```go\nfunc ObservabilityUpOnlyLoki() error\n```\nObservabilityUpOnlyLoki slim stack with only Loki to verify specific logs of CL nodes or services in tests\n\n```go\nfunc ObservabilityVictoriaDown() error\n```\n\n```go\nfunc ObservabilityVictoriaMetricsUp() error\n```\nObservabilityVictoriaMetricsUp VictoriaMetrics stack for load testing and performance investigations\n\n```go\nfunc PrintFailedContainerLogs(logLinesCount uint64) error\n```\nPrintFailedContainerLogs writes exited/dead CTF containers' last log lines to stdout.\n\n```go\nfunc PrintFailedContainerLogsFromStreams(logStream map[string]io.ReadCloser, logLinesCount uint64) error\n```\nPrintFailedContainerLogsFromStreams prints all provided container streams as red text.\n\n```go\nfunc RedText(text string, args ...any) string\n```\n\n```go\nfunc RemoveTestContainers() error\n```\nRemoveTestContainers removes all test containers, volumes and CTF docker network\n\n```go\nfunc RemoveTestStack(name string) error\n```\n\n```go\nfunc RenderTemplate(tmpl string, data interface{}) (string, error)\n```\n\n```go\nfunc ResourceLimitsFunc(h *container.HostConfig, resources *ContainerResources)\n```\nResourceLimitsFunc returns a function to configure container resources based on the human-readable CPUs and memory in Mb\n\n```go\nfunc RunCommand(name string, args ...string) error\n```\nRunCommand executes a command and prints the output.\n\n```go\nfunc RunCommandDir(dir, name string, args ...string) error\n```\nRunCommandDir executes a command in some directory and prints the output\n\n```go\nfunc RunInitialUpgradeSetup(ctx context.Context, u UpgradeContext) error\n```\n\n```go\nfunc SaveAndCheckLogs(t *testing.T) error\n```\n\n```go\nfunc SaveContainerLogs(dir string) ([]string, error)\n```\nSaveContainerLogs writes all Docker container logs to some directory\n\n```go\nfunc SaveContainerLogsFromStreams(dir string, logStream map[string]io.ReadCloser) ([]string, error)\n```\nSaveContainerLogsFromStreams writes all provided Docker log streams to files in some directory.\n\n```go\nfunc Store[T any](cfg *T) error\n```\n\n```go\nfunc StreamCTFContainerLogsFanout(consumers ...LogStreamConsumer) error\n```\nStreamCTFContainerLogsFanout fetches CTF logs once and fans out streams to all consumers.\n\n```go\nfunc StreamContainerLogs(listOptions client.ContainerListOptions, logOptions client.ContainerLogsOptions) (map[string]io.ReadCloser, error)\n```\n\n```go\nfunc StreamContainerLogsFanout(listOptions client.ContainerListOptions, logOptions client.ContainerLogsOptions, consumers ...LogStreamConsumer) error\n```\nStreamContainerLogsFanout fetches container logs once and fans out streams to all consumers.\n\n```go\nfunc ToLabelsMap(response *PrometheusQueryResponse) map[string][]interface{}\n```\nToLabelsMap converts PrometheusQueryResponse.Data.Result into a map where keys are metric labels in \"k:v\" format and values are slices of all values with that label\n\n```go\nfunc UpgradeContainer(ctx context.Context, containerName, newImage string) error\n```\nUpgradeContainer stops a container, removes it, and creates a new one with the specified image\n\n```go\nfunc UpgradeNProductUniqueVersionsRolling(ctx context.Context, u UpgradeContext) error\n```\nUpgradeNProductUniqueVersionsRolling models multiple product DONs as one having all unique versions first upgrades the current version of each node to modelled DON version in parallel and tests it once then upgrades each node to the target version and tests it after each upgrade \\[v1.0, v1.0, v1.1, v1.1] -\u003e test it \\[v1.0, v1.1, v1.3, v1.4] -\u003e get N unique refs and boot up DON to simulate a real one \\[vX.X, v1.1, v1.3, v1.4] -\u003e upgrade a single node, test \\[vX.X, vX.X, v1.3, v1.4] -\u003e upgrade a single node, test ... etc \\[v1.0, v1.1, v1.3, v1.4] -\u003e get N unique refs and boot up DON to simulate a real one \\[vX.X, v1.1, v1.3, v1.4] -\u003e upgrade a single node, test \\[vX.X, vX.X, v1.3, v1.4] -\u003e upgrade a single node, test ... etc\n\n```go\nfunc UpgradeNRolling(ctx context.Context, u UpgradeContext) error\n```\nUpgradeNRolling upgrades nodes to the given refs in rolling fashion, testing with the given testcmd after each upgrade \\[v1.0, v1.0, v1.1, v1.1] -\u003e test \\[v1.0, v1.0, v1.2, v1.2] -\u003e test \\[v1.0, v1.0, v1.3, v1.3] -\u003e test etc\n\n```go\nfunc WriteRollingNUpgradeSummary(tmpl UpgradeNRollingSummaryTemplate) error\n```\nWriteRollingNUpgradeSummary renders an upgrade summary and writes it to ci\\_summary.txt\n\n```go\nfunc WriteSOTDONUpgradeSummary(tmpl UpgradeSOTDONSummary) error\n```\nWriteSOTDONUpgradeSummary renders an upgrade summary and writes it to ci\\_summary.txt\n\n## Types\n\n```go\ntype APIError struct {\n\tStatusCode int\n\tMessage    string\n}\n```\nAPIError is a custom error type for handling non-200 responses from the Loki API\n\n```go\nfunc (e *APIError) Error() string\n```\nImplement the \\`Error\\` interface for APIError\n\n```go\ntype Annotation struct {\n\tPanelID      *int\n\tDashboardUID []string\n\tStartTime    *time.Time\n\tEndTime      *time.Time\n\tTags         []string\n\tText         string\n}\n```\n\n```go\nfunc A(ns, text string, dashboardUIDs []string, from, to *time.Time) Annotation\n```\nA is just a short-cut for default annotation\n\n```go\ntype BasicAuth struct {\n\tLogin    string\n\tPassword string\n}\n```\nBasicAuth holds the authentication details for Loki\n\n```go\ntype CIECRAuthAction struct{}\n```\nCIECRAuthAction params for generating CI share action for auth\n\n```go\ntype CILoadChaosParams struct {\n\tProductName   string\n\tDevEnvRelPath string\n\tCLIName       string\n}\n```\nCILoadChaosParams params for generating CI load\u0026chaos tests file\n\n```go\ntype CISmokeParams struct {\n\tProductName   string\n\tDevEnvRelPath string\n\tCLIName       string\n}\n```\nCISmokeParams params for generating CI smoke tests file\n\n```go\ntype CLDFParams struct {\n\tPackageName string\n}\n```\nCLDFParams cldf.go file params\n\n```go\ntype CLICompletionParams struct {\n\tPackageName string\n\tProductName string\n\tCLIName     string\n}\n```\nCLICompletionParams cli.go file params\n\n```go\ntype CLIParams struct {\n\tPackageName     string\n\tCLIName         string\n\tDevEnvPkgImport string\n\tProductName     string\n\tDashboardUUID   string\n}\n```\nCLIParams cli.go file params\n\n```go\ntype Config struct {\n\tLokiURL               string\n\tLokiTenantID          string\n\tLokiBasicAuthUsername string\n\tLokiBasicAuthPassword string\n}\n```\n\n```go\ntype ConfigParams struct {\n\tPackageName string\n}\n```\nConfigParams config.go file params\n\n```go\ntype ConfigTOMLParams struct {\n\tPackageName string\n\tProductName string\n\tNodes       int\n\tNodeIndices []int\n}\n```\nConfigTOMLParams default env.toml params\n\n```go\ntype ContainerResources struct {\n\tCPUs     float64 `toml:\"cpus\" validate:\"gte=0\" comment:\"CPU shares, ex.: 2\"`\n\tMemoryMb uint    `toml:\"memory_mb\" comment:\"Memory in MegaBytes, ex.:\\\"200\\\"\"`\n}\n```\n\n```go\ntype DevEnvInterfaceParams struct {\n\tPackageName string\n}\n```\nDevEnvInterfaceParams interface.go file params\n\n```go\ntype DockerClient struct {\n\t// contains filtered or unexported fields\n}\n```\nDockerClient wraps a Docker API client and provides convenience methods\n\n```go\nfunc NewDockerClient() (*DockerClient, error)\n```\nNewDockerClient creates a new instance of DockerClient\n\n```go\nfunc (dc *DockerClient) CopyFile(containerName, sourceFile, targetPath string) error\n```\nCopyFile copies a file into a container by name\n\n```go\nfunc (dc *DockerClient) ExecContainer(containerName string, command []string) (string, error)\n```\nExecContainer executes a command inside a running container by name and returns the combined stdout/stderr.\n\n```go\nfunc (dc *DockerClient) ExecContainerOptions(containerName string, execConfig client.ExecCreateOptions) (string, error)\n```\nExecContainer executes a command inside a running container by name and returns the combined stdout/stderr.\n\n```go\nfunc (dc *DockerClient) ExecContainerOptionsWithContext(ctx context.Context, containerName string, execConfig client.ExecCreateOptions) (string, error)\n```\nExecContainerOptionsWithContext executes a command inside a running container by name and returns the combined stdout/stderr.\n\n```go\nfunc (dc *DockerClient) ExecContainerWithContext(ctx context.Context, containerName string, command []string) (string, error)\n```\nExecContainerWithContext executes a command inside a running container by name and returns the combined stdout/stderr.\n\n```go\ntype EnvBuilder struct {\n\t// contains filtered or unexported fields\n}\n```\nEnvBuilder builder for perf test codegen\n\n```go\nfunc NewEnvBuilder(cliName string, nodes int, productName string) *EnvBuilder\n```\nNewEnvBuilder creates a new Chainlink Cluster developer environment\n\n```go\nfunc (g *EnvBuilder) Build() (*EnvCodegen, error)\n```\nValidate validate generation params for now it's empty but for more complex mutually exclusive cases we should add validation here\n\n```go\nfunc (g *EnvBuilder) OutputDir(dir string) *EnvBuilder\n```\nOutputDir sets the output directory for generated files\n\n```go\ntype EnvCodegen struct {\n\t// contains filtered or unexported fields\n}\n```\nEnvCodegen is a perf test code generator that creates workload and chaos experiments\n\n```go\nfunc (g *EnvCodegen) GenerateAgents() (string, error)\n```\nGenerateAgents generate AGENTS.md guide for AI agents\n\n```go\nfunc (g *EnvCodegen) GenerateCIFunctional() (string, error)\n```\nGenerateCIFunctional generates a functional test CI workflow\n\n```go\nfunc (g *EnvCodegen) GenerateCIPerf() (string, error)\n```\nGenerateCIPerf generates a load\u0026chaos test CI workflow\n\n```go\nfunc (g *EnvCodegen) GenerateCLI(dashboardUUID string) (string, error)\n```\nGenerateCLI generate Cobra CLI\n\n```go\nfunc (g *EnvCodegen) GenerateCLICompletion() (string, error)\n```\nGenerateCLICompletion generate CLI completion for \"go-prompt\" library\n\n```go\nfunc (g *EnvCodegen) GenerateConfig() (string, error)\n```\nGenerateConfig generate read/write utilities for TOML configs\n\n```go\nfunc (g *EnvCodegen) GenerateDefaultTOMLConfig() (string, error)\n```\nGenerateDefaultTOMLConfig generate default env.toml config\n\n```go\nfunc (g *EnvCodegen) GenerateECRAuthAction() (string, error)\n```\nGenerateECRAuthAction generates a shared ECR Auth action\n\n```go\nfunc (g *EnvCodegen) GenerateEnvironment() (string, error)\n```\nGenerateEnvironment generate environment.go, our environment composition function\n\n```go\nfunc (g *EnvCodegen) GenerateFakesDockerfile() (string, error)\n```\n\n```go\nfunc (g *EnvCodegen) GenerateFakesGoModule() (string, error)\n```\n\n```go\nfunc (g *EnvCodegen) GenerateFakesImpl() (string, error)\n```\n\n```go\nfunc (g *EnvCodegen) GenerateFakesJustfile() (string, error)\n```\n\n```go\nfunc (g *EnvCodegen) GenerateGitIgnore() (string, error)\n```\nGenerateGitIgnore generate .gitignore file\n\n```go\nfunc (g *EnvCodegen) GenerateGoMod() (string, error)\n```\nGenerateGoMod generates a go.mod file\n\n```go\nfunc (g *EnvCodegen) GenerateGrafanaDashboard(uuid string) (string, error)\n```\nGenerateGrafanaDashboard generate default Grafana dashboard\n\n```go\nfunc (g *EnvCodegen) GenerateJD() (string, error)\n```\nGenerateJD generate JD helpers\n\n```go\nfunc (g *EnvCodegen) GenerateJustfile() (string, error)\n```\nGenerateJustfile generate Justfile to build and publish Docker images\n\n```go\nfunc (g *EnvCodegen) GenerateLoadTests() (string, error)\n```\nGenerateSmokeTests generates a smoke test template\n\n```go\nfunc (g *EnvCodegen) GenerateProductBasicConfigParams() (string, error)\n```\n\n```go\nfunc (g *EnvCodegen) GenerateProductCommon() (string, error)\n```\n\n```go\nfunc (g *EnvCodegen) GenerateProductImpl() (string, error)\n```\n\n```go\nfunc (g *EnvCodegen) GenerateProductSoakConfigParams() (string, error)\n```\n\n```go\nfunc (g *EnvCodegen) GenerateProductsConfig() (string, error)\n```\n\n```go\nfunc (g *EnvCodegen) GenerateProductsInterface() (string, error)\n```\nGenerateProductsInterface generate devenv interface to run arbitrary products\n\n```go\nfunc (g *EnvCodegen) GenerateReadme() (string, error)\n```\nGenerateReadme generates a readme file\n\n```go\nfunc (g *EnvCodegen) GenerateServiceImpl() (string, error)\n```\nGenerateServiceImpl generates example service implementation\n\n```go\nfunc (g *EnvCodegen) GenerateSmokeTests() (string, error)\n```\nGenerateSmokeTests generates a smoke test template\n\n```go\nfunc (g *EnvCodegen) GenerateTableTest() (string, error)\n```\nGenerateTableTest generates all possible experiments for a namespace first generate all small pieces then insert into a table test template\n\n```go\nfunc (g *EnvCodegen) GenerateTestCases() ([]TestCaseParams, error)\n```\nGenerateTestCases generates table test cases\n\n```go\nfunc (g *EnvCodegen) Read() error\n```\nRead read K8s namespace and find all the pods some pods may be crashing but it doesn't matter for code generation\n\n```go\nfunc (g *EnvCodegen) Write() error\n```\nWrite generates a complete devenv boilerplate, can be multiple files\n\n```go\nfunc (g *EnvCodegen) WriteFakes() error\n```\nWriteFakes writes all files related to fake services used in testing\n\n```go\nfunc (g *EnvCodegen) WriteProducts() error\n```\nWriteProducts generates a complete products boilerplate\n\n```go\nfunc (g *EnvCodegen) WriteServices() error\n```\nWriteServices write all things related to example service template\n\n```go\ntype EnvParams struct {\n\tPackageName string\n\tProductName string\n}\n```\nEnvParams environment.go file params\n\n```go\ntype GitIgnoreParams struct{}\n```\nGitIgnoreParams default .gitignore params\n\n```go\ntype GoModParams struct {\n\tModuleName     string\n\tRuntimeVersion string\n}\n```\nGoModParams params for generating go.mod file\n\n```go\ntype GrafanaClient struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewGrafanaClient(url, bearerToken string) *GrafanaClient\n```\nNewGrafanaClient initializes a new Grafana client with the specified URL and API key.\n\n```go\nfunc (c *GrafanaClient) Annotate(annotation Annotation) ([]PostAnnotationResponse, []*resty.Response, error)\n```\nAnnotate adds annotation to all the dashboards, works for both single point annotation with just StartTime and for ranges with StartTime/EndTime\n\n```go\ntype GrafanaDashboardParams struct {\n\tProductName string\n\tUUID        string\n}\n```\nGrafanaDashboardParams default Grafana dashboard params\n\n```go\ntype JSONStrDuration struct {\n\ttime.Duration\n}\n```\nJSONStrDuration is JSON friendly duration that can be parsed from \"1h2m0s\" Go format\n\n```go\nfunc (d *JSONStrDuration) MarshalJSON() ([]byte, error)\n```\n\n```go\nfunc (d *JSONStrDuration) UnmarshalJSON(b []byte) error\n```\n\n```go\ntype JustfileParams struct {\n\tPackageName string\n\tCLIName     string\n}\n```\nJustfileParams Justfile params\n\n```go\ntype LoadTestParams struct {\n\tGoModName   string\n\tProductName string\n}\n```\nLoadTestParams params for generating end-to-end test template\n\n```go\ntype LogEntry struct {\n\tTimestamp string\n\tLog       string\n}\n```\nLogEntry represents a single log entry with a timestamp and raw log message\n\n```go\ntype LogStreamConsumer struct {\n\tName    string\n\tConsume func(map[string]io.ReadCloser) error\n}\n```\nLogStreamConsumer represents a log stream consumer that receives one stream per container.\n\n```go\ntype LokiClient struct {\n\tBaseURL     string\n\tTenantID    string\n\tBasicAuth   BasicAuth\n\tQueryParams QueryParams\n\tRestyClient *resty.Client\n}\n```\nLokiClient represents a client to interact with Loki for querying logs\n\n```go\nfunc NewLokiQueryClient(baseURL, tenantID string, auth BasicAuth, queryParams QueryParams) *LokiClient\n```\nNewLokiQueryClient creates a new Loki client with the given parameters, initializes a logger, and configures Resty with debug mode\n\n```go\nfunc (lc *LokiClient) QueryRange(ctx context.Context) ([]LogEntry, error)\n```\nQueryRange queries Loki logs based on the query parameters and returns the raw log entries\n\n```go\ntype PostAnnotationResponse struct {\n\tMessage string `json:\"message\"`\n\tID      int64  `json:\"id\"`\n}\n```\n\n```go\ntype ProductBasicConfigParams struct {\n\tProductName string\n}\n```\n\n```go\ntype ProductCommonParams struct{}\n```\n\n```go\ntype ProductConfigParams struct{}\n```\n\n```go\ntype ProductConfigurationSimple struct {\n\tPackageName string\n}\n```\nProductConfigurationSimple product\\_configuration.go file params\n\n```go\ntype ProductFakesDockerfileParams struct{}\n```\n\n```go\ntype ProductFakesGoModuleParams struct {\n\tProductName    string\n\tRuntimeVersion string\n}\n```\n\n```go\ntype ProductFakesImplParams struct {\n\tProductName string\n}\n```\n\n```go\ntype ProductFakesJustfileParams struct {\n\tProductName string\n}\n```\n\n```go\ntype ProductImplParams struct {\n\tProductName string\n}\n```\n\n```go\ntype ProductSoakConfigParams struct {\n\tProductName string\n}\n```\n\n```go\ntype PromQueryResponseData struct {\n\tResultType string                    `json:\"resultType\"`\n\tResult     []PromQueryResponseResult `json:\"result\"`\n}\n```\n\n```go\ntype PromQueryResponseResult struct {\n\tMetric map[string]string `json:\"metric\"`\n\tValue  []interface{}     `json:\"value\"`\n}\n```\n\n```go\ntype PrometheusQueryClient struct {\n\t// contains filtered or unexported fields\n}\n```\nPrometheusQueryClient is a client for querying Prometheus metrics\n\n```go\nfunc NewPrometheusQueryClient(baseURL string) *PrometheusQueryClient\n```\nNewPrometheusQueryClient creates a new PrometheusQueryClient\n\n```go\nfunc (p *PrometheusQueryClient) Query(query string, timestamp time.Time) (*PrometheusQueryResponse, error)\n```\nQuery executes an instant query against the Prometheus API\n\n```go\nfunc (p *PrometheusQueryClient) QueryRange(params QueryRangeParams) (*QueryRangeResponse, error)\n```\nQueryRange executes a range query against the Prometheus API\n\n```go\ntype PrometheusQueryResponse struct {\n\tStatus string                 `json:\"status\"`\n\tData   *PromQueryResponseData `json:\"data\"`\n}\n```\nPrometheusQueryResponse represents the response from Prometheus API\n\n```go\ntype QueryParams struct {\n\tQuery     string\n\tStartTime time.Time\n\tEndTime   time.Time\n\tLimit     int\n}\n```\nQueryParams holds the parameters required for querying Loki\n\n```go\ntype QueryRangeParams struct {\n\tQuery string\n\tStart time.Time\n\tEnd   time.Time\n\tStep  time.Duration\n}\n```\nQueryRangeParams contains parameters for range queries\n\n```go\ntype QueryRangeResponse struct {\n\tStatus string `json:\"status\"`\n\tData   struct {\n\t\tResultType string `json:\"resultType\"`\n\t\tResult     []struct {\n\t\t\tMetric map[string]string `json:\"metric\"`\n\t\t\tValues [][]interface{}   `json:\"values\"`\n\t\t} `json:\"result\"`\n\t} `json:\"data\"`\n}\n```\nQueryRangeResponse represents the response from Prometheus range query API\n\n```go\ntype RaneSOTResponseBody struct {\n\tNodes []struct {\n\t\tNOP  string `json:\"nop\"`\n\t\tJobs []struct {\n\t\t\tProduct string `json:\"product\"`\n\t\t} `json:\"jobs\"`\n\t\tDockerTag  string `json:\"docker_tag\"`\n\t\tVersionTag string `json:\"version_tag\"`\n\t} `json:\"nodes\"`\n}\n```\n\n```go\ntype ReadmeParams struct {\n\tCLIName     string\n\tProductName string\n}\n```\nReadmeParams params for generating README.md file\n\n```go\ntype Response struct {\n\tData struct {\n\t\tResult []struct {\n\t\t\tStream map[string]string `json:\"stream\"`\n\t\t\tValues [][]interface{}   `json:\"values\"`\n\t\t} `json:\"result\"`\n\t} `json:\"data\"`\n}\n```\nResponse represents the structure of the response from Loki\n\n```go\ntype SmokeTestParams struct {\n\tGoModName   string\n\tProductName string\n}\n```\nSmokeTestParams params for generating end-to-end test template\n\n```go\ntype SvcImplParams struct{}\n```\nSvcImplParams service template params\n\n```go\ntype TableTestParams struct {\n\tPackage       string\n\tTableTestName string\n\tTestCases     []TestCaseParams\n\tWorkloadCode  string\n\tGunCode       string\n}\n```\nTableTestParams params for generating a table test\n\n```go\ntype TestCaseParams struct {\n\tName    string\n\tRunFunc string\n}\n```\nTestCaseParams params for generating a test case\n\n```go\ntype UpgradeContext struct {\n\tProductName      string\n\tRefs             []string\n\tDonNodes         int\n\tUpgradeNodes     int\n\tNodeNameTemplate string\n\tRegistry         string\n\tBuildcmd         string\n\tEnvcmd           string\n\tTestcmd          string\n\tSkipPull         bool\n}\n```\nUpgradeContext contains all the data needed for an upgrade test run\n\n```go\ntype UpgradeNRollingSummaryTemplate struct {\n\tTotal    int\n\tEarliest string\n\tLatest   string\n\tSequence []string\n}\n```\nUpgradeNRollingSummaryTemplate holds the data for rendering a rolling N upgrade summary\n\n```go\ntype UpgradeSOTDONSummary struct {\n\tProductName    string\n\tTotalRefs      int\n\tDONSize        int\n\tEarliest       string\n\tLatest         string\n\tSequence       []string\n\tSequenceChunks [][]string\n}\n```\nUpgradeSOTDONSummary holds the data for rendering a SOT DON upgrade summary\n\n```go\ntype ValidationError struct {\n\tField   string\n\tValue   interface{}\n\tMessage string\n}\n```\n\n","path":"github.com/smartcontractkit/chainlink-testing-framework/framework","name":"framework","synopsis":"","isRedistributable":true}
