Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions libs/capability/empty_loop.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package capability

import (
"context"

"github.com/hashicorp/go-plugin"
"google.golang.org/grpc"
)

const emptyPluginName = "empty"

func emptyHandshakeConfig() plugin.HandshakeConfig {
return plugin.HandshakeConfig{
MagicCookieKey: "CL_PLUGIN_EMPTY_MAGIC_COOKIE",
MagicCookieValue: "2543d46d-e317-4bc4-a6be-1c018bf3a8c7",
}
}

// emptyLoop exposes no gRPC services. Serving it only satisfies the go-plugin host's process
// supervision; the capability itself is reached through the registry, not through the plugin.
type emptyLoop struct {
plugin.NetRPCUnsupportedPlugin
}

func (*emptyLoop) GRPCServer(*plugin.GRPCBroker, *grpc.Server) error {
return nil
}

func (*emptyLoop) GRPCClient(context.Context, *plugin.GRPCBroker, *grpc.ClientConn) (any, error) {
return struct{}{}, nil
}
37 changes: 37 additions & 0 deletions libs/capability/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"name": "capability",
"projectType": "library",
"projectRoot": "libs/capability",
"tags": [],
"targets": {
"lint": {
"executor": "nx:run-commands",
"options": {
"cwd": "{projectRoot}",
"command": "golangci-lint run ./..."
}
},
"race": {
"executor": "nx:run-commands",
"options": {
"cwd": "{projectRoot}",
"command": "go test -race ./..."
}
},
"test": {
"executor": "nx:run-commands",
"options": {
"cwd": "{projectRoot}",
"command": "go test ./... -coverpkg=./... -coverprofile=coverage.txt"
}
},
"tidy": {
"executor": "nx:run-commands",
"options": {
"cwd": "{projectRoot}",
"command": "go mod tidy"
}
}
}
}

6 changes: 3 additions & 3 deletions libs/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ require (
github.com/smartcontractkit/chainlink-common v0.11.2-0.20261005132539-b7d63d5fd549
github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260804191526-b7a850ae7648
github.com/smartcontractkit/libocr v0.0.0-20260810200708-618b5bf7f342
github.com/spf13/cobra v1.7.0
github.com/spf13/pflag v1.0.5
github.com/spf13/cobra v1.10.2
github.com/spf13/pflag v1.0.10
github.com/spf13/viper v1.17.0
github.com/stretchr/testify v1.12.1
go.opentelemetry.io/contrib/bridges/prometheus v0.68.0
Expand Down Expand Up @@ -83,7 +83,7 @@ require (
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/oklog/run v1.2.0 // indirect
github.com/pelletier/go-toml v1.9.5 // indirect
github.com/pelletier/go-toml/v2 v2.2.4 // indirect
github.com/pelletier/go-toml/v2 v2.4.3 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/prometheus/client_model v0.6.2 // indirect
github.com/prometheus/common v0.67.5 // indirect
Expand Down
16 changes: 9 additions & 7 deletions libs/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading