package
0.4.1
Repository: https://github.com/goplugin/plugin-common.git
Documentation: pkg.go.dev

# README

The code herein is the gRPC wrapper for the CCIP Reporting Plugin Providers

Developing the CCIP Providers requires the follow workflow

  1. Update the golang interfaces in plugin-common/pkg/types, and/or plugin-common/pkg/types/ccip

  2. Mirror those changes as protobuf changes in plugin-common/pkg/loop/internal/pb/ccip note: golang interface <-> gRPC service and struct <-> message remember to run make generate at the top of the repo to generate your changes see docs in internal/pb for more details

  3. If you are adding a new interface, create a file here and implement the gRPC server and client. Follow the testing pattern in the test subdir to ensure roundtrip de/serialization of each and every rpc

  4. If you are updating an interface, then update both the <Interface>GRPCClient and <Interface>GRPCServer in the relevant file.

    • The client code will not compile if you change the interface in plugin-common/pkg/types/ccip and so these are obvious
    • However the server code will compile and you will receive runtime Unimplemented errors (this is a consequence of golang gRPC best practices that embed a UnimplementedServer. the curious reader can go here)
    • Add support for your new method in the static test implementation found in test and add a test case to the roundTrip test for that interface. This roundtrip test is the key to prevent runtime Unimplemented errors
  5. Update the ccip repo with your commit: go get github.com/goplugin/plugin-common@<commit_hash>

    • A useful technique to co-develop changes in plugin-common with ccip (or any other dependent repo) is to use go workspace. A go workspace effectively short circuits the go.mod to use local repos configured by the workspace definition. Ex:
    sh
    make ccip-common-workspace
    cd ccip-common-workspace
    git clone https://github.com/goplugin/ccip.git
    git clone https://github.com/goplugin/plugin-common.git
    go work init
    go work use ccip
    go work use plugin-common 
    
    • NOTE: the plugin-common will be a sore spot for the ccip repo. It is in active develop for Keystone. This means that non-CCIP related changes are happening frequently in plugin-common and core. When these changes necessitate changes in core, it will not be possible to update plugin-common without reconciling the changes between ccip and core. Recent example changes 7992ed8, e9e903b

Example: you add method to OnRampReader

When adding interface methods, maintain alphabetical order of there declaration and implementations. You will thank yourself later! You will find yourself reading multiple files that define or implement the interfaces and this simply organizational principle makes that much easier when there are more than two or three funcs. It really pays off in the tests, when you can easily compare the test cases and the interface definitions.

Example commit: https://github.com/goplugin/plugin-common/commit/c15097958cbdd27943c474052b4bf89c845c2673

# Packages

No description provided by the author

# Functions

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
NewOffRampReaderGRPCClient creates a new OffRampReaderGRPCClient.
NewOffRampReaderGRPCServer creates a new OffRampReaderGRPCServer.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Structs

CommitGasEstimatorGRPCClient implements [cciptypes.GasEstimatorCommit] by wrapping a [ccippb.CommitGasEstimatorReaderGRPCClient] grpc client.
CommitGasEstimatorGRPCServer implements [ccippb.CommitGasEstimatorReaderServer] by wrapping a [cciptypes.GasEstimatorCommit] implementation.
No description provided by the author
CommitProviderServer is a server that wraps the custom methods of the [types.CCIPCommitProvider] this is necessary because those method create new resources that need to be served by the broker when we are running in legacy mode.
CommitStoreGRPCClient implements [cciptypes.CommitStoreReader] by wrapping a [ccippb.CommitStoreReaderGRPCClient] grpc client.
CommitStoreGRPCServer implements [ccippb.CommitStoreReaderServer] by wrapping a [cciptypes.CommitStoreReader] implementation.
ExecGasEstimatorGRPCClient implements [cciptypes.GasEstimatorExec] by wrapping a [ccippb.ExecGasEstimatorReaderGRPCClient] grpc client.
ExecGasEstimatorGRPCServer implements [ccippb.ExecGasEstimatorReaderServer] by wrapping a [cciptypes.GasEstimatorExec] implementation.
No description provided by the author
ExecProviderServer is a server that wraps the custom methods of the [types.CCIPExecProvider] this is necessary because those method create new resources that need to be served by the broker when we are running in legacy mode.
OffRampReaderGRPCClient implement [cciptypes.OffRampReader] by wrapping a grpc client connection this client will be used by the CCIP loop service to communicate with the offramp reader.
OffRampReaderGRPCServer implements [ccippb.OffRampReaderServer] by wrapping a [cciptypes.OffRampReader] implementation.
No description provided by the author
No description provided by the author
PriceGetterGRPCClient implements [cciptypes.PriceGetter] by wrapping a [ccippb.PriceGetterGRPCClient] grpc client.
PriceGetterGRPCServer implements [ccippb.PriceGetterServer] by wrapping a [cciptypes.PriceGetter] implementation.
PriceRegistryGRPCClient implements [cciptypes.PriceRegistryReader] by wrapping a [ccippb.PriceRegistryReaderGRPCClient] grpc client.
PriceRegistryGRPCServer implements [ccippb.PriceRegistryReaderServer] by wrapping a [cciptypes.PriceRegistryReader] implementation.
TokenDataReaderGRPCClient implements [cciptypes.TokenDataReaderReader] by wrapping a [ccippb.TokenDataReaderReaderGRPCClient] grpc client.
TokenDataReaderGRPCServer implements [ccippb.TokenDataReaderReaderServer] by wrapping a [cciptypes.TokenDataReaderReader] implementation.
No description provided by the author
TokenPoolBatchedReaderGRPCServer implements [ccippb.TokenPoolBatchedReaderServer] by wrapping a [cciptypes.TokenPoolBatchedReader] implementation.

# Interfaces

No description provided by the author