Skip to content

Commit

Permalink
Update workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
cedric-cordenier committed Nov 6, 2024
1 parent 0d7ff26 commit c8d7b2f
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
Binary file modified core/services/workflows/syncer/workflow.wasm
Binary file not shown.
10 changes: 10 additions & 0 deletions core/services/workflows/syncer/workflow_registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,18 @@ func (w *WorkflowRegistry) Start(ctx context.Context) error {
go func() {
w.Logger.Info("starting hardcoded workflow...")

// HACK: don't load the workflow if we aren't a workflow node.
_, err := w.Registry.Get(ctx, "[email protected]")
if err != nil {
w.Logger.Info("not a workflow node, skipping hardcoded workflow")
return
}

moduleConfig := &host.ModuleConfig{Logger: logger.NullLogger, IsUncompressed: true}
spec, err := host.GetWorkflowSpec(ctx, moduleConfig, workflow, config)
if err != nil {
w.Logger.Errorf("failed to get workflow spec", err)
return
}

cfg := workflows.Config{
Expand All @@ -64,10 +72,12 @@ func (w *WorkflowRegistry) Start(ctx context.Context) error {
engine, err := workflows.NewEngine(ctx, cfg)
if err != nil {
w.Logger.Errorf("failed to create engine: %w", err)
return
}
err = engine.Start(ctx)
if err != nil {
w.Logger.Errorf("failed to start hardcoded workflow: %w", err)
return
}
w.subServices = []job.ServiceCtx{engine}
}()
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ require (
github.com/smartcontractkit/chain-selectors v1.0.27
github.com/smartcontractkit/chainlink-automation v0.8.1
github.com/smartcontractkit/chainlink-ccip v0.0.0-20241104130643-4b7e196370c4
github.com/smartcontractkit/chainlink-common v0.3.1-0.20241104162859-eed4b097bcca
github.com/smartcontractkit/chainlink-common v0.3.1-0.20241106142605-0d6b1bc3e0e4
github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f
github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241018134907-a00ba3729b5e
github.com/smartcontractkit/chainlink-feeds v0.1.1
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1079,6 +1079,8 @@ github.com/smartcontractkit/chainlink-ccip v0.0.0-20241104130643-4b7e196370c4 h1
github.com/smartcontractkit/chainlink-ccip v0.0.0-20241104130643-4b7e196370c4/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis=
github.com/smartcontractkit/chainlink-common v0.3.1-0.20241104162859-eed4b097bcca h1:VxyQPUhCzq4AtUA873dX9dbpZJ2TTogJmVL7lP1w6og=
github.com/smartcontractkit/chainlink-common v0.3.1-0.20241104162859-eed4b097bcca/go.mod h1:TQ9/KKXZ9vr8QAlUquqGpSvDCpR+DtABKPXZY4CiRns=
github.com/smartcontractkit/chainlink-common v0.3.1-0.20241106142605-0d6b1bc3e0e4 h1:Kpek0Rl1t9rx7x7VRFjae+UWntvri2yH1hX6HlHQEps=
github.com/smartcontractkit/chainlink-common v0.3.1-0.20241106142605-0d6b1bc3e0e4/go.mod h1:TQ9/KKXZ9vr8QAlUquqGpSvDCpR+DtABKPXZY4CiRns=
github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f h1:BwrIaQIx5Iy6eT+DfLhFfK2XqjxRm74mVdlX8gbu4dw=
github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f/go.mod h1:wHtwSR3F1CQSJJZDQKuqaqFYnvkT+kMyget7dl8Clvo=
github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241018134907-a00ba3729b5e h1:JiETqdNM0bktAUGMc62COwXIaw3rR3M77Me6bBLG0Fg=
Expand Down

0 comments on commit c8d7b2f

Please sign in to comment.