|
| 1 | +# External Environment |
| 2 | + |
| 3 | +### Using remote components |
| 4 | + |
| 5 | +Because components are decoupled through outputs, you can use a cached config and switch outputs to any deployed infrastructure, such as staging. |
| 6 | + |
| 7 | +This allows you to reuse the same testing logic for behavior validation. |
| 8 | + |
| 9 | +For example, to integrate with remote `k8s` environment you can use `CTF_CONFIGS=smoke_external.toml` and override all the outputs of components to connect to your remote env. |
| 10 | + |
| 11 | +```toml |
| 12 | +[blockchain_a] |
| 13 | + |
| 14 | + [blockchain_a.out] |
| 15 | + chain_id = "31337" |
| 16 | + use_cache = true |
| 17 | + |
| 18 | + [[blockchain_a.out.nodes]] |
| 19 | + # set up your RPC URLs |
| 20 | + docker_internal_http_url = "http://anvil-2cfcf:8545" |
| 21 | + docker_internal_ws_url = "ws://anvil-2cfcf:8545" |
| 22 | + http_url = "http://127.0.0.1:8545" |
| 23 | + ws_url = "ws://127.0.0.1:8545" |
| 24 | + |
| 25 | +[contracts] |
| 26 | + |
| 27 | + [contracts.out] |
| 28 | + # set up your contracts |
| 29 | + addresses = ["0x5fbdb2315678afecb367f032d93f642f64180aa3"] |
| 30 | + use_cache = true |
| 31 | + |
| 32 | +[data_provider] |
| 33 | + port = 9111 |
| 34 | + |
| 35 | + [data_provider.out] |
| 36 | + # setup your data provider URLs |
| 37 | + base_url_docker = "http://host.docker.internal:9111" |
| 38 | + base_url_host = "http://localhost:9111" |
| 39 | + |
| 40 | +[nodeset] |
| 41 | + |
| 42 | + [[nodeset.node_specs]] |
| 43 | + |
| 44 | + [nodeset.out] |
| 45 | + use_cache = true |
| 46 | + |
| 47 | + [[nodeset.out.cl_nodes]] |
| 48 | + use_cache = true |
| 49 | + |
| 50 | + [nodeset.out.cl_nodes.node] |
| 51 | + # set up each node URLs |
| 52 | + docker_internal_url = "http://node0:6688" |
| 53 | + p2p_docker_internal_url = "http://node0:6690" |
| 54 | + p2p_url = "http://127.0.0.1:12000" |
| 55 | + url = "http://127.0.0.1:10000" |
| 56 | + |
| 57 | + [nodeset.out.cl_nodes.postgresql] |
| 58 | + # set up a database URL so tests can connect to your database if needed |
| 59 | + url = "postgresql://chainlink:[email protected]:13000/db_0?sslmode=disable" |
| 60 | + |
| 61 | + # more nodes in this array, configuration is the same ... |
| 62 | +``` |
0 commit comments