package
3.5.7+incompatible
Repository: https://github.com/classzz/classzz.git
Documentation: pkg.go.dev

# README

czzrpc

Build Status ISC License GoDoc

Package czzrpc implements a gRPC server.

Overview

This package provides a gRPC which when combined with the addrindex and txindex provides a powerful API for supporting Bitcoin Cash applications. At present the API only exposes public methods for interacting with transactions and blocks. It does not expose any methods which can control the node so it is safe to expose the API publicly. To control the node continue using the JSON-RPC API.

Why gRPC?

With gRPC it is extremely easy to build well-defined, easy to reason about APIs. Frontend development changes significantly:

  • no more hunting down API documentation - .proto is the canonical format for API contracts.
  • no more hand-crafted JSON call objects - all requests and responses are strongly typed and code-generated, with hints available in the IDE.
  • no more dealing with methods, headers, body and low level networking - everything is handled by gRPC.
  • no more second-guessing the meaning of error codes - gRPC status codes are a canonical way of representing issues in APIs.
  • no more one-off server-side request handlers to avoid concurrent connections - gRPC is based on HTTP2, with multiplexes multiple streams over the same connection.
  • no more problems streaming data from a server - gRPC-Web supports both 1:1 RPCs and 1:many streaming requests.
  • no more data parse errors when rolling out new binaries - backwards and forwards-compatibility of requests and responses.

In short, gRPC moves the interaction between frontend code and the server from the sphere of hand-crafted HTTP requests to well-defined user-logic methods.

Using the API

$ classzz --grpclisten=<your_interface>

License

Package czzrpc is licensed under the copyfree ISC License.

# Packages

No description provided by the author

# Functions

DisableLog disables all library log output.
NewGrpcServer returns a new GrpcServer which has not yet be started.
ServiceReady returns nil when the service is ready and a gRPC error when not.
UseLogger uses a specified Logger to output package logging info.

# Structs

GrpcServer is the gRPC server implementation.
GrpcServerConfig hols the various objects needed by the GrpcServer to perform its functions.

# Interfaces

NetManager is an interface which provides functions for handling new transactions.