Skip to content

Commit

Permalink
Merge pull request #22 from multiversx/grpc-streaming-updates
Browse files Browse the repository at this point in the history
gRPC streaming updates
  • Loading branch information
AdoAdoAdo authored May 24, 2024
2 parents 925c0e8 + 78dec20 commit 1544e6c
Show file tree
Hide file tree
Showing 17 changed files with 2,274 additions and 1,705 deletions.
12 changes: 11 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ SHELL := $(shell which bash)

debugger := $(shell which dlv)

.PHONY: help build run runb kill debug debug-ath
.PHONY: help build run runb kill debug debug-ath protogen proto-install

cmd_dir = cmd/connector
binary = connector
Expand All @@ -22,3 +22,13 @@ debug: build
test:
@echo " > Running unit tests"
go test -cover -race -coverprofile=coverage.txt -covermode=atomic -v ./...

proto-install:
go install google.golang.org/protobuf/cmd/[email protected]
go install google.golang.org/grpc/cmd/[email protected]

protogen:
protoc \
--go_out=. --go_opt=paths=source_relative \
--go-grpc_out=. --go-grpc_opt=paths=source_relative \
data/hyperOutportBlocks/hyperOutportBlock.proto data/hyperOutportBlocks/grpcBlockService.proto
401 changes: 401 additions & 0 deletions data/hyperOutportBlocks/grpcBlockService.pb.go

Large diffs are not rendered by default.

37 changes: 37 additions & 0 deletions data/hyperOutportBlocks/grpcBlockService.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
syntax = "proto3";

package proto;

import "google/protobuf/duration.proto";

import "data/hyperOutportBlocks/hyperOutportBlock.proto";

option go_package = "github.com/multiversx/mx-chain-ws-connector-firehose-go/data/hyperOutportBlocks";

message BlockHashRequest {
string hash = 1;
}

message BlockHashStreamRequest {
string hash = 1;
google.protobuf.Duration pollingInterval = 2;
}

message BlockNonceRequest {
uint64 nonce = 1;
}

message BlockNonceStreamRequest {
uint64 nonce = 1;
google.protobuf.Duration pollingInterval = 2;
}

service BlockStream {
rpc BlocksByHash(BlockHashStreamRequest) returns (stream proto.HyperOutportBlock) {}
rpc BlocksByNonce(BlockNonceStreamRequest) returns (stream proto.HyperOutportBlock) {}
}

service BlockFetch {
rpc GetBlockByHash(BlockHashRequest) returns (HyperOutportBlock) {}
rpc GetBlockByNonce(BlockNonceRequest) returns (proto.HyperOutportBlock) {}
}
317 changes: 317 additions & 0 deletions data/hyperOutportBlocks/grpcBlockService_grpc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 1544e6c

Please sign in to comment.