Skip to content

Commit ea0453b

Browse files
committed
Merge branch 'main' into tt-1806-required-labels
2 parents d20761f + 18318aa commit ea0453b

File tree

91 files changed

+4877
-313
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+4877
-313
lines changed

.golangci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ linters:
1313
- unused
1414
# extra
1515
- exhaustive
16-
- exportloopref
16+
- copyloopvar
1717
- revive
1818
- goimports
1919
- gosec

.tool-versions

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
golang 1.21.9
1+
golang 1.22.3
22
nodejs 18.20.3
33
k3d 5.6.3
44
act 0.2.52
5-
golangci-lint 1.57.2
5+
golangci-lint 1.62.0
66
actionlint 1.6.26
77
shellcheck 0.9.0
88
helm 3.15.2

book/src/SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
- [NodeSet with Capabilities](./framework/nodeset_capabilities.md)
1111
- [NodeSet (Local Docker builds)](./framework/nodeset_docker_rebuild.md)
1212
- [NodeSet Compat Environment](./framework/nodeset_compatibility.md)
13+
- [Fork Testing](./framework/fork.md)
1314
- [NodeSet with External Blockchain]()
1415
- [CLI](./framework/cli.md)
1516
- [Configuration](./framework/configuration.md)

book/src/framework/components/configuration.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,10 @@ In `TOML`:
3535
```
3636
[blockchain_a]
3737
chain_id = "31337"
38-
docker_cmd_params = ["--block-time=1"]
39-
image = "f4hrenh9it/foundry"
38+
image = "f4hrenh9it/foundry:latest"
4039
port = "8500"
41-
tag = "latest"
4240
type = "anvil"
41+
docker_cmd_params = ["-b", "1"]
4342
```
4443

4544
### Best practices for configuration and validation

book/src/framework/connecting_chainlink_node.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ Create your configuration in `smoke.toml`
99
image = "f4hrenh9it/foundry:latest"
1010
port = "8545"
1111
type = "anvil"
12+
docker_cmd_params = ["-b", "1"]
13+
1214

1315
[cl_node]
1416

book/src/framework/first_test.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Create your configuration in `smoke.toml`
1111
image = "f4hrenh9it/foundry:latest"
1212
port = "8545"
1313
type = "anvil"
14+
docker_cmd_params = ["-b", "1"]
1415
```
1516

1617
Create your test in `smoke_test.go`

book/src/framework/fork.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Fork Testing
2+
3+
We verify our on-chain and off-chain changes using forks of various networks.
4+
5+
Go to example project [dir](https://github.com/smartcontractkit/chainlink-testing-framework/tree/main/framework/examples/myproject) to try the examples yourself.
6+
7+
## On-chain Only
8+
In this [example](https://github.com/smartcontractkit/chainlink-testing-framework/blob/main/framework/examples/myproject/fork_test.go), we:
9+
10+
- Create two `anvil` networks, each targeting the desired network (change [URLs](https://github.com/smartcontractkit/chainlink-testing-framework/blob/main/framework/examples/myproject/fork.toml) and `anvil` settings as required, see [full anvil](https://book.getfoundry.sh/reference/anvil/) reference).
11+
- Connect two clients to the respective networks.
12+
- Deploy two test contracts.
13+
- Interact with the deployed contracts.
14+
- Demonstrate interactions using the `anvil` RPC client (more client methods examples are [here](https://github.com/smartcontractkit/chainlink-testing-framework/blob/main/framework/rpc/rpc_test.go))
15+
16+
Run it
17+
```
18+
CTF_CONFIGS=fork.toml go test -v -run TestFork
19+
```
20+
21+
## On-chain + Off-chain
22+
23+
The chain setup remains the same as in the previous example, but now we have 5 `Chainlink` nodes [connected with 2 networks](https://github.com/smartcontractkit/chainlink-testing-framework/blob/main/framework/examples/myproject/fork_plus_offchain_test.go).
24+
25+
Run it
26+
```
27+
CTF_CONFIGS=fork_plus_offchain.toml go test -v -run TestOffChainAndFork
28+
```
29+
30+
<div class="warning">
31+
32+
Be mindful of RPC rate limits, as your provider may enforce restrictions. Use `docker_cmd_params` field to configure appropriate rate limiting and retries with the following parameters:
33+
```
34+
--compute-units-per-second <CUPS>
35+
--fork-retry-backoff <BACKOFF>
36+
--retries <retries>
37+
--timeout <timeout>
38+
```
39+
If the network imposes limits, the container will panic, triggering messages indicating that the container health check has failed.
40+
41+
</div>
42+

book/src/framework/nodeset_capabilities.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Create a configuration file `smoke.toml`
2121
image = "f4hrenh9it/foundry:latest"
2222
port = "8545"
2323
type = "anvil"
24+
docker_cmd_params = ["-b", "1"]
2425

2526
[nodeset]
2627
nodes = 5

book/src/framework/nodeset_compatibility.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Create a configuration file `smoke.toml`
99
image = "f4hrenh9it/foundry:latest"
1010
port = "8545"
1111
type = "anvil"
12+
docker_cmd_params = ["-b", "1"]
1213

1314
[nodeset]
1415
nodes = 5

book/src/framework/nodeset_docker_rebuild.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Create a configuration file `smoke.toml`
99
image = "f4hrenh9it/foundry:latest"
1010
port = "8545"
1111
type = "anvil"
12+
docker_cmd_params = ["-b", "1"]
1213

1314
[nodeset]
1415
nodes = 5

0 commit comments

Comments
 (0)