Skip to content

Commit

Permalink
finalize part 1 - getting started and most use cases
Browse files Browse the repository at this point in the history
  • Loading branch information
skudasov committed Oct 30, 2024
1 parent 08ec73e commit 02f06a6
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 2 deletions.
3 changes: 2 additions & 1 deletion book/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
- [Overview](./overview.md)
- [Framework](./framework/overview.md)
- [Getting Started](./framework/getting_started.md)
- [First Test](./framework/first_test.md)
- [Your First Test](./framework/first_test.md)
- [Connecting Chainlink Node](./framework/connecting_chainlink_node.md)
- [Connecting Chainlink Node (Multiple networks)]()
- [NodeSet Environment](./framework/nodeset_environment.md)
- [NodeSet with Capabilities](./framework/nodeset_capabilities.md)
- [NodeSet with External Blockchain](./framework/nodeset_external.md)
- [NodeSet (Local Docker builds)](./framework/nodeset_docker_rebuild.md)
- [NodeSet Compat Environment](./framework/nodeset_compatibility.md)
Expand Down
56 changes: 56 additions & 0 deletions book/src/framework/nodeset_capabilities.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Chainlink Node Set Environment Test

Let's use some external capability binaries in our tests and extend the [previous one](nodeset_environment.md).

Download an example capability binary
```
export export GOPRIVATE=github.com/smartcontractkit/capabilities
go get github.com/smartcontractkit/capabilities/kvstore && go install github.com/smartcontractkit/capabilities/kvstore
```

Create a configuration file `smoke.toml`
```toml
[blockchain_a]
chain_id = "31337"
image = "ghcr.io/gakonst/foundry:latest"
port = "8545"
type = "anvil"

[contracts]

[data_provider]
port = 9111

[nodeset]
nodes = 5
override_mode = "all"

[[nodeset.node_specs]]

[nodeset.node_specs.db]
image = "postgres:15.6"
pull_image = true

[nodeset.node_specs.node]
# path to your capability binaries
capabilities = ["./kvstore"]
# default capabilities directory
# capabilities_container_dir = "/home/capabilities"
image = "public.ecr.aws/chainlink/chainlink:v2.17.0"
pull_image = true

```

Run it
```bash
go test -v -run TestNodeSet
```

Now you can configure your capability using `clclient.CreateJobRaw($raw_toml)`.

Capabilities are uploaded to `/home/capabilities` by default.

Summary:
- We deployed a node set with some capabilities


6 changes: 5 additions & 1 deletion book/src/framework/nodeset_external.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ Create a configuration file `smoke-fuji.toml`

```

Set both configs: `export CTF_CONFIGS=smoke.toml,smoke-fuji.toml`
Set both configs and replace your private key:
```bash
export PRIVATE_KEY=...
export CTF_CONFIGS=smoke.toml,smoke-fuji.toml
```

Run it
```bash
Expand Down
3 changes: 3 additions & 0 deletions framework/components/clnode/clnode.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,9 @@ func newNode(in *Input, pgOut *postgres.Output) (*NodeOut, error) {
FileMode: 0644,
},
}
if in.Node.CapabilityContainerDir == "" {
in.Node.CapabilityContainerDir = "/home/capabilities"
}
for _, cp := range in.Node.CapabilitiesBinaryPaths {
cpPath := filepath.Base(cp)
framework.L.Info().Any("Path", cpPath).Str("Binary", cpPath).Msg("Copying capability binary")
Expand Down

0 comments on commit 02f06a6

Please sign in to comment.