Skip to content

Commit 0466164

Browse files
committed
Merge branch 'main' into test_doc_generation
2 parents 4a214a6 + 151614d commit 0466164

File tree

88 files changed

+2971
-681
lines changed

Some content is hidden

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

88 files changed

+2971
-681
lines changed

.github/workflows/framework-golden-tests.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ jobs:
1010
env:
1111
LOKI_TENANT_ID: promtail
1212
LOKI_URL: http://localhost:3030/loki/api/v1/push
13+
# this is not the best practice, and it must be fixed, run your tests WITHOUT IT!
14+
# however, on current latest image we must use this flag
15+
CTF_IGNORE_CRITICAL_LOGS: true
1316
runs-on: ubuntu-latest
1417
permissions:
1518
id-token: write

.github/workflows/generate-go-docs.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99

1010
jobs:
1111
generate_docs_new_pr:
12-
if: ${{ github.event.pull_request.labels && contains(github.event.issue.labels.*.name, 'generate_go_docs') }}
12+
if: ${{ contains(github.event.issue.labels.*.name, 'generate_go_docs') }}
1313
runs-on: ubuntu-latest
1414

1515
steps:
@@ -76,7 +76,7 @@ jobs:
7676
id: setup-github-token
7777
uses: smartcontractkit/.github/actions/setup-github-token@9e7cc0779934cae4a9028b8588c9adb64d8ce68c # [email protected]
7878
with:
79-
aws-role-arn: ${{ secrets.AWS_ROLE_ARN_CREATE_PR }}
79+
aws-role-arn: ${{ secrets.AWS_ROLE_ARN_READ_GENERATE_GO_DOC_REPO }}
8080
aws-lambda-url: ${{ secrets.GATI_LAMBDA_TT_URL }}
8181
aws-region: ${{ secrets.AWS_REGION }}
8282

book/src/SUMMARY.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@
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+
- [Creating your own components](./developing/developing_components.md)
1314
- [Fork Testing](./framework/fork.md)
1415
- [Quick Contracts Deployment](./framework/quick_deployment.md)
16+
- [Verifying Contracts](./framework/verify.md)
1517
- [NodeSet with External Blockchain]()
1618
- [CLI](./framework/cli.md)
1719
- [Configuration](./framework/configuration.md)
@@ -33,8 +35,7 @@
3335
- [Blockscout](framework/observability/blockscout.md)
3436
- [Components](framework/components/overview.md)
3537
- [Blockchains](framework/components/blockchains/overview.md)
36-
- [Anvil](framework/components/blockchains/anvil.md)
37-
- [Geth]()
38+
- [EVM](framework/components/blockchains/evm.md)
3839
- [Optimism Stack]()
3940
- [Arbitrum Stack]()
4041
- [Chainlink](framework/components/chainlink.md)
@@ -83,8 +84,6 @@
8384

8485
---
8586

86-
- [Developing](developing.md)
87-
- [Components](developing/developing_components.md)
8887
- [Releasing modules](releasing_modules.md)
8988

9089
---
@@ -93,6 +92,7 @@
9392
- [Kubernetes](lib/k8s/KUBERNETES.md)
9493
- [K8s Remote Run](lib/k8s/REMOTE_RUN.md)
9594
- [K8s Tutorial](lib/k8s/TUTORIAL.md)
95+
- [k8s chain.link labels](lib/k8s/labels.md)
9696
- [Config](lib/config/config.md)
9797
- [CRIB Connector](lib/crib.md)
9898
---

book/src/developing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ Here we describe good practices for developing components for our framework.
55
Rules for components are simple:
66
- Component should declare some `Input` and an optional `Output` (we use that so we can skip or cache any component results)
77
- Components should be isolated, they should not return anything except basic types like `int`, `string`, `maps` or `structs`
8-
- Component **must** have documentation under [Components](./framework/components/overview.md), here is an [example](./framework/components/blockchains/anvil.md)
8+
- Component **must** have documentation under [Components](./framework/components/overview.md), here is an [example](./framework/components/chainlink/node.md)

book/src/developing/developing_components.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,13 @@ Each component can define inputs and outputs, following these rules:
4747
- If your component is used for side effects output can be omitted.
4848
- `input.Out.UseCache` should be added if you'd like to use caching, see more [here](caching)
4949

50-
### Docker components good practices for [testcontainers-go](https://golang.testcontainers.org/):
50+
### Building Local Images
5151

52-
An example [simple component](https://github.com/smartcontractkit/chainlink-testing-framework/blob/main/framework/components/blockchain/anvil.go)
52+
Use `framework.BuildImage` or `framework.BuildImageOnce` to build the docker image.
5353

54-
An example of [complex component](https://github.com/smartcontractkit/chainlink-testing-framework/blob/main/framework/components/clnode/clnode.go)
54+
Do not use `testcontainers.NewDockerProvider()` methods, see issues: [#1](https://github.com/testcontainers/testcontainers-go/pull/2482), [#2](https://github.com/testcontainers/testcontainers-go/issues/1484)
5555

56-
An example of [composite component](https://github.com/smartcontractkit/chainlink-testing-framework/blob/main/framework/components/simple_node_set/node_set.go)
56+
### Docker components good practices for [testcontainers-go](https://golang.testcontainers.org/):
5757

5858
- Inputs should include at least `image`, `tag` and `pull_image` field
5959
```golang
@@ -94,3 +94,10 @@ An example of [composite component](https://github.com/smartcontractkit/chainlin
9494
HostURL: fmt.Sprintf("http://%s:%s", host, mp.Port()),
9595
}, nil
9696
```
97+
98+
An example [simple component](https://github.com/smartcontractkit/chainlink-testing-framework/blob/main/framework/components/blockchain/anvil.go)
99+
100+
An example of [complex component](https://github.com/smartcontractkit/chainlink-testing-framework/blob/main/framework/components/clnode/clnode.go)
101+
102+
An example of [composite component](https://github.com/smartcontractkit/chainlink-testing-framework/blob/main/framework/components/simple_node_set/node_set.go)
103+

book/src/framework/components/blockchains/anvil.md renamed to book/src/framework/components/blockchains/evm.md

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,33 @@
1-
# Anvil
2-
[Anvil](https://book.getfoundry.sh/anvil/) is a Foundry local EVM blockchain simulator
1+
# EVM Blockchain Clients
2+
3+
We support 3 EVM clients at the moment: [Geth](https://geth.ethereum.org/docs/fundamentals/command-line-options), [Anvil](https://book.getfoundry.sh/anvil/) and [Besu](https://besu.hyperledger.org/)
34

45
## Configuration
56
```toml
67
[blockchain_a]
7-
# Blockchain node type, can be "anvil" or "geth"
8+
# Blockchain node type, can be "anvil", "geth" or "besu
89
type = "anvil"
910
# Chain ID
10-
chain_id = "31337"
11+
chain_id = "1337"
1112
# Anvil command line params, ex.: docker_cmd_params = ['--block-time=1', '...']
1213
docker_cmd_params = []
1314
# Docker image and tag
1415
image = "f4hrenh9it/foundry:latest"
15-
# External port to expose
16+
# External port to expose (HTTP API)
1617
port = "8545"
18+
# External port to expose (WS API)
19+
port_ws = "8546"
1720
# Pulls the image every time if set to 'true', used like that in CI. Can be set to 'false' to speed up local runs
1821
pull_image = false
1922

2023
# Outputs are the results of deploying a component that can be used by another component
2124
[blockchain_a.out]
22-
chain_id = "31337"
2325
# If 'use_cache' equals 'true' we skip component setup when we run the test and return the outputs
2426
use_cache = true
27+
# Chain ID
28+
chain_id = "1337"
29+
# Chain family, "evm", "solana", "cosmos", "op", "arb"
30+
family = "evm"
2531

2632
[[blockchain_a.out.nodes]]
2733
# URLs to access the node(s) inside docker network, used by other components
@@ -58,3 +64,13 @@ func TestDON(t *testing.T) {
5864
}
5965
```
6066

67+
## Test Private Keys
68+
69+
For `Geth` and `Anvil` we use the same key
70+
```
71+
Public: 0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266
72+
Private: ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
73+
```
74+
75+
Test keys for `Besu` can be found [here](https://besu.hyperledger.org/23.4.1/private-networks/reference/accounts-for-testing)
76+

book/src/framework/components/chainlink/nodeset.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ This component requires some Blockchain to be deployed, add this to config
1414
# Blockchain node type, can be "anvil" or "geth"
1515
type = "anvil"
1616
# Chain ID
17-
chain_id = "31337"
17+
chain_id = "1337"
1818
# Anvil command line params, ex.: docker_cmd_params = ['--block-time=1', '...']
1919
docker_cmd_params = []
2020
# Docker image and tag
@@ -26,7 +26,7 @@ This component requires some Blockchain to be deployed, add this to config
2626

2727
# Outputs are the results of deploying a component that can be used by another component
2828
[blockchain_a.out]
29-
chain_id = "31337"
29+
chain_id = "1337"
3030
# If 'use_cache' equals 'true' we skip component setup when we run the test and return the outputs
3131
use_cache = true
3232

book/src/framework/components/configuration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ func TestDON(t *testing.T) {
3434
In `TOML`:
3535
```
3636
[blockchain_a]
37-
chain_id = "31337"
37+
chain_id = "1337"
3838
image = "f4hrenh9it/foundry:latest"
3939
port = "8500"
4040
type = "anvil"

book/src/framework/components/external.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ For example, to integrate with remote `k8s` environment you can use `CTF_CONFIGS
1212
[blockchain_a]
1313

1414
[blockchain_a.out]
15-
chain_id = "31337"
15+
chain_id = "1337"
1616
use_cache = true
1717

1818
[[blockchain_a.out.nodes]]

book/src/framework/configuration.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,5 @@
1111
| LOKI_TENANT_ID | Streams all components logs to `Loki`, see params below | `string` | `promtail` | 🚫 |
1212
| LOKI_BASIC_AUTH | Basic auth in format $user:$password | `$user:$password` | - | 🚫 |
1313
| RESTY_DEBUG | Log all Resty client HTTP calls | `true`, `false` | `false` | 🚫 |
14+
| CTF_IGNORE_CRITICAL_LOGS | Ignore all logs that has CRIT,FATAL or PANIC levels (Chainlink nodes only!) | `true`, `false` | `false` | 🚫 |
15+
| CTF_CHAINLINK_IMAGE | Flag to override Chainlink Docker image in format $repository:$tag | $repository:$tag | - | 🚫 |

0 commit comments

Comments
 (0)