Skip to content

Central hub for shared protobuf definitions in Chainlink

License

Notifications You must be signed in to change notification settings

smartcontractkit/chainlink-protos

Repository files navigation

Chainlink Protos



This repository serves as a central hub for shared protobuf definitions used across various services. Currently, it includes protobuf definitions and generated Go SDKs for the job-distributor and orchestrator services. Contributions and additional proto files for other services are welcome.

Why use Chainlink Protos?

  • No More Copy-Pasting Code: Centralized proto definitions eliminate the need to copy-paste code across different repositories.
  • Publicly Accessible Repository: No need for tokens, credentials, or GOPRIVATE settings.
  • Proto Breaking Changes Validation with Buf: Ensures backward compatibility and consistent formatting.
  • Automated Golang SDK Generation: GitHub workflows keep the generated code up-to-date.
  • Independent Versioning in a Monorepo: Each package is versioned separately for better control and integration.

Usage

Go applications can import only the necessary SDKs.

$ go get github.com/smartcontractkit/chainlink-protos/job-distributor@v<LATEST_VERSION>
$ go get github.com/smartcontractkit/chainlink-protos/orchestrator@v<LATEST_VERSION>

Import

The import varies depending on the go_package option defined in the protos. Below is an example when go_package is set to github.com/smartcontractkit/chainlink-protos/job-distributor/v1/node

import "github.com/smartcontractkit/chainlink-protos/job-distributor/v1/node"

Development

Getting Started

Setup

asdf is a tool version manager. All dependencies used for local development of this repo are managed through asdf. To install asdf:

  1. Install asdf
  2. Follow the instructions to ensure asdf is shimmed into your terminal or development environment

Installing Dependencies

Install the required tools using asdf:

./scripts/setup-asdf-plugin.sh
asdf install

Installing wsRPC

Communication between core node and job distributor requires the library wsRPC. To generate protos that are compatible with wsRPC, we will need to install the CLI.

Follow the instructions here to install it.

Formatting

Ensure buf is installed following the dependencies above.

task fmt

Linting

task lint

Generating GO SDKs

Note

Commiting the generated code resulting from the proto changes is optional. The CI will automatically update the pull request with the generated files through the GitHub workflow.

Generate the GO SDKs to implement gRPC services or clients via task

$ task proto:all
$ task proto:gen:job-distributor # only run for job-distributor
$ task proto:gen:orchestrator: # only run for orchestrator

Contributing

For instructions on how to contribute to chainlink-protos and the release process, see CONTRIBUTING.md

Releasing

For instructions on how to release chainlink-protos, see RELEASE.md

About

Central hub for shared protobuf definitions in Chainlink

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages