Skip to content

Commit 02f06a6

Browse files
committed
finalize part 1 - getting started and most use cases
1 parent 08ec73e commit 02f06a6

File tree

4 files changed

+66
-2
lines changed

4 files changed

+66
-2
lines changed

book/src/SUMMARY.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33
- [Overview](./overview.md)
44
- [Framework](./framework/overview.md)
55
- [Getting Started](./framework/getting_started.md)
6-
- [First Test](./framework/first_test.md)
6+
- [Your First Test](./framework/first_test.md)
77
- [Connecting Chainlink Node](./framework/connecting_chainlink_node.md)
88
- [Connecting Chainlink Node (Multiple networks)]()
99
- [NodeSet Environment](./framework/nodeset_environment.md)
10+
- [NodeSet with Capabilities](./framework/nodeset_capabilities.md)
1011
- [NodeSet with External Blockchain](./framework/nodeset_external.md)
1112
- [NodeSet (Local Docker builds)](./framework/nodeset_docker_rebuild.md)
1213
- [NodeSet Compat Environment](./framework/nodeset_compatibility.md)
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Chainlink Node Set Environment Test
2+
3+
Let's use some external capability binaries in our tests and extend the [previous one](nodeset_environment.md).
4+
5+
Download an example capability binary
6+
```
7+
export export GOPRIVATE=github.com/smartcontractkit/capabilities
8+
go get github.com/smartcontractkit/capabilities/kvstore && go install github.com/smartcontractkit/capabilities/kvstore
9+
```
10+
11+
Create a configuration file `smoke.toml`
12+
```toml
13+
[blockchain_a]
14+
chain_id = "31337"
15+
image = "ghcr.io/gakonst/foundry:latest"
16+
port = "8545"
17+
type = "anvil"
18+
19+
[contracts]
20+
21+
[data_provider]
22+
port = 9111
23+
24+
[nodeset]
25+
nodes = 5
26+
override_mode = "all"
27+
28+
[[nodeset.node_specs]]
29+
30+
[nodeset.node_specs.db]
31+
image = "postgres:15.6"
32+
pull_image = true
33+
34+
[nodeset.node_specs.node]
35+
# path to your capability binaries
36+
capabilities = ["./kvstore"]
37+
# default capabilities directory
38+
# capabilities_container_dir = "/home/capabilities"
39+
image = "public.ecr.aws/chainlink/chainlink:v2.17.0"
40+
pull_image = true
41+
42+
```
43+
44+
Run it
45+
```bash
46+
go test -v -run TestNodeSet
47+
```
48+
49+
Now you can configure your capability using `clclient.CreateJobRaw($raw_toml)`.
50+
51+
Capabilities are uploaded to `/home/capabilities` by default.
52+
53+
Summary:
54+
- We deployed a node set with some capabilities
55+
56+

book/src/framework/nodeset_external.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,11 @@ Create a configuration file `smoke-fuji.toml`
2020

2121
```
2222

23-
Set both configs: `export CTF_CONFIGS=smoke.toml,smoke-fuji.toml`
23+
Set both configs and replace your private key:
24+
```bash
25+
export PRIVATE_KEY=...
26+
export CTF_CONFIGS=smoke.toml,smoke-fuji.toml
27+
```
2428

2529
Run it
2630
```bash

framework/components/clnode/clnode.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,9 @@ func newNode(in *Input, pgOut *postgres.Output) (*NodeOut, error) {
208208
FileMode: 0644,
209209
},
210210
}
211+
if in.Node.CapabilityContainerDir == "" {
212+
in.Node.CapabilityContainerDir = "/home/capabilities"
213+
}
211214
for _, cp := range in.Node.CapabilitiesBinaryPaths {
212215
cpPath := filepath.Base(cp)
213216
framework.L.Info().Any("Path", cpPath).Str("Binary", cpPath).Msg("Copying capability binary")

0 commit comments

Comments
 (0)