Skip to content

Generated protobufs in Go for interacting with Hedera™ Hashgraph

License

Notifications You must be signed in to change notification settings

hashgraph/hedera-protobufs-go

Hedera™ Hashgraph Go Protubufs

Generated protobufs in Go for interacting with Hedera Hashgraph: the official distributed consensus platform built using the hashgraph consensus algorithm for fast, fair and secure transactions. Hedera enables and empowers developers to build an entirely new class of decentralized applications.

Install

$ go get github.com/hashgraph/hedera-protobufs-go

Usage

import "github.com/hashgraph/hedera-protobufs-go/services"

Example

to be written

Development

When updating the protobufs submodule, the generated code should be updated.

Prerequisites

  • Go v15+

  • Protobuf Compiler

  • Go plugins for the protobuf compiler

    $ go install google.golang.org/protobuf/cmd/protoc-gen-go
    $ go install google.golang.org/grpc/cmd/protoc-gen-go-grpc

Build

# update the proto/ directory from hedera-protobufs
$ git submodule update --init

# generate go code from protobuf definitions
$ go generate ./...

# ensure the projects build
$ go vet ./...

If you are experiencing generation difficulties:

  • Make sure all protobuf files in the proto subproject are at one folder level(no subdirs)
  • Remove protobuf import directory state/ in the generated .go code.

License

Licensed under Apache License, Version 2.0 – see LICENSE in this repo