Skip to content

Generate gRPC client for Frontier APIs #3

@rohilsurana

Description

@rohilsurana

Problem

The current frontier-python SDK uses REST endpoints, but Frontier now exposes gRPC/Connect endpoints on port 8082. Python clients need a gRPC client to connect to these endpoints.

Solution

Generate a Python gRPC client from Frontier's protobuf definitions using Buf. Since Connect is backward compatible with gRPC, a standard gRPC Python client should work seamlessly with Frontier's Connect endpoints.

Implementation

Use Buf to generate the gRPC Python client:

  1. Add buf.gen.yaml configuration:
version: v1
plugins:
  - plugin: buf.build/protocolbuffers/python
    out: gen
  - plugin: buf.build/grpc/python
    out: gen
  1. Generate client:
buf generate

This will generate standard gRPC Python stubs that work with both gRPC and Connect protocols.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions