Skip to content

Commit 21bbdce

Browse files
authored
Merge branch 'main' into DX-379
2 parents 7d25782 + 5834a01 commit 21bbdce

File tree

40 files changed

+738
-108
lines changed

40 files changed

+738
-108
lines changed

book/src/SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
- [Components Cleanup](framework/components/cleanup.md)
2626
- [Components Caching](framework/components/caching.md)
2727
- [Components Resources](framework/components/resources.md)
28+
- [Containers Network Isolation](framework/components/network_isolation.md)
2829
- [Mocking Services](framework/components/mocking.md)
2930
- [Copying Files](framework/copying_files.md)
3031
- [External Environment](framework/components/external.md)

book/src/framework/components/blockchains/tron.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
```toml
55
[blockchain_a]
66
type = "tron"
7-
# image = "tronbox/tre" is default image
7+
# image = "tronbox/tre:1.0.3" is default image
88
```
99
Default port is `9090`
1010

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Containers Network Isolation
2+
3+
Some components can be isolated from internet. Since some of them doesn't have `iptables` and must be accessible from local host for debugging we isolate network on DNS level.
4+
5+
JobDistributor is isolated from internet by default to prevent applying manifest changes when run in tests.
6+
7+
NodeSet DNS isolation can be controlled with a flag
8+
```
9+
[[nodesets]]
10+
# NodeSet DNS can be isolated if needed
11+
no_dns = true
12+
```

book/src/framework/components/troubleshooting.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
# Troubleshooting
22

3+
## Can't start `ctf obs u`
4+
```
5+
Error response from daemon: error while creating mount source path '/host_mnt/Users/fsldkfs/Downloads/compose/conf/provisioning/dashboards/cadvisor/cadvisor.json': mkdir /host_mnt/Users/sdfjskj/Downloads/compose/conf/provisioning: operation not permitted
6+
exit status 1
7+
```
8+
9+
#### Solution
10+
Enable Docker to access your directory
11+
```
12+
Docker Desktop -> Settings -> Resources -> File Sharing
13+
```
14+
15+
316
## Can't run `anvil`, issue with `Rosetta`
417
```
518
2024/11/27 15:20:27 ⏳ Waiting for container id 79f8a68c07cc image: f4hrenh9it/foundry:latest. Waiting for: &{Port:8546 timeout:0x14000901278 PollInterval:100ms skipInternalCheck:false}

framework/.changeset/v0.7.5.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
- Add chain type to output
2+
- Expose constants for types and families
3+
- Pin tronbox/tre image, recent changes do not work on amd64

framework/.changeset/v0.7.6.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
- Add troubleshooting for observability stack and file access
2+
- Add DNS isolation for CL node and JD + test

framework/.changeset/v0.7.7.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- JD with a real DB dump

framework/components/blockchain/aptos.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,8 @@ func newAptos(in *Input) (*Output, error) {
127127
}
128128
return &Output{
129129
UseCache: true,
130-
Family: "aptos",
130+
Type: in.Type,
131+
Family: FamilyAptos,
131132
ContainerName: containerName,
132133
Nodes: []*Node{
133134
{

framework/components/blockchain/blockchain.go

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,27 @@ import (
88
"github.com/smartcontractkit/chainlink-testing-framework/framework"
99
)
1010

11+
// Blockchain node type
12+
const (
13+
TypeAnvil = "anvil"
14+
TypeAnvilZKSync = "anvil-zksync"
15+
TypeGeth = "geth"
16+
TypeBesu = "besu"
17+
TypeSolana = "solana"
18+
TypeAptos = "aptos"
19+
TypeSui = "sui"
20+
TypeTron = "tron"
21+
)
22+
23+
// Blockchain node family
24+
const (
25+
FamilyEVM = "evm"
26+
FamilySolana = "solana"
27+
FamilyAptos = "aptos"
28+
FamilySui = "sui"
29+
FamilyTron = "tron"
30+
)
31+
1132
// Input is a blockchain network configuration params
1233
type Input struct {
1334
// Common EVM fields
@@ -36,6 +57,7 @@ type Input struct {
3657
// Output is a blockchain network output, ChainID and one or more nodes that forms the network
3758
type Output struct {
3859
UseCache bool `toml:"use_cache"`
60+
Type string `toml:"type"`
3961
Family string `toml:"family"`
4062
ContainerName string `toml:"container_name"`
4163
NetworkSpecificData *NetworkSpecificData `toml:"network_specific_data"`
@@ -61,21 +83,21 @@ func NewBlockchainNetwork(in *Input) (*Output, error) {
6183
var out *Output
6284
var err error
6385
switch in.Type {
64-
case "anvil":
86+
case TypeAnvil:
6587
out, err = newAnvil(in)
66-
case "geth":
88+
case TypeGeth:
6789
out, err = newGeth(in)
68-
case "besu":
90+
case TypeBesu:
6991
out, err = newBesu(in)
70-
case "solana":
92+
case TypeSolana:
7193
out, err = newSolana(in)
72-
case "aptos":
94+
case TypeAptos:
7395
out, err = newAptos(in)
74-
case "sui":
96+
case TypeSui:
7597
out, err = newSui(in)
76-
case "tron":
98+
case TypeTron:
7799
out, err = newTron(in)
78-
case "anvil-zksync":
100+
case TypeAnvilZKSync:
79101
out, err = newAnvilZksync(in)
80102
default:
81103
return nil, fmt.Errorf("blockchain type is not supported or empty, must be 'anvil' or 'geth'")

framework/components/blockchain/containers.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ func createGenericEvmContainer(in *Input, req testcontainers.ContainerRequest, u
6969

7070
output := Output{
7171
UseCache: true,
72-
Family: "evm",
72+
Type: in.Type,
73+
Family: FamilyEVM,
7374
ChainID: in.ChainID,
7475
ContainerName: containerName,
7576
Container: c,

0 commit comments

Comments
 (0)