Skip to content

Commit bdc8416

Browse files
committed
use volumes for CL node
1 parent 17e45c2 commit bdc8416

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

framework/.changeset/v0.10.16.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- Use volumes for user's home directory and `config` folder for the CL node

framework/components/clnode/clnode.go

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ const (
2929
TmpImageName = "chainlink-tmp:latest"
3030
CustomPortSeparator = ":"
3131
DefaultCapabilitiesDir = "/usr/local/bin"
32+
ConfigVolumeName = "clnode-config"
33+
HomeVolumeName = "clnode-home"
3234
)
3335

3436
var (
@@ -253,6 +255,23 @@ func newNode(in *Input, pgOut *postgres.Output) (*NodeOut, error) {
253255
WithPort(DefaultHTTPPort).
254256
WithStartupTimeout(3 * time.Minute).
255257
WithPollInterval(200 * time.Millisecond),
258+
Mounts: tc.ContainerMounts{
259+
{
260+
// various configuration files
261+
Source: tc.GenericVolumeMountSource{
262+
Name: ConfigVolumeName + "-" + in.Node.Name,
263+
},
264+
Target: "/config",
265+
},
266+
{
267+
// kv store of the OCR jobs and other state files are stored
268+
// in the user's home instead of the DB
269+
Source: tc.GenericVolumeMountSource{
270+
Name: HomeVolumeName + "-" + in.Node.Name,
271+
},
272+
Target: "/home/chainlink",
273+
},
274+
},
256275
}
257276
if in.Node.HTTPPort != 0 && in.Node.P2PPort != 0 {
258277
req.HostConfigModifier = func(h *container.HostConfig) {

0 commit comments

Comments
 (0)