versioning and metrics

This commit is contained in:
Jeffrey Picard 2021-07-05 20:20:38 -04:00
parent 228fc6f54b
commit 9c89907bb8
19 changed files with 1960 additions and 386 deletions

13
.github/workflows/build-short.yml vendored Normal file
View file

@ -0,0 +1,13 @@
name: 'Build Hub'
on:
push:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2.1.3
with:
go-version: 1.16.5
- run: go build .

32
.github/workflows/build.yml vendored Normal file
View file

@ -0,0 +1,32 @@
name: 'Build Hub'
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2.1.3
with:
go-version: 1.16.5
- run: |
sudo apt update && \
sudo apt upgrade && \
sudo apt-get install autoconf automake libtool curl make g++ unzip && \
cd /tmp && \
wget https://github.com/protocolbuffers/protobuf/releases/download/v3.17.1/protobuf-all-3.17.1.tar.gz && \
tar xfzv protobuf-all-3.17.1.tar.gz && \
cd protobuf-3.17.1 && \
./autogen.sh && \
./configure && \
make && \
sudo make install && \
sudo ldconfig && \
cd
- run: pip install grpcio grpcio-tools github3.py
- run: go get github.com/golang/protobuf/protoc-gen-go google.golang.org/grpc/cmd/protoc-gen-go-grpc
- run: go build .
- run: ./protobuf/build.sh

View file

@ -1,6 +0,0 @@
# action.yml
name: 'Hub'
description: 'Run go hub'
runs:
using: 'docker'
image: 'dev.dockerfile'

View file

@ -1,4 +0,0 @@
#!/bin/bash
go build .
sudo docker build . -t lbry/hub:latest

18
build_and_push.sh Executable file
View file

@ -0,0 +1,18 @@
#!/bin/bash
# Get new tags from remote
git fetch --tags
# Get latest tag name
latestTag=$(git describe --tags `git rev-list --tags --max-count=1`)
# Make sure it match the format vX.XXXX.XX.XX
[[ $latestTag =~ ^v[0-9]+\.[0-9]{4}\.[0-9]{2}\.[0-9]{2}.*$ ]] || exit 1
# Checkout latest tag
git checkout $latestTag
go build .
docker build . -t lbry/hub:latest
docker tag lbry/hub:latest lbry/hub:$latestTag
docker push lbry/hub:latest
docker push lbry/hub:$latestTag

View file

@ -1,6 +0,0 @@
FROM debian:10-slim
EXPOSE 50051
RUN apt-get update && apt-get install curl -y
RUN curl -L -o /hub https://github.com/lbryio/hub/releases/download/v0.2021.06.14-beta/hub && chmod +x /hub
ENTRYPOINT ["/hub", "serve", "--dev"]

4
go.mod
View file

@ -5,11 +5,13 @@ go 1.16
require (
github.com/akamensky/argparse v1.2.2
github.com/btcsuite/btcutil v1.0.2
github.com/go-zeromq/zmq4 v0.13.0
github.com/golang/protobuf v1.5.2
github.com/lbryio/lbry.go/v2 v2.7.2-0.20210625145058-2b155597bf57
github.com/olivere/elastic/v7 v7.0.24
github.com/prometheus/client_golang v1.11.0
github.com/ybbus/jsonrpc/v2 v2.1.6
golang.org/x/net v0.0.0-20210525063256-abc453219eb5 // indirect
golang.org/x/sys v0.0.0-20210525143221-35b2ab0089ea // indirect
golang.org/x/text v0.3.6
google.golang.org/genproto v0.0.0-20210524171403-669157292da3 // indirect
google.golang.org/grpc v1.38.0

98
go.sum
View file

@ -1,10 +1,20 @@
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII=
github.com/akamensky/argparse v1.2.2 h1:P17T0ZjlUNJuWTPPJ2A5dM1wxarHgHqfYH+AZTo2xQA=
github.com/akamensky/argparse v1.2.2/go.mod h1:S5kwC7IuDcEr5VeXtGPRVZ5o/FdhcMlQz4IZQuw64xA=
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho=
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY=
github.com/aws/aws-sdk-go v1.38.3/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro=
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
github.com/btcsuite/btcd v0.0.0-20190213025234-306aecffea32/go.mod h1:DrZx5ec/dmnfpw9KyYoQyYo7d0KEvTkk/5M/vbZjAr8=
github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ=
github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA=
@ -18,6 +28,8 @@ github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723/go.mod h1:8woku
github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY=
github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY=
github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
@ -38,12 +50,25 @@ github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMo
github.com/go-errors/errors v1.1.1 h1:ljK/pL5ltg3qoN+OtN6yCv9HWSfMwxSx90GJCZQxYNg=
github.com/go-errors/errors v1.1.1/go.mod h1:psDX2osz5VnTOnFWbDeWwS7yejl+uV3FEWEp4lssFEs=
github.com/go-ini/ini v1.48.0/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8=
github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY=
github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A=
github.com/go-ozzo/ozzo-validation v3.6.0+incompatible/go.mod h1:gsEKFIVnabGBt6mXmxK0MoFy+cZoTJY6mu5Ll3LVLBU=
github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
github.com/go-zeromq/goczmq/v4 v4.2.2 h1:HAJN+i+3NW55ijMJJhk7oWxHKXgAuSBkoFfvr8bYj4U=
github.com/go-zeromq/goczmq/v4 v4.2.2/go.mod h1:Sm/lxrfxP/Oxqs0tnHD6WAhwkWrx+S+1MRrKzcxoaYE=
github.com/go-zeromq/zmq4 v0.13.0 h1:XUWXLyeRsPsv4KlKMXnv/cEm//Vew2RLuNmDFQnZQXU=
github.com/go-zeromq/zmq4 v0.13.0/go.mod h1:TrFwdPHMSLG7Rhp8OVhQBkb4bSajfucWv8rwoEFIgSY=
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=
@ -62,8 +87,10 @@ github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
github.com/gopherjs/gopherjs v0.0.0-20190915194858-d3ddacdb130f/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
@ -78,12 +105,20 @@ github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHW
github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U=
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4=
github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ=
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM=
github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/konsorten/go-windows-terminal-sequences v1.0.2 h1:DB17ag19krx9CFsz4o3enTrPXyIXCl+2iCXH/aMAp9s=
github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/konsorten/go-windows-terminal-sequences v1.0.3 h1:CE8S1cTafDpPvMhIxNJKvHsGVBgn1xWYf1NbHQhywc8=
github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
@ -94,7 +129,15 @@ github.com/lbryio/types v0.0.0-20201019032447-f0b4476ef386/go.mod h1:CG3wsDv5BiV
github.com/lyoshenka/bencode v0.0.0-20180323155644-b7abd7672df5/go.mod h1:H0aPCWffGOaDcjkw1iB7W9DVLp6GXmfcJY/7YZCWPA4=
github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=
github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU=
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
github.com/nlopes/slack v0.6.0 h1:jt0jxVQGhssx1Ib7naAOZEZcGdtIhTzkP0nopK0AsRA=
github.com/nlopes/slack v0.6.0/go.mod h1:JzQ9m3PMAqcpeCam7UaHSuBuupz7CmpjehYMayT6YOk=
github.com/olivere/elastic/v7 v7.0.24 h1:9ZcCQP3Pvgese7TaypYiVAL49sCEphyIwkVxtRf8jb8=
@ -103,6 +146,8 @@ github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+W
github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.10.2/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
github.com/onsi/gomega v1.7.0 h1:XPnZz8VVBHjVsy1vzJmRwIcSwiUO+JFfrv/xGiigmME=
github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc=
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
@ -111,12 +156,32 @@ github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo=
github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M=
github.com/prometheus/client_golang v1.11.0 h1:HNkLOAEQMIDv/K+04rukrLx6ch7msSRwf3/SASFAGtQ=
github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0=
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M=
github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo=
github.com/prometheus/common v0.26.0 h1:iMAkS2TDoNWnKM+Kopnx/8tnEStIfpYA0ur0xQzzhMQ=
github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc=
github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU=
github.com/prometheus/procfs v0.6.0 h1:mxy4L2jP6qMonqmq+aTtOx1ifVWUgG/TAmntgbh3xv4=
github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA=
github.com/sebdah/goldie v0.0.0-20190531093107-d313ffb52c77/go.mod h1:jXP4hmWywNEwZzhMuv2ccnqTSFpuq8iyQhtQdkkZBH4=
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
github.com/shopspring/decimal v0.0.0-20191009025716-f1972eb1d1f5/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4=
github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4=
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
github.com/sirupsen/logrus v1.6.0 h1:UBcNElsrwanuuMsnGSlYmtmgbb23qDR5dG+6X6Oo89I=
github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88=
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
github.com/smartystreets/assertions v1.0.1/go.mod h1:kHHU4qYBaI3q23Pp3VPrmWhuIUrLW/7eUrw0BU5VaoM=
github.com/smartystreets/assertions v1.1.1/go.mod h1:tcbTF8ujkAEcZ8TElKY+i30BzYlVhC/LOxJk7iOWnoo=
@ -128,15 +193,20 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/ybbus/jsonrpc v0.0.0-20180411222309-2a548b7d822d h1:tQo6hjclyv3RHUgZOl6iWb2Y44A/sN9bf9LAYfuioEg=
github.com/ybbus/jsonrpc v0.0.0-20180411222309-2a548b7d822d/go.mod h1:XJrh1eMSzdIYFbM08flv0wp5G35eRniyeGut1z+LSiE=
github.com/ybbus/jsonrpc/v2 v2.1.6 h1:++pboiaaD6TZ9FJ1JOBBRB/tPtR1njYzqz1iSZGv+3Y=
github.com/ybbus/jsonrpc/v2 v2.1.6/go.mod h1:rIuG1+ORoiqocf9xs/v+ecaAVeo3zcZHQgInyKFMeg0=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E=
go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191002192127-34f69633bfdc/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
@ -152,35 +222,51 @@ golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20191009170851-d66e71096ffb/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc=
golang.org/x/net v0.0.0-20210525063256-abc453219eb5 h1:wjuX4b5yYQnEQHzd+CBcrcC6OVR2J1CN6mUy0oSxIPo=
golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a h1:DcqTD9SDLc+1P/r1EmRBwnVsrOwW+kk2vWf9n+1sGhs=
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191009170203-06d7bd2c5f4f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210525143221-35b2ab0089ea h1:+WiDlPBBaO+h9vPNZi8uJ3k4BkKQB7Iow3aqwHVA5hI=
golang.org/x/sys v0.0.0-20210525143221-35b2ab0089ea/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40 h1:JWgyZ1qgdTaF3N3oxC+MdTV7qvEEgHo3otj+HB5CM7Q=
golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
@ -232,6 +318,7 @@ google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlba
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
@ -244,7 +331,10 @@ gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWD
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU=
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw=

View file

@ -0,0 +1,60 @@
package metrics
import (
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
"time"
)
var (
PingsCounter = promauto.NewCounter(prometheus.CounterOpts{
Name: "pings",
Help: "Number of pings",
})
ZeroChannelsCounter = promauto.NewCounter(prometheus.CounterOpts{
Name: "zero_channels_counter",
Help: "Number of times zero channels were returned in getUniqueChanne;s",
})
NoRepostedCounter = promauto.NewCounter(prometheus.CounterOpts{
Name: "no_reposted_counter",
Help: "Number of times zero reposted were returned in getClaimsForRepost",
})
GetUniqueChannelsErrorCounter = promauto.NewCounter(prometheus.CounterOpts{
Name: "get_unique_channels_error_counter",
Help: "Number of errors",
})
JsonErrorCounter = promauto.NewCounter(prometheus.CounterOpts{
Name: "json_error_counter",
Help: "JSON parsing errors",
})
MgetErrorCounter = promauto.NewCounter(prometheus.CounterOpts{
Name: "mget_error_counter",
Help: "Mget errors",
})
SearchCounter = promauto.NewCounter(prometheus.CounterOpts{
Name: "searche_counter",
Help: "Total number of searches",
})
ClientCreationErrorCounter = promauto.NewCounter(prometheus.CounterOpts{
Name: "client_creation_error_counter",
Help: "Number of errors",
})
SearchErrorCounter = promauto.NewCounter(prometheus.CounterOpts{
Name: "search_error_counter",
Help: "Number of errors",
})
FatalErrorCounter = promauto.NewCounter(prometheus.CounterOpts{
Name: "fatal_error_counter",
Help: "Number of errors",
})
ErrorCounter = promauto.NewCounter(prometheus.CounterOpts{
Name: "error_counter",
Help: "Number of errors",
})
QueryTime = promauto.NewSummary(prometheus.SummaryOpts{
MaxAge: time.Hour,
Name: "query_time",
Help: "hourly summary of query time",
})
)

57
main.go
View file

@ -43,12 +43,27 @@ func GetEnvironmentStandard() map[string]string {
})
}
func parseArgs(searchRequest *pb.SearchRequest) *server.Args {
/*
func makeServeCmd(parser *argparse.Parser) *argparse.Command {
serveCmd := parser.NewCommand("serve", "start the hub server")
host := serveCmd.String("", "rpchost", &argparse.Options{Required: false, Help: "host", Default: defaultHost})
port := serveCmd.String("", "rpcport", &argparse.Options{Required: false, Help: "port", Default: defaultPort})
esHost := serveCmd.String("", "eshost", &argparse.Options{Required: false, Help: "host", Default: defaultEsHost})
esPort := serveCmd.String("", "esport", &argparse.Options{Required: false, Help: "port", Default: defaultEsPort})
dev := serveCmd.Flag("", "dev", &argparse.Options{Required: false, Help: "port", Default: false})
return serveCmd
}
*/
func parseArgs(searchRequest *pb.SearchRequest, blockReq *pb.BlockRequest) *server.Args {
environment := GetEnvironmentStandard()
parser := argparse.NewParser("hub", "hub server and client")
serveCmd := parser.NewCommand("serve", "start the hub server")
searchCmd := parser.NewCommand("search", "claim search")
host := parser.String("", "rpchost", &argparse.Options{Required: false, Help: "host", Default: defaultHost})
port := parser.String("", "rpcport", &argparse.Options{Required: false, Help: "port", Default: defaultPort})
@ -66,6 +81,8 @@ func parseArgs(searchRequest *pb.SearchRequest) *server.Args {
channelId := parser.String("", "channel_id", &argparse.Options{Required: false, Help: "channel id"})
channelIds := parser.StringList("", "channel_ids", &argparse.Options{Required: false, Help: "channel ids"})
hash := parser.String("", "hash", &argparse.Options{Required: false, Help: "block hash"})
// Now parse the arguments
err := parser.Parse(os.Args)
if err != nil {
@ -74,7 +91,7 @@ func parseArgs(searchRequest *pb.SearchRequest) *server.Args {
args := &server.Args{
Serve: false,
CmdType: server.SearchCmd,
Host: *host,
Port: ":" + *port,
EsHost: *esHost,
@ -102,7 +119,9 @@ func parseArgs(searchRequest *pb.SearchRequest) *server.Args {
}
if serveCmd.Happened() {
args.Serve = true
args.CmdType = server.ServeCmd
} else if searchCmd.Happened() {
args.CmdType = server.SearchCmd
}
if *text != "" {
@ -133,15 +152,21 @@ func parseArgs(searchRequest *pb.SearchRequest) *server.Args {
searchRequest.ChannelId = &pb.InvertibleField{Invert: false, Value: *channelIds}
}
if *hash != "" {
blockReq.Blockhash = *hash
}
return args
}
func main() {
searchRequest := &pb.SearchRequest{}
blockReq := &pb.BlockRequest{}
args := parseArgs(searchRequest)
args := parseArgs(searchRequest, blockReq)
if args.Serve {
if args.CmdType == server.ServeCmd {
l, err := net.Listen("tcp", args.Port)
if err != nil {
@ -154,6 +179,7 @@ func main() {
log.Printf("listening on %s\n", l.Addr().String())
log.Println(s.Args)
go s.PromethusEndpoint("2112", "metrics")
if err := s.GrpcServer.Serve(l); err != nil {
log.Fatalf("failed to serve: %v", err)
}
@ -174,15 +200,20 @@ func main() {
ctx, cancel := context.WithTimeout(context.Background(), time.Second)
defer cancel()
log.Println(args)
switch args.CmdType {
case server.SearchCmd:
r, err := c.Search(ctx, searchRequest)
if err != nil {
log.Fatal(err)
}
r, err := c.Search(ctx, searchRequest)
if err != nil {
log.Fatal(err)
}
log.Printf("found %d results\n", r.GetTotal())
log.Printf("found %d results\n", r.GetTotal())
for _, t := range r.Txos {
fmt.Printf("%s:%d\n", util.TxHashToTxId(t.TxHash), t.Nout)
for _, t := range r.Txos {
fmt.Printf("%s:%d\n", util.TxHashToTxId(t.TxHash), t.Nout)
}
default:
log.Fatalln("Unknown Command Type!")
}
}

View file

@ -7,9 +7,20 @@ import "result.proto";
package pb;
service Hub {
rpc SubscribeHeaders (BlockRequest) returns (stream BlockHeaderOutput) {}
rpc Search (SearchRequest) returns (Outputs) {}
rpc GetBlock (BlockRequest) returns (BlockOutput) {}
rpc GetBlockHeader (BlockRequest) returns (BlockHeaderOutput) {}
rpc GetServerHeight (EmptyMessage) returns (google.protobuf.UInt64Value) {}
rpc GetHeaders (BlockRequest) returns (stream BlockHeaderOutput) {}
rpc Ping (EmptyMessage) returns (google.protobuf.StringValue) {}
rpc Version (EmptyMessage) returns (google.protobuf.StringValue) {}
rpc Features (EmptyMessage) returns (google.protobuf.StringValue) {}
rpc Broadcast(EmptyMessage) returns (google.protobuf.UInt64Value) {}
}
message EmptyMessage {}
message InvertibleField {
bool invert = 1;
repeated string value = 2;
@ -38,7 +49,7 @@ message SearchRequest {
string last_take_over_height = 19;
InvertibleField claim_id = 20;
repeated string claim_name = 22;
repeated string normalized = 23;
repeated string normalized_name = 23;
RangeField tx_position = 24;
RangeField amount = 25;
RangeField timestamp = 26;
@ -54,7 +65,7 @@ message SearchRequest {
repeated string author = 36;
repeated string description = 37;
repeated string claim_type = 38;
RangeField reposted = 39;
RangeField repost_count = 39;
repeated string stream_type = 40;
repeated string media_type = 41;
RangeField fee_amount = 42;
@ -64,7 +75,7 @@ message SearchRequest {
RangeField censor_type = 46;
string claims_in_channel = 47;
RangeField channel_join = 48;
.google.protobuf.BoolValue signature_valid = 49;
.google.protobuf.BoolValue is_signature_valid = 49;
RangeField effective_amount = 51;
RangeField support_amount = 52;
RangeField trending_group = 53;
@ -78,7 +89,7 @@ message SearchRequest {
repeated string signature = 61;
repeated string signature_digest = 62;
repeated string public_key_bytes = 63;
repeated string public_key_hash = 64;
// repeated string public_key_hash = 64;
string public_key_id = 65;
repeated bytes _id = 66;
repeated string any_tags = 67;
@ -93,4 +104,9 @@ message SearchRequest {
.google.protobuf.BoolValue remove_duplicates = 76;
.google.protobuf.BoolValue no_totals = 77;
repeated string search_indices = 78;
}
message BlockRequest {
string blockhash = 1;
bool verbose = 2;
}

View file

@ -60,3 +60,44 @@ message Blocked {
uint32 count = 1;
Output channel = 2;
}
message BlockOutput {
string hash = 1;
int32 confirmations = 2;
}
/*
{ (json object)
"hash" : "hex", (string) the block hash (same as provided)
"confirmations" : n, (numeric) The number of confirmations, or -1 if the block is not on the main chain
"height" : n, (numeric) The block height or index
"version" : n, (numeric) The block version
"versionHex" : "hex", (string) The block version formatted in hexadecimal
"merkleroot" : "hex", (string) The merkle root
"time" : xxx, (numeric) The block time expressed in UNIX epoch time
"mediantime" : xxx, (numeric) The median block time expressed in UNIX epoch time
"nonce" : n, (numeric) The nonce
"bits" : "hex", (string) The bits
"difficulty" : n, (numeric) The difficulty
"chainwork" : "hex", (string) Expected number of hashes required to produce the current chain
"nTx" : n, (numeric) The number of transactions in the block
"previousblockhash" : "hex", (string) The hash of the previous block
"nextblockhash" : "hex" (string) The hash of the next block
}
*/
message BlockHeaderOutput {
string hash = 1;
int64 confirmations = 2;
int64 height = 3;
int64 version = 4;
string versionHex = 5;
string merkleroot = 6;
int64 time = 7;
int64 mediantime = 8;
int64 nonce = 9;
string bits = 10;
double difficulty = 11;
string chainwork = 12;
int64 nTx = 13;
string previousblockhash = 14;
string nextblockhash = 15;
}

View file

@ -73,7 +73,45 @@ func (x RangeField_Op) Number() protoreflect.EnumNumber {
// Deprecated: Use RangeField_Op.Descriptor instead.
func (RangeField_Op) EnumDescriptor() ([]byte, []int) {
return file_hub_proto_rawDescGZIP(), []int{1, 0}
return file_hub_proto_rawDescGZIP(), []int{2, 0}
}
type EmptyMessage struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *EmptyMessage) Reset() {
*x = EmptyMessage{}
if protoimpl.UnsafeEnabled {
mi := &file_hub_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *EmptyMessage) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*EmptyMessage) ProtoMessage() {}
func (x *EmptyMessage) ProtoReflect() protoreflect.Message {
mi := &file_hub_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use EmptyMessage.ProtoReflect.Descriptor instead.
func (*EmptyMessage) Descriptor() ([]byte, []int) {
return file_hub_proto_rawDescGZIP(), []int{0}
}
type InvertibleField struct {
@ -88,7 +126,7 @@ type InvertibleField struct {
func (x *InvertibleField) Reset() {
*x = InvertibleField{}
if protoimpl.UnsafeEnabled {
mi := &file_hub_proto_msgTypes[0]
mi := &file_hub_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -101,7 +139,7 @@ func (x *InvertibleField) String() string {
func (*InvertibleField) ProtoMessage() {}
func (x *InvertibleField) ProtoReflect() protoreflect.Message {
mi := &file_hub_proto_msgTypes[0]
mi := &file_hub_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -114,7 +152,7 @@ func (x *InvertibleField) ProtoReflect() protoreflect.Message {
// Deprecated: Use InvertibleField.ProtoReflect.Descriptor instead.
func (*InvertibleField) Descriptor() ([]byte, []int) {
return file_hub_proto_rawDescGZIP(), []int{0}
return file_hub_proto_rawDescGZIP(), []int{1}
}
func (x *InvertibleField) GetInvert() bool {
@ -143,7 +181,7 @@ type RangeField struct {
func (x *RangeField) Reset() {
*x = RangeField{}
if protoimpl.UnsafeEnabled {
mi := &file_hub_proto_msgTypes[1]
mi := &file_hub_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -156,7 +194,7 @@ func (x *RangeField) String() string {
func (*RangeField) ProtoMessage() {}
func (x *RangeField) ProtoReflect() protoreflect.Message {
mi := &file_hub_proto_msgTypes[1]
mi := &file_hub_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -169,7 +207,7 @@ func (x *RangeField) ProtoReflect() protoreflect.Message {
// Deprecated: Use RangeField.ProtoReflect.Descriptor instead.
func (*RangeField) Descriptor() ([]byte, []int) {
return file_hub_proto_rawDescGZIP(), []int{1}
return file_hub_proto_rawDescGZIP(), []int{2}
}
func (x *RangeField) GetOp() RangeField_Op {
@ -191,57 +229,57 @@ type SearchRequest struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Text string `protobuf:"bytes,1,opt,name=text,proto3" json:"text"`
Name []string `protobuf:"bytes,2,rep,name=name,proto3" json:"name"`
AmountOrder *wrapperspb.Int32Value `protobuf:"bytes,3,opt,name=amount_order,json=amountOrder,proto3" json:"amount_order"`
Limit *wrapperspb.Int32Value `protobuf:"bytes,4,opt,name=limit,proto3" json:"limit"`
OrderBy []string `protobuf:"bytes,5,rep,name=order_by,json=orderBy,proto3" json:"order_by"`
Offset *wrapperspb.Int32Value `protobuf:"bytes,6,opt,name=offset,proto3" json:"offset"`
IsControlling *wrapperspb.BoolValue `protobuf:"bytes,7,opt,name=is_controlling,json=isControlling,proto3" json:"is_controlling"`
LastTakeOverHeight string `protobuf:"bytes,19,opt,name=last_take_over_height,json=lastTakeOverHeight,proto3" json:"last_take_over_height"`
ClaimId *InvertibleField `protobuf:"bytes,20,opt,name=claim_id,json=claimId,proto3" json:"claim_id"`
ClaimName []string `protobuf:"bytes,22,rep,name=claim_name,json=claimName,proto3" json:"claim_name"`
Normalized []string `protobuf:"bytes,23,rep,name=normalized,proto3" json:"normalized"`
TxPosition *RangeField `protobuf:"bytes,24,opt,name=tx_position,json=txPosition,proto3" json:"tx_position"`
Amount *RangeField `protobuf:"bytes,25,opt,name=amount,proto3" json:"amount"`
Timestamp *RangeField `protobuf:"bytes,26,opt,name=timestamp,proto3" json:"timestamp"`
CreationTimestamp *RangeField `protobuf:"bytes,27,opt,name=creation_timestamp,json=creationTimestamp,proto3" json:"creation_timestamp"`
Height *RangeField `protobuf:"bytes,28,opt,name=height,proto3" json:"height"`
CreationHeight *RangeField `protobuf:"bytes,29,opt,name=creation_height,json=creationHeight,proto3" json:"creation_height"`
ActivationHeight *RangeField `protobuf:"bytes,30,opt,name=activation_height,json=activationHeight,proto3" json:"activation_height"`
ExpirationHeight *RangeField `protobuf:"bytes,31,opt,name=expiration_height,json=expirationHeight,proto3" json:"expiration_height"`
ReleaseTime *RangeField `protobuf:"bytes,32,opt,name=release_time,json=releaseTime,proto3" json:"release_time"`
ShortUrl []string `protobuf:"bytes,33,rep,name=short_url,json=shortUrl,proto3" json:"short_url"`
CanonicalUrl []string `protobuf:"bytes,34,rep,name=canonical_url,json=canonicalUrl,proto3" json:"canonical_url"`
Title []string `protobuf:"bytes,35,rep,name=title,proto3" json:"title"`
Author []string `protobuf:"bytes,36,rep,name=author,proto3" json:"author"`
Description []string `protobuf:"bytes,37,rep,name=description,proto3" json:"description"`
ClaimType []string `protobuf:"bytes,38,rep,name=claim_type,json=claimType,proto3" json:"claim_type"`
Reposted *RangeField `protobuf:"bytes,39,opt,name=reposted,proto3" json:"reposted"`
StreamType []string `protobuf:"bytes,40,rep,name=stream_type,json=streamType,proto3" json:"stream_type"`
MediaType []string `protobuf:"bytes,41,rep,name=media_type,json=mediaType,proto3" json:"media_type"`
FeeAmount *RangeField `protobuf:"bytes,42,opt,name=fee_amount,json=feeAmount,proto3" json:"fee_amount"`
FeeCurrency []string `protobuf:"bytes,43,rep,name=fee_currency,json=feeCurrency,proto3" json:"fee_currency"`
Duration *RangeField `protobuf:"bytes,44,opt,name=duration,proto3" json:"duration"`
RepostedClaimHash string `protobuf:"bytes,45,opt,name=reposted_claim_hash,json=repostedClaimHash,proto3" json:"reposted_claim_hash"`
CensorType *RangeField `protobuf:"bytes,46,opt,name=censor_type,json=censorType,proto3" json:"censor_type"`
ClaimsInChannel string `protobuf:"bytes,47,opt,name=claims_in_channel,json=claimsInChannel,proto3" json:"claims_in_channel"`
ChannelJoin *RangeField `protobuf:"bytes,48,opt,name=channel_join,json=channelJoin,proto3" json:"channel_join"`
SignatureValid *wrapperspb.BoolValue `protobuf:"bytes,49,opt,name=signature_valid,json=signatureValid,proto3" json:"signature_valid"`
EffectiveAmount *RangeField `protobuf:"bytes,51,opt,name=effective_amount,json=effectiveAmount,proto3" json:"effective_amount"`
SupportAmount *RangeField `protobuf:"bytes,52,opt,name=support_amount,json=supportAmount,proto3" json:"support_amount"`
TrendingGroup *RangeField `protobuf:"bytes,53,opt,name=trending_group,json=trendingGroup,proto3" json:"trending_group"`
TrendingMixed *RangeField `protobuf:"bytes,54,opt,name=trending_mixed,json=trendingMixed,proto3" json:"trending_mixed"`
TrendingLocal *RangeField `protobuf:"bytes,55,opt,name=trending_local,json=trendingLocal,proto3" json:"trending_local"`
TrendingGlobal *RangeField `protobuf:"bytes,56,opt,name=trending_global,json=trendingGlobal,proto3" json:"trending_global"`
ChannelId *InvertibleField `protobuf:"bytes,57,opt,name=channel_id,json=channelId,proto3" json:"channel_id"`
ChannelIds *InvertibleField `protobuf:"bytes,58,opt,name=channel_ids,json=channelIds,proto3" json:"channel_ids"`
TxId []string `protobuf:"bytes,59,rep,name=tx_id,json=txId,proto3" json:"tx_id"`
TxNout *wrapperspb.Int32Value `protobuf:"bytes,60,opt,name=tx_nout,json=txNout,proto3" json:"tx_nout"`
Signature []string `protobuf:"bytes,61,rep,name=signature,proto3" json:"signature"`
SignatureDigest []string `protobuf:"bytes,62,rep,name=signature_digest,json=signatureDigest,proto3" json:"signature_digest"`
PublicKeyBytes []string `protobuf:"bytes,63,rep,name=public_key_bytes,json=publicKeyBytes,proto3" json:"public_key_bytes"`
PublicKeyHash []string `protobuf:"bytes,64,rep,name=public_key_hash,json=publicKeyHash,proto3" json:"public_key_hash"`
Text string `protobuf:"bytes,1,opt,name=text,proto3" json:"text"`
Name []string `protobuf:"bytes,2,rep,name=name,proto3" json:"name"`
AmountOrder *wrapperspb.Int32Value `protobuf:"bytes,3,opt,name=amount_order,json=amountOrder,proto3" json:"amount_order"`
Limit *wrapperspb.Int32Value `protobuf:"bytes,4,opt,name=limit,proto3" json:"limit"`
OrderBy []string `protobuf:"bytes,5,rep,name=order_by,json=orderBy,proto3" json:"order_by"`
Offset *wrapperspb.Int32Value `protobuf:"bytes,6,opt,name=offset,proto3" json:"offset"`
IsControlling *wrapperspb.BoolValue `protobuf:"bytes,7,opt,name=is_controlling,json=isControlling,proto3" json:"is_controlling"`
LastTakeOverHeight string `protobuf:"bytes,19,opt,name=last_take_over_height,json=lastTakeOverHeight,proto3" json:"last_take_over_height"`
ClaimId *InvertibleField `protobuf:"bytes,20,opt,name=claim_id,json=claimId,proto3" json:"claim_id"`
ClaimName []string `protobuf:"bytes,22,rep,name=claim_name,json=claimName,proto3" json:"claim_name"`
NormalizedName []string `protobuf:"bytes,23,rep,name=normalized_name,json=normalizedName,proto3" json:"normalized_name"`
TxPosition *RangeField `protobuf:"bytes,24,opt,name=tx_position,json=txPosition,proto3" json:"tx_position"`
Amount *RangeField `protobuf:"bytes,25,opt,name=amount,proto3" json:"amount"`
Timestamp *RangeField `protobuf:"bytes,26,opt,name=timestamp,proto3" json:"timestamp"`
CreationTimestamp *RangeField `protobuf:"bytes,27,opt,name=creation_timestamp,json=creationTimestamp,proto3" json:"creation_timestamp"`
Height *RangeField `protobuf:"bytes,28,opt,name=height,proto3" json:"height"`
CreationHeight *RangeField `protobuf:"bytes,29,opt,name=creation_height,json=creationHeight,proto3" json:"creation_height"`
ActivationHeight *RangeField `protobuf:"bytes,30,opt,name=activation_height,json=activationHeight,proto3" json:"activation_height"`
ExpirationHeight *RangeField `protobuf:"bytes,31,opt,name=expiration_height,json=expirationHeight,proto3" json:"expiration_height"`
ReleaseTime *RangeField `protobuf:"bytes,32,opt,name=release_time,json=releaseTime,proto3" json:"release_time"`
ShortUrl []string `protobuf:"bytes,33,rep,name=short_url,json=shortUrl,proto3" json:"short_url"`
CanonicalUrl []string `protobuf:"bytes,34,rep,name=canonical_url,json=canonicalUrl,proto3" json:"canonical_url"`
Title []string `protobuf:"bytes,35,rep,name=title,proto3" json:"title"`
Author []string `protobuf:"bytes,36,rep,name=author,proto3" json:"author"`
Description []string `protobuf:"bytes,37,rep,name=description,proto3" json:"description"`
ClaimType []string `protobuf:"bytes,38,rep,name=claim_type,json=claimType,proto3" json:"claim_type"`
RepostCount *RangeField `protobuf:"bytes,39,opt,name=repost_count,json=repostCount,proto3" json:"repost_count"`
StreamType []string `protobuf:"bytes,40,rep,name=stream_type,json=streamType,proto3" json:"stream_type"`
MediaType []string `protobuf:"bytes,41,rep,name=media_type,json=mediaType,proto3" json:"media_type"`
FeeAmount *RangeField `protobuf:"bytes,42,opt,name=fee_amount,json=feeAmount,proto3" json:"fee_amount"`
FeeCurrency []string `protobuf:"bytes,43,rep,name=fee_currency,json=feeCurrency,proto3" json:"fee_currency"`
Duration *RangeField `protobuf:"bytes,44,opt,name=duration,proto3" json:"duration"`
RepostedClaimHash string `protobuf:"bytes,45,opt,name=reposted_claim_hash,json=repostedClaimHash,proto3" json:"reposted_claim_hash"`
CensorType *RangeField `protobuf:"bytes,46,opt,name=censor_type,json=censorType,proto3" json:"censor_type"`
ClaimsInChannel string `protobuf:"bytes,47,opt,name=claims_in_channel,json=claimsInChannel,proto3" json:"claims_in_channel"`
ChannelJoin *RangeField `protobuf:"bytes,48,opt,name=channel_join,json=channelJoin,proto3" json:"channel_join"`
IsSignatureValid *wrapperspb.BoolValue `protobuf:"bytes,49,opt,name=is_signature_valid,json=isSignatureValid,proto3" json:"is_signature_valid"`
EffectiveAmount *RangeField `protobuf:"bytes,51,opt,name=effective_amount,json=effectiveAmount,proto3" json:"effective_amount"`
SupportAmount *RangeField `protobuf:"bytes,52,opt,name=support_amount,json=supportAmount,proto3" json:"support_amount"`
TrendingGroup *RangeField `protobuf:"bytes,53,opt,name=trending_group,json=trendingGroup,proto3" json:"trending_group"`
TrendingMixed *RangeField `protobuf:"bytes,54,opt,name=trending_mixed,json=trendingMixed,proto3" json:"trending_mixed"`
TrendingLocal *RangeField `protobuf:"bytes,55,opt,name=trending_local,json=trendingLocal,proto3" json:"trending_local"`
TrendingGlobal *RangeField `protobuf:"bytes,56,opt,name=trending_global,json=trendingGlobal,proto3" json:"trending_global"`
ChannelId *InvertibleField `protobuf:"bytes,57,opt,name=channel_id,json=channelId,proto3" json:"channel_id"`
ChannelIds *InvertibleField `protobuf:"bytes,58,opt,name=channel_ids,json=channelIds,proto3" json:"channel_ids"`
TxId []string `protobuf:"bytes,59,rep,name=tx_id,json=txId,proto3" json:"tx_id"`
TxNout *wrapperspb.Int32Value `protobuf:"bytes,60,opt,name=tx_nout,json=txNout,proto3" json:"tx_nout"`
Signature []string `protobuf:"bytes,61,rep,name=signature,proto3" json:"signature"`
SignatureDigest []string `protobuf:"bytes,62,rep,name=signature_digest,json=signatureDigest,proto3" json:"signature_digest"`
PublicKeyBytes []string `protobuf:"bytes,63,rep,name=public_key_bytes,json=publicKeyBytes,proto3" json:"public_key_bytes"`
// repeated string public_key_hash = 64;
PublicKeyId string `protobuf:"bytes,65,opt,name=public_key_id,json=publicKeyId,proto3" json:"public_key_id"`
XId [][]byte `protobuf:"bytes,66,rep,name=_id,json=Id,proto3" json:"_id"`
AnyTags []string `protobuf:"bytes,67,rep,name=any_tags,json=anyTags,proto3" json:"any_tags"`
@ -261,7 +299,7 @@ type SearchRequest struct {
func (x *SearchRequest) Reset() {
*x = SearchRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_hub_proto_msgTypes[2]
mi := &file_hub_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -274,7 +312,7 @@ func (x *SearchRequest) String() string {
func (*SearchRequest) ProtoMessage() {}
func (x *SearchRequest) ProtoReflect() protoreflect.Message {
mi := &file_hub_proto_msgTypes[2]
mi := &file_hub_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -287,7 +325,7 @@ func (x *SearchRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use SearchRequest.ProtoReflect.Descriptor instead.
func (*SearchRequest) Descriptor() ([]byte, []int) {
return file_hub_proto_rawDescGZIP(), []int{2}
return file_hub_proto_rawDescGZIP(), []int{3}
}
func (x *SearchRequest) GetText() string {
@ -360,9 +398,9 @@ func (x *SearchRequest) GetClaimName() []string {
return nil
}
func (x *SearchRequest) GetNormalized() []string {
func (x *SearchRequest) GetNormalizedName() []string {
if x != nil {
return x.Normalized
return x.NormalizedName
}
return nil
}
@ -472,9 +510,9 @@ func (x *SearchRequest) GetClaimType() []string {
return nil
}
func (x *SearchRequest) GetReposted() *RangeField {
func (x *SearchRequest) GetRepostCount() *RangeField {
if x != nil {
return x.Reposted
return x.RepostCount
}
return nil
}
@ -542,9 +580,9 @@ func (x *SearchRequest) GetChannelJoin() *RangeField {
return nil
}
func (x *SearchRequest) GetSignatureValid() *wrapperspb.BoolValue {
func (x *SearchRequest) GetIsSignatureValid() *wrapperspb.BoolValue {
if x != nil {
return x.SignatureValid
return x.IsSignatureValid
}
return nil
}
@ -640,13 +678,6 @@ func (x *SearchRequest) GetPublicKeyBytes() []string {
return nil
}
func (x *SearchRequest) GetPublicKeyHash() []string {
if x != nil {
return x.PublicKeyHash
}
return nil
}
func (x *SearchRequest) GetPublicKeyId() string {
if x != nil {
return x.PublicKeyId
@ -745,13 +776,69 @@ func (x *SearchRequest) GetSearchIndices() []string {
return nil
}
type BlockRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Blockhash string `protobuf:"bytes,1,opt,name=blockhash,proto3" json:"blockhash"`
Verbose bool `protobuf:"varint,2,opt,name=verbose,proto3" json:"verbose"`
}
func (x *BlockRequest) Reset() {
*x = BlockRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_hub_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *BlockRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*BlockRequest) ProtoMessage() {}
func (x *BlockRequest) ProtoReflect() protoreflect.Message {
mi := &file_hub_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use BlockRequest.ProtoReflect.Descriptor instead.
func (*BlockRequest) Descriptor() ([]byte, []int) {
return file_hub_proto_rawDescGZIP(), []int{4}
}
func (x *BlockRequest) GetBlockhash() string {
if x != nil {
return x.Blockhash
}
return ""
}
func (x *BlockRequest) GetVerbose() bool {
if x != nil {
return x.Verbose
}
return false
}
var File_hub_proto protoreflect.FileDescriptor
var file_hub_proto_rawDesc = []byte{
0x0a, 0x09, 0x68, 0x75, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x1a,
0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,
0x2f, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a,
0x0c, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x3f, 0x0a,
0x0c, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x0e, 0x0a,
0x0c, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x3f, 0x0a,
0x0f, 0x49, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x69, 0x62, 0x6c, 0x65, 0x46, 0x69, 0x65, 0x6c, 0x64,
0x12, 0x16, 0x0a, 0x06, 0x69, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08,
0x52, 0x06, 0x69, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75,
@ -763,7 +850,7 @@ var file_hub_proto_rawDesc = []byte{
0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x2e, 0x0a, 0x02, 0x4f, 0x70, 0x12, 0x06, 0x0a, 0x02, 0x45,
0x51, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x4c, 0x54, 0x45, 0x10, 0x01, 0x12, 0x07, 0x0a, 0x03,
0x47, 0x54, 0x45, 0x10, 0x02, 0x12, 0x06, 0x0a, 0x02, 0x4c, 0x54, 0x10, 0x03, 0x12, 0x06, 0x0a,
0x02, 0x47, 0x54, 0x10, 0x04, 0x22, 0xf9, 0x16, 0x0a, 0x0d, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68,
0x02, 0x47, 0x54, 0x10, 0x04, 0x22, 0xe6, 0x16, 0x0a, 0x0d, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x65, 0x78, 0x74, 0x18,
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x65, 0x78, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e,
0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12,
@ -791,52 +878,53 @@ var file_hub_proto_rawDesc = []byte{
0x49, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x69, 0x62, 0x6c, 0x65, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x52,
0x07, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x6c, 0x61, 0x69,
0x6d, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x16, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x63, 0x6c,
0x61, 0x69, 0x6d, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x6e, 0x6f, 0x72, 0x6d, 0x61,
0x6c, 0x69, 0x7a, 0x65, 0x64, 0x18, 0x17, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x6e, 0x6f, 0x72,
0x6d, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x12, 0x2f, 0x0a, 0x0b, 0x74, 0x78, 0x5f, 0x70, 0x6f,
0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x18, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70,
0x62, 0x2e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x0a, 0x74, 0x78,
0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x26, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75,
0x6e, 0x74, 0x18, 0x19, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x61,
0x6e, 0x67, 0x65, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74,
0x12, 0x2c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x1a, 0x20,
0x61, 0x69, 0x6d, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x6e, 0x6f, 0x72, 0x6d, 0x61,
0x6c, 0x69, 0x7a, 0x65, 0x64, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x17, 0x20, 0x03, 0x28, 0x09,
0x52, 0x0e, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x4e, 0x61, 0x6d, 0x65,
0x12, 0x2f, 0x0a, 0x0b, 0x74, 0x78, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18,
0x18, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x61, 0x6e, 0x67, 0x65,
0x46, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x0a, 0x74, 0x78, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f,
0x6e, 0x12, 0x26, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x19, 0x20, 0x01, 0x28,
0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x46, 0x69, 0x65, 0x6c,
0x64, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x2c, 0x0a, 0x09, 0x74, 0x69, 0x6d,
0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x1a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70,
0x62, 0x2e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x09, 0x74, 0x69,
0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x3d, 0x0a, 0x12, 0x63, 0x72, 0x65, 0x61, 0x74,
0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x1b, 0x20,
0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x46, 0x69,
0x65, 0x6c, 0x64, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x3d,
0x0a, 0x12, 0x63, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73,
0x74, 0x61, 0x6d, 0x70, 0x18, 0x1b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x62, 0x2e,
0x52, 0x61, 0x6e, 0x67, 0x65, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x11, 0x63, 0x72, 0x65, 0x61,
0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x26, 0x0a,
0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x1c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e,
0x70, 0x62, 0x2e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x06, 0x68,
0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x37, 0x0a, 0x0f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f,
0x6e, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x1d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e,
0x2e, 0x70, 0x62, 0x2e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x0e,
0x63, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x3b,
0x0a, 0x11, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x68, 0x65, 0x69,
0x67, 0x68, 0x74, 0x18, 0x1e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52,
0x61, 0x6e, 0x67, 0x65, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x10, 0x61, 0x63, 0x74, 0x69, 0x76,
0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x3b, 0x0a, 0x11, 0x65,
0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74,
0x18, 0x1f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x61, 0x6e, 0x67,
0x65, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x10, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69,
0x6f, 0x6e, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x31, 0x0a, 0x0c, 0x72, 0x65, 0x6c, 0x65,
0x61, 0x73, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x20, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e,
0x2e, 0x70, 0x62, 0x2e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x0b,
0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x73,
0x68, 0x6f, 0x72, 0x74, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x21, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08,
0x73, 0x68, 0x6f, 0x72, 0x74, 0x55, 0x72, 0x6c, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x61, 0x6e, 0x6f,
0x6e, 0x69, 0x63, 0x61, 0x6c, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x22, 0x20, 0x03, 0x28, 0x09, 0x52,
0x0c, 0x63, 0x61, 0x6e, 0x6f, 0x6e, 0x69, 0x63, 0x61, 0x6c, 0x55, 0x72, 0x6c, 0x12, 0x14, 0x0a,
0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x23, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69,
0x74, 0x6c, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x18, 0x24, 0x20,
0x03, 0x28, 0x09, 0x52, 0x06, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x12, 0x20, 0x0a, 0x0b, 0x64,
0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x25, 0x20, 0x03, 0x28, 0x09,
0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1d, 0x0a,
0x0a, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x26, 0x20, 0x03, 0x28,
0x09, 0x52, 0x09, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x54, 0x79, 0x70, 0x65, 0x12, 0x2a, 0x0a, 0x08,
0x72, 0x65, 0x70, 0x6f, 0x73, 0x74, 0x65, 0x64, 0x18, 0x27, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e,
0x2e, 0x70, 0x62, 0x2e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x08,
0x72, 0x65, 0x70, 0x6f, 0x73, 0x74, 0x65, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x74, 0x72, 0x65,
0x65, 0x6c, 0x64, 0x52, 0x11, 0x63, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d,
0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x26, 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74,
0x18, 0x1c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x61, 0x6e, 0x67,
0x65, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x37,
0x0a, 0x0f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68,
0x74, 0x18, 0x1d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x61, 0x6e,
0x67, 0x65, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x0e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f,
0x6e, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x3b, 0x0a, 0x11, 0x61, 0x63, 0x74, 0x69, 0x76,
0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x1e, 0x20, 0x01,
0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x46, 0x69, 0x65,
0x6c, 0x64, 0x52, 0x10, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x65,
0x69, 0x67, 0x68, 0x74, 0x12, 0x3b, 0x0a, 0x11, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69,
0x6f, 0x6e, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x1f, 0x20, 0x01, 0x28, 0x0b, 0x32,
0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x52,
0x10, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x69, 0x67, 0x68,
0x74, 0x12, 0x31, 0x0a, 0x0c, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x5f, 0x74, 0x69, 0x6d,
0x65, 0x18, 0x20, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x61, 0x6e,
0x67, 0x65, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x0b, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65,
0x54, 0x69, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x5f, 0x75, 0x72,
0x6c, 0x18, 0x21, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x55, 0x72,
0x6c, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x61, 0x6e, 0x6f, 0x6e, 0x69, 0x63, 0x61, 0x6c, 0x5f, 0x75,
0x72, 0x6c, 0x18, 0x22, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0c, 0x63, 0x61, 0x6e, 0x6f, 0x6e, 0x69,
0x63, 0x61, 0x6c, 0x55, 0x72, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18,
0x23, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x16, 0x0a, 0x06,
0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x18, 0x24, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x61, 0x75,
0x74, 0x68, 0x6f, 0x72, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74,
0x69, 0x6f, 0x6e, 0x18, 0x25, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72,
0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x5f,
0x74, 0x79, 0x70, 0x65, 0x18, 0x26, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x63, 0x6c, 0x61, 0x69,
0x6d, 0x54, 0x79, 0x70, 0x65, 0x12, 0x31, 0x0a, 0x0c, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x74, 0x5f,
0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x27, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x62,
0x2e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x0b, 0x72, 0x65, 0x70,
0x6f, 0x73, 0x74, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x74, 0x72, 0x65,
0x61, 0x6d, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x28, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x73,
0x74, 0x72, 0x65, 0x61, 0x6d, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x65, 0x64,
0x69, 0x61, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x29, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x6d,
@ -860,100 +948,136 @@ var file_hub_proto_rawDesc = []byte{
0x6e, 0x65, 0x6c, 0x12, 0x31, 0x0a, 0x0c, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x5f, 0x6a,
0x6f, 0x69, 0x6e, 0x18, 0x30, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52,
0x61, 0x6e, 0x67, 0x65, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x0b, 0x63, 0x68, 0x61, 0x6e, 0x6e,
0x65, 0x6c, 0x4a, 0x6f, 0x69, 0x6e, 0x12, 0x43, 0x0a, 0x0f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74,
0x75, 0x72, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x18, 0x31, 0x20, 0x01, 0x28, 0x0b, 0x32,
0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75,
0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0e, 0x73, 0x69, 0x67,
0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x12, 0x39, 0x0a, 0x10, 0x65,
0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18,
0x33, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x61, 0x6e, 0x67, 0x65,
0x46, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x0f, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65,
0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x35, 0x0a, 0x0e, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72,
0x74, 0x5f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x34, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e,
0x2e, 0x70, 0x62, 0x2e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x0d,
0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x35, 0x0a,
0x0e, 0x74, 0x72, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18,
0x35, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x61, 0x6e, 0x67, 0x65,
0x46, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x0d, 0x74, 0x72, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x47,
0x72, 0x6f, 0x75, 0x70, 0x12, 0x35, 0x0a, 0x0e, 0x74, 0x72, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67,
0x5f, 0x6d, 0x69, 0x78, 0x65, 0x64, 0x18, 0x36, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70,
0x62, 0x2e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x0d, 0x74, 0x72,
0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x4d, 0x69, 0x78, 0x65, 0x64, 0x12, 0x35, 0x0a, 0x0e, 0x74,
0x72, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x18, 0x37, 0x20,
0x65, 0x6c, 0x4a, 0x6f, 0x69, 0x6e, 0x12, 0x48, 0x0a, 0x12, 0x69, 0x73, 0x5f, 0x73, 0x69, 0x67,
0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x18, 0x31, 0x20, 0x01,
0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x10,
0x69, 0x73, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64,
0x12, 0x39, 0x0a, 0x10, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x61, 0x6d,
0x6f, 0x75, 0x6e, 0x74, 0x18, 0x33, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x62, 0x2e,
0x52, 0x61, 0x6e, 0x67, 0x65, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x0f, 0x65, 0x66, 0x66, 0x65,
0x63, 0x74, 0x69, 0x76, 0x65, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x35, 0x0a, 0x0e, 0x73,
0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x34, 0x20,
0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x46, 0x69,
0x65, 0x6c, 0x64, 0x52, 0x0d, 0x74, 0x72, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x4c, 0x6f, 0x63,
0x61, 0x6c, 0x12, 0x37, 0x0a, 0x0f, 0x74, 0x72, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x67,
0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x18, 0x38, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x62,
0x2e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x0e, 0x74, 0x72, 0x65,
0x6e, 0x64, 0x69, 0x6e, 0x67, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x12, 0x32, 0x0a, 0x0a, 0x63,
0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x39, 0x20, 0x01, 0x28, 0x0b, 0x32,
0x13, 0x2e, 0x70, 0x62, 0x2e, 0x49, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x69, 0x62, 0x6c, 0x65, 0x46,
0x69, 0x65, 0x6c, 0x64, 0x52, 0x09, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x49, 0x64, 0x12,
0x34, 0x0a, 0x0b, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x3a,
0x65, 0x6c, 0x64, 0x52, 0x0d, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x41, 0x6d, 0x6f, 0x75,
0x6e, 0x74, 0x12, 0x35, 0x0a, 0x0e, 0x74, 0x72, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x67,
0x72, 0x6f, 0x75, 0x70, 0x18, 0x35, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x62, 0x2e,
0x52, 0x61, 0x6e, 0x67, 0x65, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x0d, 0x74, 0x72, 0x65, 0x6e,
0x64, 0x69, 0x6e, 0x67, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x35, 0x0a, 0x0e, 0x74, 0x72, 0x65,
0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x6d, 0x69, 0x78, 0x65, 0x64, 0x18, 0x36, 0x20, 0x01, 0x28,
0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x46, 0x69, 0x65, 0x6c,
0x64, 0x52, 0x0d, 0x74, 0x72, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x4d, 0x69, 0x78, 0x65, 0x64,
0x12, 0x35, 0x0a, 0x0e, 0x74, 0x72, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x6c, 0x6f, 0x63,
0x61, 0x6c, 0x18, 0x37, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x61,
0x6e, 0x67, 0x65, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x0d, 0x74, 0x72, 0x65, 0x6e, 0x64, 0x69,
0x6e, 0x67, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x12, 0x37, 0x0a, 0x0f, 0x74, 0x72, 0x65, 0x6e, 0x64,
0x69, 0x6e, 0x67, 0x5f, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x18, 0x38, 0x20, 0x01, 0x28, 0x0b,
0x32, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x46, 0x69, 0x65, 0x6c, 0x64,
0x52, 0x0e, 0x74, 0x72, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c,
0x12, 0x32, 0x0a, 0x0a, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x39,
0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x70, 0x62, 0x2e, 0x49, 0x6e, 0x76, 0x65, 0x72, 0x74,
0x69, 0x62, 0x6c, 0x65, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x0a, 0x63, 0x68, 0x61, 0x6e, 0x6e,
0x65, 0x6c, 0x49, 0x64, 0x73, 0x12, 0x13, 0x0a, 0x05, 0x74, 0x78, 0x5f, 0x69, 0x64, 0x18, 0x3b,
0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x74, 0x78, 0x49, 0x64, 0x12, 0x34, 0x0a, 0x07, 0x74, 0x78,
0x5f, 0x6e, 0x6f, 0x75, 0x74, 0x18, 0x3c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f,
0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e,
0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x06, 0x74, 0x78, 0x4e, 0x6f, 0x75, 0x74,
0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x3d, 0x20,
0x03, 0x28, 0x09, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x29,
0x0a, 0x10, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x5f, 0x64, 0x69, 0x67, 0x65,
0x73, 0x74, 0x18, 0x3e, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74,
0x75, 0x72, 0x65, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, 0x28, 0x0a, 0x10, 0x70, 0x75, 0x62,
0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x3f, 0x20,
0x03, 0x28, 0x09, 0x52, 0x0e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x42, 0x79,
0x74, 0x65, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65,
0x79, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x40, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, 0x70, 0x75,
0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x48, 0x61, 0x73, 0x68, 0x12, 0x22, 0x0a, 0x0d, 0x70,
0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x41, 0x20, 0x01,
0x28, 0x09, 0x52, 0x0b, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x49, 0x64, 0x12,
0x0f, 0x0a, 0x03, 0x5f, 0x69, 0x64, 0x18, 0x42, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x02, 0x49, 0x64,
0x12, 0x19, 0x0a, 0x08, 0x61, 0x6e, 0x79, 0x5f, 0x74, 0x61, 0x67, 0x73, 0x18, 0x43, 0x20, 0x03,
0x28, 0x09, 0x52, 0x07, 0x61, 0x6e, 0x79, 0x54, 0x61, 0x67, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x61,
0x6c, 0x6c, 0x5f, 0x74, 0x61, 0x67, 0x73, 0x18, 0x44, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x61,
0x6c, 0x6c, 0x54, 0x61, 0x67, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x6e, 0x6f, 0x74, 0x5f, 0x74, 0x61,
0x67, 0x73, 0x18, 0x45, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x6f, 0x74, 0x54, 0x61, 0x67,
0x73, 0x12, 0x2a, 0x0a, 0x11, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x63, 0x6c,
0x61, 0x69, 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x46, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0f, 0x72, 0x65,
0x70, 0x6f, 0x73, 0x74, 0x65, 0x64, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x49, 0x64, 0x12, 0x4e, 0x0a,
0x15, 0x68, 0x61, 0x73, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x5f, 0x73, 0x69, 0x67,
0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x47, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67,
0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42,
0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x13, 0x68, 0x61, 0x73, 0x43, 0x68, 0x61,
0x6e, 0x6e, 0x65, 0x6c, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x39, 0x0a,
0x0a, 0x68, 0x61, 0x73, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x48, 0x20, 0x01, 0x28,
0x69, 0x62, 0x6c, 0x65, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x09, 0x63, 0x68, 0x61, 0x6e, 0x6e,
0x65, 0x6c, 0x49, 0x64, 0x12, 0x34, 0x0a, 0x0b, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x5f,
0x69, 0x64, 0x73, 0x18, 0x3a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x70, 0x62, 0x2e, 0x49,
0x6e, 0x76, 0x65, 0x72, 0x74, 0x69, 0x62, 0x6c, 0x65, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x0a,
0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x49, 0x64, 0x73, 0x12, 0x13, 0x0a, 0x05, 0x74, 0x78,
0x5f, 0x69, 0x64, 0x18, 0x3b, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x74, 0x78, 0x49, 0x64, 0x12,
0x34, 0x0a, 0x07, 0x74, 0x78, 0x5f, 0x6e, 0x6f, 0x75, 0x74, 0x18, 0x3c, 0x20, 0x01, 0x28, 0x0b,
0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x06, 0x74,
0x78, 0x4e, 0x6f, 0x75, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75,
0x72, 0x65, 0x18, 0x3d, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74,
0x75, 0x72, 0x65, 0x12, 0x29, 0x0a, 0x10, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65,
0x5f, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x3e, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0f, 0x73,
0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, 0x28,
0x0a, 0x10, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x62, 0x79, 0x74,
0x65, 0x73, 0x18, 0x3f, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63,
0x4b, 0x65, 0x79, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x22, 0x0a, 0x0d, 0x70, 0x75, 0x62, 0x6c,
0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x41, 0x20, 0x01, 0x28, 0x09, 0x52,
0x0b, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x49, 0x64, 0x12, 0x0f, 0x0a, 0x03,
0x5f, 0x69, 0x64, 0x18, 0x42, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x02, 0x49, 0x64, 0x12, 0x19, 0x0a,
0x08, 0x61, 0x6e, 0x79, 0x5f, 0x74, 0x61, 0x67, 0x73, 0x18, 0x43, 0x20, 0x03, 0x28, 0x09, 0x52,
0x07, 0x61, 0x6e, 0x79, 0x54, 0x61, 0x67, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x6c, 0x6c, 0x5f,
0x74, 0x61, 0x67, 0x73, 0x18, 0x44, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x61, 0x6c, 0x6c, 0x54,
0x61, 0x67, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x6e, 0x6f, 0x74, 0x5f, 0x74, 0x61, 0x67, 0x73, 0x18,
0x45, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x6f, 0x74, 0x54, 0x61, 0x67, 0x73, 0x12, 0x2a,
0x0a, 0x11, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x63, 0x6c, 0x61, 0x69, 0x6d,
0x5f, 0x69, 0x64, 0x18, 0x46, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0f, 0x72, 0x65, 0x70, 0x6f, 0x73,
0x74, 0x65, 0x64, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x49, 0x64, 0x12, 0x4e, 0x0a, 0x15, 0x68, 0x61,
0x73, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74,
0x75, 0x72, 0x65, 0x18, 0x47, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c,
0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x13, 0x68, 0x61, 0x73, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65,
0x6c, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x39, 0x0a, 0x0a, 0x68, 0x61,
0x73, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x48, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a,
0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,
0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x09, 0x68, 0x61, 0x73, 0x53,
0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x54, 0x0a, 0x18, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x5f, 0x63,
0x6c, 0x61, 0x69, 0x6d, 0x73, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65,
0x6c, 0x18, 0x49, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x56,
0x61, 0x6c, 0x75, 0x65, 0x52, 0x15, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x43, 0x6c, 0x61, 0x69, 0x6d,
0x73, 0x50, 0x65, 0x72, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x12, 0x23, 0x0a, 0x0d, 0x61,
0x6e, 0x79, 0x5f, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x73, 0x18, 0x4a, 0x20, 0x03,
0x28, 0x09, 0x52, 0x0c, 0x61, 0x6e, 0x79, 0x4c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x73,
0x12, 0x23, 0x0a, 0x0d, 0x61, 0x6c, 0x6c, 0x5f, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65,
0x73, 0x18, 0x4b, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0c, 0x61, 0x6c, 0x6c, 0x4c, 0x61, 0x6e, 0x67,
0x75, 0x61, 0x67, 0x65, 0x73, 0x12, 0x47, 0x0a, 0x11, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x5f,
0x64, 0x75, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x65, 0x73, 0x18, 0x4c, 0x20, 0x01, 0x28, 0x0b,
0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x10, 0x72, 0x65,
0x6d, 0x6f, 0x76, 0x65, 0x44, 0x75, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x65, 0x73, 0x12, 0x37,
0x0a, 0x09, 0x6e, 0x6f, 0x5f, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x73, 0x18, 0x4d, 0x20, 0x01, 0x28,
0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x62, 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x09, 0x68,
0x61, 0x73, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x54, 0x0a, 0x18, 0x6c, 0x69, 0x6d, 0x69,
0x74, 0x5f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x73, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x63, 0x68, 0x61,
0x6e, 0x6e, 0x65, 0x6c, 0x18, 0x49, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f,
0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74,
0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x15, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x43, 0x6c,
0x61, 0x69, 0x6d, 0x73, 0x50, 0x65, 0x72, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x12, 0x23,
0x0a, 0x0d, 0x61, 0x6e, 0x79, 0x5f, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x73, 0x18,
0x4a, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0c, 0x61, 0x6e, 0x79, 0x4c, 0x61, 0x6e, 0x67, 0x75, 0x61,
0x67, 0x65, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x61, 0x6c, 0x6c, 0x5f, 0x6c, 0x61, 0x6e, 0x67, 0x75,
0x61, 0x67, 0x65, 0x73, 0x18, 0x4b, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0c, 0x61, 0x6c, 0x6c, 0x4c,
0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x73, 0x12, 0x47, 0x0a, 0x11, 0x72, 0x65, 0x6d, 0x6f,
0x76, 0x65, 0x5f, 0x64, 0x75, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x65, 0x73, 0x18, 0x4c, 0x20,
0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52,
0x10, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x44, 0x75, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x65,
0x73, 0x12, 0x37, 0x0a, 0x09, 0x6e, 0x6f, 0x5f, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x73, 0x18, 0x4d,
0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65,
0x52, 0x08, 0x6e, 0x6f, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x73, 0x65,
0x61, 0x72, 0x63, 0x68, 0x5f, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x18, 0x4e, 0x20, 0x03,
0x28, 0x09, 0x52, 0x0d, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x49, 0x6e, 0x64, 0x69, 0x63, 0x65,
0x73, 0x32, 0x31, 0x0a, 0x03, 0x48, 0x75, 0x62, 0x12, 0x2a, 0x0a, 0x06, 0x53, 0x65, 0x61, 0x72,
0x63, 0x68, 0x12, 0x11, 0x2e, 0x70, 0x62, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0b, 0x2e, 0x70, 0x62, 0x2e, 0x4f, 0x75, 0x74, 0x70, 0x75,
0x74, 0x73, 0x22, 0x00, 0x42, 0x26, 0x5a, 0x24, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63,
0x6f, 0x6d, 0x2f, 0x6c, 0x62, 0x72, 0x79, 0x69, 0x6f, 0x2f, 0x68, 0x75, 0x62, 0x2f, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x67, 0x6f, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x33,
0x62, 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x08, 0x6e,
0x6f, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x73, 0x65, 0x61, 0x72, 0x63,
0x68, 0x5f, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x18, 0x4e, 0x20, 0x03, 0x28, 0x09, 0x52,
0x0d, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x49, 0x6e, 0x64, 0x69, 0x63, 0x65, 0x73, 0x22, 0x46,
0x0a, 0x0c, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c,
0x0a, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28,
0x09, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x68, 0x61, 0x73, 0x68, 0x12, 0x18, 0x0a, 0x07,
0x76, 0x65, 0x72, 0x62, 0x6f, 0x73, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x76,
0x65, 0x72, 0x62, 0x6f, 0x73, 0x65, 0x32, 0xd4, 0x04, 0x0a, 0x03, 0x48, 0x75, 0x62, 0x12, 0x3f,
0x0a, 0x10, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65,
0x72, 0x73, 0x12, 0x10, 0x2e, 0x70, 0x62, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x71,
0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48,
0x65, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x22, 0x00, 0x30, 0x01, 0x12,
0x2a, 0x0a, 0x06, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x12, 0x11, 0x2e, 0x70, 0x62, 0x2e, 0x53,
0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0b, 0x2e, 0x70,
0x62, 0x2e, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x73, 0x22, 0x00, 0x12, 0x2f, 0x0a, 0x08, 0x47,
0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x10, 0x2e, 0x70, 0x62, 0x2e, 0x42, 0x6c, 0x6f,
0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0f, 0x2e, 0x70, 0x62, 0x2e, 0x42,
0x6c, 0x6f, 0x63, 0x6b, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x22, 0x00, 0x12, 0x3b, 0x0a, 0x0e,
0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x10,
0x2e, 0x70, 0x62, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x1a, 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65,
0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x22, 0x00, 0x12, 0x43, 0x0a, 0x0f, 0x47, 0x65, 0x74,
0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x10, 0x2e, 0x70,
0x62, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x1c,
0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,
0x2e, 0x55, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x00, 0x12, 0x39,
0x0a, 0x0a, 0x47, 0x65, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x12, 0x10, 0x2e, 0x70,
0x62, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15,
0x2e, 0x70, 0x62, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x4f,
0x75, 0x74, 0x70, 0x75, 0x74, 0x22, 0x00, 0x30, 0x01, 0x12, 0x38, 0x0a, 0x04, 0x50, 0x69, 0x6e,
0x67, 0x12, 0x10, 0x2e, 0x70, 0x62, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x4d, 0x65, 0x73, 0x73,
0x61, 0x67, 0x65, 0x1a, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75,
0x65, 0x22, 0x00, 0x12, 0x3b, 0x0a, 0x07, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x10,
0x2e, 0x70, 0x62, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
0x1a, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x00,
0x12, 0x3c, 0x0a, 0x08, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x12, 0x10, 0x2e, 0x70,
0x62, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x1c,
0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,
0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x00, 0x12, 0x3d,
0x0a, 0x09, 0x42, 0x72, 0x6f, 0x61, 0x64, 0x63, 0x61, 0x73, 0x74, 0x12, 0x10, 0x2e, 0x70, 0x62,
0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x1c, 0x2e,
0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e,
0x55, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x00, 0x42, 0x26, 0x5a,
0x24, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6c, 0x62, 0x72, 0x79,
0x69, 0x6f, 0x2f, 0x68, 0x75, 0x62, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f,
0x67, 0x6f, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@ -969,56 +1093,80 @@ func file_hub_proto_rawDescGZIP() []byte {
}
var file_hub_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_hub_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
var file_hub_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
var file_hub_proto_goTypes = []interface{}{
(RangeField_Op)(0), // 0: pb.RangeField.Op
(*InvertibleField)(nil), // 1: pb.InvertibleField
(*RangeField)(nil), // 2: pb.RangeField
(*SearchRequest)(nil), // 3: pb.SearchRequest
(*wrapperspb.Int32Value)(nil), // 4: google.protobuf.Int32Value
(*wrapperspb.BoolValue)(nil), // 5: google.protobuf.BoolValue
(*Outputs)(nil), // 6: pb.Outputs
(RangeField_Op)(0), // 0: pb.RangeField.Op
(*EmptyMessage)(nil), // 1: pb.EmptyMessage
(*InvertibleField)(nil), // 2: pb.InvertibleField
(*RangeField)(nil), // 3: pb.RangeField
(*SearchRequest)(nil), // 4: pb.SearchRequest
(*BlockRequest)(nil), // 5: pb.BlockRequest
(*wrapperspb.Int32Value)(nil), // 6: google.protobuf.Int32Value
(*wrapperspb.BoolValue)(nil), // 7: google.protobuf.BoolValue
(*BlockHeaderOutput)(nil), // 8: pb.BlockHeaderOutput
(*Outputs)(nil), // 9: pb.Outputs
(*BlockOutput)(nil), // 10: pb.BlockOutput
(*wrapperspb.UInt64Value)(nil), // 11: google.protobuf.UInt64Value
(*wrapperspb.StringValue)(nil), // 12: google.protobuf.StringValue
}
var file_hub_proto_depIdxs = []int32{
0, // 0: pb.RangeField.op:type_name -> pb.RangeField.Op
4, // 1: pb.SearchRequest.amount_order:type_name -> google.protobuf.Int32Value
4, // 2: pb.SearchRequest.limit:type_name -> google.protobuf.Int32Value
4, // 3: pb.SearchRequest.offset:type_name -> google.protobuf.Int32Value
5, // 4: pb.SearchRequest.is_controlling:type_name -> google.protobuf.BoolValue
1, // 5: pb.SearchRequest.claim_id:type_name -> pb.InvertibleField
2, // 6: pb.SearchRequest.tx_position:type_name -> pb.RangeField
2, // 7: pb.SearchRequest.amount:type_name -> pb.RangeField
2, // 8: pb.SearchRequest.timestamp:type_name -> pb.RangeField
2, // 9: pb.SearchRequest.creation_timestamp:type_name -> pb.RangeField
2, // 10: pb.SearchRequest.height:type_name -> pb.RangeField
2, // 11: pb.SearchRequest.creation_height:type_name -> pb.RangeField
2, // 12: pb.SearchRequest.activation_height:type_name -> pb.RangeField
2, // 13: pb.SearchRequest.expiration_height:type_name -> pb.RangeField
2, // 14: pb.SearchRequest.release_time:type_name -> pb.RangeField
2, // 15: pb.SearchRequest.reposted:type_name -> pb.RangeField
2, // 16: pb.SearchRequest.fee_amount:type_name -> pb.RangeField
2, // 17: pb.SearchRequest.duration:type_name -> pb.RangeField
2, // 18: pb.SearchRequest.censor_type:type_name -> pb.RangeField
2, // 19: pb.SearchRequest.channel_join:type_name -> pb.RangeField
5, // 20: pb.SearchRequest.signature_valid:type_name -> google.protobuf.BoolValue
2, // 21: pb.SearchRequest.effective_amount:type_name -> pb.RangeField
2, // 22: pb.SearchRequest.support_amount:type_name -> pb.RangeField
2, // 23: pb.SearchRequest.trending_group:type_name -> pb.RangeField
2, // 24: pb.SearchRequest.trending_mixed:type_name -> pb.RangeField
2, // 25: pb.SearchRequest.trending_local:type_name -> pb.RangeField
2, // 26: pb.SearchRequest.trending_global:type_name -> pb.RangeField
1, // 27: pb.SearchRequest.channel_id:type_name -> pb.InvertibleField
1, // 28: pb.SearchRequest.channel_ids:type_name -> pb.InvertibleField
4, // 29: pb.SearchRequest.tx_nout:type_name -> google.protobuf.Int32Value
5, // 30: pb.SearchRequest.has_channel_signature:type_name -> google.protobuf.BoolValue
5, // 31: pb.SearchRequest.has_source:type_name -> google.protobuf.BoolValue
4, // 32: pb.SearchRequest.limit_claims_per_channel:type_name -> google.protobuf.Int32Value
5, // 33: pb.SearchRequest.remove_duplicates:type_name -> google.protobuf.BoolValue
5, // 34: pb.SearchRequest.no_totals:type_name -> google.protobuf.BoolValue
3, // 35: pb.Hub.Search:input_type -> pb.SearchRequest
6, // 36: pb.Hub.Search:output_type -> pb.Outputs
36, // [36:37] is the sub-list for method output_type
35, // [35:36] is the sub-list for method input_type
6, // 1: pb.SearchRequest.amount_order:type_name -> google.protobuf.Int32Value
6, // 2: pb.SearchRequest.limit:type_name -> google.protobuf.Int32Value
6, // 3: pb.SearchRequest.offset:type_name -> google.protobuf.Int32Value
7, // 4: pb.SearchRequest.is_controlling:type_name -> google.protobuf.BoolValue
2, // 5: pb.SearchRequest.claim_id:type_name -> pb.InvertibleField
3, // 6: pb.SearchRequest.tx_position:type_name -> pb.RangeField
3, // 7: pb.SearchRequest.amount:type_name -> pb.RangeField
3, // 8: pb.SearchRequest.timestamp:type_name -> pb.RangeField
3, // 9: pb.SearchRequest.creation_timestamp:type_name -> pb.RangeField
3, // 10: pb.SearchRequest.height:type_name -> pb.RangeField
3, // 11: pb.SearchRequest.creation_height:type_name -> pb.RangeField
3, // 12: pb.SearchRequest.activation_height:type_name -> pb.RangeField
3, // 13: pb.SearchRequest.expiration_height:type_name -> pb.RangeField
3, // 14: pb.SearchRequest.release_time:type_name -> pb.RangeField
3, // 15: pb.SearchRequest.repost_count:type_name -> pb.RangeField
3, // 16: pb.SearchRequest.fee_amount:type_name -> pb.RangeField
3, // 17: pb.SearchRequest.duration:type_name -> pb.RangeField
3, // 18: pb.SearchRequest.censor_type:type_name -> pb.RangeField
3, // 19: pb.SearchRequest.channel_join:type_name -> pb.RangeField
7, // 20: pb.SearchRequest.is_signature_valid:type_name -> google.protobuf.BoolValue
3, // 21: pb.SearchRequest.effective_amount:type_name -> pb.RangeField
3, // 22: pb.SearchRequest.support_amount:type_name -> pb.RangeField
3, // 23: pb.SearchRequest.trending_group:type_name -> pb.RangeField
3, // 24: pb.SearchRequest.trending_mixed:type_name -> pb.RangeField
3, // 25: pb.SearchRequest.trending_local:type_name -> pb.RangeField
3, // 26: pb.SearchRequest.trending_global:type_name -> pb.RangeField
2, // 27: pb.SearchRequest.channel_id:type_name -> pb.InvertibleField
2, // 28: pb.SearchRequest.channel_ids:type_name -> pb.InvertibleField
6, // 29: pb.SearchRequest.tx_nout:type_name -> google.protobuf.Int32Value
7, // 30: pb.SearchRequest.has_channel_signature:type_name -> google.protobuf.BoolValue
7, // 31: pb.SearchRequest.has_source:type_name -> google.protobuf.BoolValue
6, // 32: pb.SearchRequest.limit_claims_per_channel:type_name -> google.protobuf.Int32Value
7, // 33: pb.SearchRequest.remove_duplicates:type_name -> google.protobuf.BoolValue
7, // 34: pb.SearchRequest.no_totals:type_name -> google.protobuf.BoolValue
5, // 35: pb.Hub.SubscribeHeaders:input_type -> pb.BlockRequest
4, // 36: pb.Hub.Search:input_type -> pb.SearchRequest
5, // 37: pb.Hub.GetBlock:input_type -> pb.BlockRequest
5, // 38: pb.Hub.GetBlockHeader:input_type -> pb.BlockRequest
1, // 39: pb.Hub.GetServerHeight:input_type -> pb.EmptyMessage
5, // 40: pb.Hub.GetHeaders:input_type -> pb.BlockRequest
1, // 41: pb.Hub.Ping:input_type -> pb.EmptyMessage
1, // 42: pb.Hub.Version:input_type -> pb.EmptyMessage
1, // 43: pb.Hub.Features:input_type -> pb.EmptyMessage
1, // 44: pb.Hub.Broadcast:input_type -> pb.EmptyMessage
8, // 45: pb.Hub.SubscribeHeaders:output_type -> pb.BlockHeaderOutput
9, // 46: pb.Hub.Search:output_type -> pb.Outputs
10, // 47: pb.Hub.GetBlock:output_type -> pb.BlockOutput
8, // 48: pb.Hub.GetBlockHeader:output_type -> pb.BlockHeaderOutput
11, // 49: pb.Hub.GetServerHeight:output_type -> google.protobuf.UInt64Value
8, // 50: pb.Hub.GetHeaders:output_type -> pb.BlockHeaderOutput
12, // 51: pb.Hub.Ping:output_type -> google.protobuf.StringValue
12, // 52: pb.Hub.Version:output_type -> google.protobuf.StringValue
12, // 53: pb.Hub.Features:output_type -> google.protobuf.StringValue
11, // 54: pb.Hub.Broadcast:output_type -> google.protobuf.UInt64Value
45, // [45:55] is the sub-list for method output_type
35, // [35:45] is the sub-list for method input_type
35, // [35:35] is the sub-list for extension type_name
35, // [35:35] is the sub-list for extension extendee
0, // [0:35] is the sub-list for field type_name
@ -1032,7 +1180,7 @@ func file_hub_proto_init() {
file_result_proto_init()
if !protoimpl.UnsafeEnabled {
file_hub_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*InvertibleField); i {
switch v := v.(*EmptyMessage); i {
case 0:
return &v.state
case 1:
@ -1044,7 +1192,7 @@ func file_hub_proto_init() {
}
}
file_hub_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*RangeField); i {
switch v := v.(*InvertibleField); i {
case 0:
return &v.state
case 1:
@ -1056,6 +1204,18 @@ func file_hub_proto_init() {
}
}
file_hub_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*RangeField); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_hub_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SearchRequest); i {
case 0:
return &v.state
@ -1067,6 +1227,18 @@ func file_hub_proto_init() {
return nil
}
}
file_hub_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*BlockRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
@ -1074,7 +1246,7 @@ func file_hub_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_hub_proto_rawDesc,
NumEnums: 1,
NumMessages: 3,
NumMessages: 5,
NumExtensions: 0,
NumServices: 1,
},

View file

@ -7,6 +7,7 @@ import (
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
wrapperspb "google.golang.org/protobuf/types/known/wrapperspb"
)
// This is a compile-time assertion to ensure that this generated file
@ -18,7 +19,16 @@ const _ = grpc.SupportPackageIsVersion7
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type HubClient interface {
SubscribeHeaders(ctx context.Context, in *BlockRequest, opts ...grpc.CallOption) (Hub_SubscribeHeadersClient, error)
Search(ctx context.Context, in *SearchRequest, opts ...grpc.CallOption) (*Outputs, error)
GetBlock(ctx context.Context, in *BlockRequest, opts ...grpc.CallOption) (*BlockOutput, error)
GetBlockHeader(ctx context.Context, in *BlockRequest, opts ...grpc.CallOption) (*BlockHeaderOutput, error)
GetServerHeight(ctx context.Context, in *EmptyMessage, opts ...grpc.CallOption) (*wrapperspb.UInt64Value, error)
GetHeaders(ctx context.Context, in *BlockRequest, opts ...grpc.CallOption) (Hub_GetHeadersClient, error)
Ping(ctx context.Context, in *EmptyMessage, opts ...grpc.CallOption) (*wrapperspb.StringValue, error)
Version(ctx context.Context, in *EmptyMessage, opts ...grpc.CallOption) (*wrapperspb.StringValue, error)
Features(ctx context.Context, in *EmptyMessage, opts ...grpc.CallOption) (*wrapperspb.StringValue, error)
Broadcast(ctx context.Context, in *EmptyMessage, opts ...grpc.CallOption) (*wrapperspb.UInt64Value, error)
}
type hubClient struct {
@ -29,6 +39,38 @@ func NewHubClient(cc grpc.ClientConnInterface) HubClient {
return &hubClient{cc}
}
func (c *hubClient) SubscribeHeaders(ctx context.Context, in *BlockRequest, opts ...grpc.CallOption) (Hub_SubscribeHeadersClient, error) {
stream, err := c.cc.NewStream(ctx, &Hub_ServiceDesc.Streams[0], "/pb.Hub/SubscribeHeaders", opts...)
if err != nil {
return nil, err
}
x := &hubSubscribeHeadersClient{stream}
if err := x.ClientStream.SendMsg(in); err != nil {
return nil, err
}
if err := x.ClientStream.CloseSend(); err != nil {
return nil, err
}
return x, nil
}
type Hub_SubscribeHeadersClient interface {
Recv() (*BlockHeaderOutput, error)
grpc.ClientStream
}
type hubSubscribeHeadersClient struct {
grpc.ClientStream
}
func (x *hubSubscribeHeadersClient) Recv() (*BlockHeaderOutput, error) {
m := new(BlockHeaderOutput)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
func (c *hubClient) Search(ctx context.Context, in *SearchRequest, opts ...grpc.CallOption) (*Outputs, error) {
out := new(Outputs)
err := c.cc.Invoke(ctx, "/pb.Hub/Search", in, out, opts...)
@ -38,11 +80,115 @@ func (c *hubClient) Search(ctx context.Context, in *SearchRequest, opts ...grpc.
return out, nil
}
func (c *hubClient) GetBlock(ctx context.Context, in *BlockRequest, opts ...grpc.CallOption) (*BlockOutput, error) {
out := new(BlockOutput)
err := c.cc.Invoke(ctx, "/pb.Hub/GetBlock", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *hubClient) GetBlockHeader(ctx context.Context, in *BlockRequest, opts ...grpc.CallOption) (*BlockHeaderOutput, error) {
out := new(BlockHeaderOutput)
err := c.cc.Invoke(ctx, "/pb.Hub/GetBlockHeader", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *hubClient) GetServerHeight(ctx context.Context, in *EmptyMessage, opts ...grpc.CallOption) (*wrapperspb.UInt64Value, error) {
out := new(wrapperspb.UInt64Value)
err := c.cc.Invoke(ctx, "/pb.Hub/GetServerHeight", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *hubClient) GetHeaders(ctx context.Context, in *BlockRequest, opts ...grpc.CallOption) (Hub_GetHeadersClient, error) {
stream, err := c.cc.NewStream(ctx, &Hub_ServiceDesc.Streams[1], "/pb.Hub/GetHeaders", opts...)
if err != nil {
return nil, err
}
x := &hubGetHeadersClient{stream}
if err := x.ClientStream.SendMsg(in); err != nil {
return nil, err
}
if err := x.ClientStream.CloseSend(); err != nil {
return nil, err
}
return x, nil
}
type Hub_GetHeadersClient interface {
Recv() (*BlockHeaderOutput, error)
grpc.ClientStream
}
type hubGetHeadersClient struct {
grpc.ClientStream
}
func (x *hubGetHeadersClient) Recv() (*BlockHeaderOutput, error) {
m := new(BlockHeaderOutput)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
func (c *hubClient) Ping(ctx context.Context, in *EmptyMessage, opts ...grpc.CallOption) (*wrapperspb.StringValue, error) {
out := new(wrapperspb.StringValue)
err := c.cc.Invoke(ctx, "/pb.Hub/Ping", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *hubClient) Version(ctx context.Context, in *EmptyMessage, opts ...grpc.CallOption) (*wrapperspb.StringValue, error) {
out := new(wrapperspb.StringValue)
err := c.cc.Invoke(ctx, "/pb.Hub/Version", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *hubClient) Features(ctx context.Context, in *EmptyMessage, opts ...grpc.CallOption) (*wrapperspb.StringValue, error) {
out := new(wrapperspb.StringValue)
err := c.cc.Invoke(ctx, "/pb.Hub/Features", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *hubClient) Broadcast(ctx context.Context, in *EmptyMessage, opts ...grpc.CallOption) (*wrapperspb.UInt64Value, error) {
out := new(wrapperspb.UInt64Value)
err := c.cc.Invoke(ctx, "/pb.Hub/Broadcast", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// HubServer is the server API for Hub service.
// All implementations must embed UnimplementedHubServer
// for forward compatibility
type HubServer interface {
SubscribeHeaders(*BlockRequest, Hub_SubscribeHeadersServer) error
Search(context.Context, *SearchRequest) (*Outputs, error)
GetBlock(context.Context, *BlockRequest) (*BlockOutput, error)
GetBlockHeader(context.Context, *BlockRequest) (*BlockHeaderOutput, error)
GetServerHeight(context.Context, *EmptyMessage) (*wrapperspb.UInt64Value, error)
GetHeaders(*BlockRequest, Hub_GetHeadersServer) error
Ping(context.Context, *EmptyMessage) (*wrapperspb.StringValue, error)
Version(context.Context, *EmptyMessage) (*wrapperspb.StringValue, error)
Features(context.Context, *EmptyMessage) (*wrapperspb.StringValue, error)
Broadcast(context.Context, *EmptyMessage) (*wrapperspb.UInt64Value, error)
mustEmbedUnimplementedHubServer()
}
@ -50,9 +196,36 @@ type HubServer interface {
type UnimplementedHubServer struct {
}
func (UnimplementedHubServer) SubscribeHeaders(*BlockRequest, Hub_SubscribeHeadersServer) error {
return status.Errorf(codes.Unimplemented, "method SubscribeHeaders not implemented")
}
func (UnimplementedHubServer) Search(context.Context, *SearchRequest) (*Outputs, error) {
return nil, status.Errorf(codes.Unimplemented, "method Search not implemented")
}
func (UnimplementedHubServer) GetBlock(context.Context, *BlockRequest) (*BlockOutput, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetBlock not implemented")
}
func (UnimplementedHubServer) GetBlockHeader(context.Context, *BlockRequest) (*BlockHeaderOutput, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetBlockHeader not implemented")
}
func (UnimplementedHubServer) GetServerHeight(context.Context, *EmptyMessage) (*wrapperspb.UInt64Value, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetServerHeight not implemented")
}
func (UnimplementedHubServer) GetHeaders(*BlockRequest, Hub_GetHeadersServer) error {
return status.Errorf(codes.Unimplemented, "method GetHeaders not implemented")
}
func (UnimplementedHubServer) Ping(context.Context, *EmptyMessage) (*wrapperspb.StringValue, error) {
return nil, status.Errorf(codes.Unimplemented, "method Ping not implemented")
}
func (UnimplementedHubServer) Version(context.Context, *EmptyMessage) (*wrapperspb.StringValue, error) {
return nil, status.Errorf(codes.Unimplemented, "method Version not implemented")
}
func (UnimplementedHubServer) Features(context.Context, *EmptyMessage) (*wrapperspb.StringValue, error) {
return nil, status.Errorf(codes.Unimplemented, "method Features not implemented")
}
func (UnimplementedHubServer) Broadcast(context.Context, *EmptyMessage) (*wrapperspb.UInt64Value, error) {
return nil, status.Errorf(codes.Unimplemented, "method Broadcast not implemented")
}
func (UnimplementedHubServer) mustEmbedUnimplementedHubServer() {}
// UnsafeHubServer may be embedded to opt out of forward compatibility for this service.
@ -66,6 +239,27 @@ func RegisterHubServer(s grpc.ServiceRegistrar, srv HubServer) {
s.RegisterService(&Hub_ServiceDesc, srv)
}
func _Hub_SubscribeHeaders_Handler(srv interface{}, stream grpc.ServerStream) error {
m := new(BlockRequest)
if err := stream.RecvMsg(m); err != nil {
return err
}
return srv.(HubServer).SubscribeHeaders(m, &hubSubscribeHeadersServer{stream})
}
type Hub_SubscribeHeadersServer interface {
Send(*BlockHeaderOutput) error
grpc.ServerStream
}
type hubSubscribeHeadersServer struct {
grpc.ServerStream
}
func (x *hubSubscribeHeadersServer) Send(m *BlockHeaderOutput) error {
return x.ServerStream.SendMsg(m)
}
func _Hub_Search_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(SearchRequest)
if err := dec(in); err != nil {
@ -84,6 +278,153 @@ func _Hub_Search_Handler(srv interface{}, ctx context.Context, dec func(interfac
return interceptor(ctx, in, info, handler)
}
func _Hub_GetBlock_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(BlockRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(HubServer).GetBlock(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pb.Hub/GetBlock",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(HubServer).GetBlock(ctx, req.(*BlockRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Hub_GetBlockHeader_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(BlockRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(HubServer).GetBlockHeader(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pb.Hub/GetBlockHeader",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(HubServer).GetBlockHeader(ctx, req.(*BlockRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Hub_GetServerHeight_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(EmptyMessage)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(HubServer).GetServerHeight(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pb.Hub/GetServerHeight",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(HubServer).GetServerHeight(ctx, req.(*EmptyMessage))
}
return interceptor(ctx, in, info, handler)
}
func _Hub_GetHeaders_Handler(srv interface{}, stream grpc.ServerStream) error {
m := new(BlockRequest)
if err := stream.RecvMsg(m); err != nil {
return err
}
return srv.(HubServer).GetHeaders(m, &hubGetHeadersServer{stream})
}
type Hub_GetHeadersServer interface {
Send(*BlockHeaderOutput) error
grpc.ServerStream
}
type hubGetHeadersServer struct {
grpc.ServerStream
}
func (x *hubGetHeadersServer) Send(m *BlockHeaderOutput) error {
return x.ServerStream.SendMsg(m)
}
func _Hub_Ping_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(EmptyMessage)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(HubServer).Ping(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pb.Hub/Ping",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(HubServer).Ping(ctx, req.(*EmptyMessage))
}
return interceptor(ctx, in, info, handler)
}
func _Hub_Version_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(EmptyMessage)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(HubServer).Version(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pb.Hub/Version",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(HubServer).Version(ctx, req.(*EmptyMessage))
}
return interceptor(ctx, in, info, handler)
}
func _Hub_Features_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(EmptyMessage)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(HubServer).Features(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pb.Hub/Features",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(HubServer).Features(ctx, req.(*EmptyMessage))
}
return interceptor(ctx, in, info, handler)
}
func _Hub_Broadcast_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(EmptyMessage)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(HubServer).Broadcast(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pb.Hub/Broadcast",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(HubServer).Broadcast(ctx, req.(*EmptyMessage))
}
return interceptor(ctx, in, info, handler)
}
// Hub_ServiceDesc is the grpc.ServiceDesc for Hub service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
@ -95,7 +436,46 @@ var Hub_ServiceDesc = grpc.ServiceDesc{
MethodName: "Search",
Handler: _Hub_Search_Handler,
},
{
MethodName: "GetBlock",
Handler: _Hub_GetBlock_Handler,
},
{
MethodName: "GetBlockHeader",
Handler: _Hub_GetBlockHeader_Handler,
},
{
MethodName: "GetServerHeight",
Handler: _Hub_GetServerHeight_Handler,
},
{
MethodName: "Ping",
Handler: _Hub_Ping_Handler,
},
{
MethodName: "Version",
Handler: _Hub_Version_Handler,
},
{
MethodName: "Features",
Handler: _Hub_Features_Handler,
},
{
MethodName: "Broadcast",
Handler: _Hub_Broadcast_Handler,
},
},
Streams: []grpc.StreamDesc{
{
StreamName: "SubscribeHeaders",
Handler: _Hub_SubscribeHeaders_Handler,
ServerStreams: true,
},
{
StreamName: "GetHeaders",
Handler: _Hub_GetHeaders_Handler,
ServerStreams: true,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "hub.proto",
}

View file

@ -556,6 +556,238 @@ func (x *Blocked) GetChannel() *Output {
return nil
}
type BlockOutput struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Hash string `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash"`
Confirmations int32 `protobuf:"varint,2,opt,name=confirmations,proto3" json:"confirmations"`
}
func (x *BlockOutput) Reset() {
*x = BlockOutput{}
if protoimpl.UnsafeEnabled {
mi := &file_result_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *BlockOutput) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*BlockOutput) ProtoMessage() {}
func (x *BlockOutput) ProtoReflect() protoreflect.Message {
mi := &file_result_proto_msgTypes[5]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use BlockOutput.ProtoReflect.Descriptor instead.
func (*BlockOutput) Descriptor() ([]byte, []int) {
return file_result_proto_rawDescGZIP(), []int{5}
}
func (x *BlockOutput) GetHash() string {
if x != nil {
return x.Hash
}
return ""
}
func (x *BlockOutput) GetConfirmations() int32 {
if x != nil {
return x.Confirmations
}
return 0
}
//
//{ (json object)
//"hash" : "hex", (string) the block hash (same as provided)
//"confirmations" : n, (numeric) The number of confirmations, or -1 if the block is not on the main chain
//"height" : n, (numeric) The block height or index
//"version" : n, (numeric) The block version
//"versionHex" : "hex", (string) The block version formatted in hexadecimal
//"merkleroot" : "hex", (string) The merkle root
//"time" : xxx, (numeric) The block time expressed in UNIX epoch time
//"mediantime" : xxx, (numeric) The median block time expressed in UNIX epoch time
//"nonce" : n, (numeric) The nonce
//"bits" : "hex", (string) The bits
//"difficulty" : n, (numeric) The difficulty
//"chainwork" : "hex", (string) Expected number of hashes required to produce the current chain
//"nTx" : n, (numeric) The number of transactions in the block
//"previousblockhash" : "hex", (string) The hash of the previous block
//"nextblockhash" : "hex" (string) The hash of the next block
//}
type BlockHeaderOutput struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Hash string `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash"`
Confirmations int64 `protobuf:"varint,2,opt,name=confirmations,proto3" json:"confirmations"`
Height int64 `protobuf:"varint,3,opt,name=height,proto3" json:"height"`
Version int64 `protobuf:"varint,4,opt,name=version,proto3" json:"version"`
VersionHex string `protobuf:"bytes,5,opt,name=versionHex,proto3" json:"versionHex"`
Merkleroot string `protobuf:"bytes,6,opt,name=merkleroot,proto3" json:"merkleroot"`
Time int64 `protobuf:"varint,7,opt,name=time,proto3" json:"time"`
Mediantime int64 `protobuf:"varint,8,opt,name=mediantime,proto3" json:"mediantime"`
Nonce int64 `protobuf:"varint,9,opt,name=nonce,proto3" json:"nonce"`
Bits string `protobuf:"bytes,10,opt,name=bits,proto3" json:"bits"`
Difficulty float64 `protobuf:"fixed64,11,opt,name=difficulty,proto3" json:"difficulty"`
Chainwork string `protobuf:"bytes,12,opt,name=chainwork,proto3" json:"chainwork"`
NTx int64 `protobuf:"varint,13,opt,name=nTx,proto3" json:"nTx"`
Previousblockhash string `protobuf:"bytes,14,opt,name=previousblockhash,proto3" json:"previousblockhash"`
Nextblockhash string `protobuf:"bytes,15,opt,name=nextblockhash,proto3" json:"nextblockhash"`
}
func (x *BlockHeaderOutput) Reset() {
*x = BlockHeaderOutput{}
if protoimpl.UnsafeEnabled {
mi := &file_result_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *BlockHeaderOutput) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*BlockHeaderOutput) ProtoMessage() {}
func (x *BlockHeaderOutput) ProtoReflect() protoreflect.Message {
mi := &file_result_proto_msgTypes[6]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use BlockHeaderOutput.ProtoReflect.Descriptor instead.
func (*BlockHeaderOutput) Descriptor() ([]byte, []int) {
return file_result_proto_rawDescGZIP(), []int{6}
}
func (x *BlockHeaderOutput) GetHash() string {
if x != nil {
return x.Hash
}
return ""
}
func (x *BlockHeaderOutput) GetConfirmations() int64 {
if x != nil {
return x.Confirmations
}
return 0
}
func (x *BlockHeaderOutput) GetHeight() int64 {
if x != nil {
return x.Height
}
return 0
}
func (x *BlockHeaderOutput) GetVersion() int64 {
if x != nil {
return x.Version
}
return 0
}
func (x *BlockHeaderOutput) GetVersionHex() string {
if x != nil {
return x.VersionHex
}
return ""
}
func (x *BlockHeaderOutput) GetMerkleroot() string {
if x != nil {
return x.Merkleroot
}
return ""
}
func (x *BlockHeaderOutput) GetTime() int64 {
if x != nil {
return x.Time
}
return 0
}
func (x *BlockHeaderOutput) GetMediantime() int64 {
if x != nil {
return x.Mediantime
}
return 0
}
func (x *BlockHeaderOutput) GetNonce() int64 {
if x != nil {
return x.Nonce
}
return 0
}
func (x *BlockHeaderOutput) GetBits() string {
if x != nil {
return x.Bits
}
return ""
}
func (x *BlockHeaderOutput) GetDifficulty() float64 {
if x != nil {
return x.Difficulty
}
return 0
}
func (x *BlockHeaderOutput) GetChainwork() string {
if x != nil {
return x.Chainwork
}
return ""
}
func (x *BlockHeaderOutput) GetNTx() int64 {
if x != nil {
return x.NTx
}
return 0
}
func (x *BlockHeaderOutput) GetPreviousblockhash() string {
if x != nil {
return x.Previousblockhash
}
return ""
}
func (x *BlockHeaderOutput) GetNextblockhash() string {
if x != nil {
return x.Nextblockhash
}
return ""
}
var File_result_proto protoreflect.FileDescriptor
var file_result_proto_rawDesc = []byte{
@ -640,10 +872,43 @@ var file_result_proto_rawDesc = []byte{
0x65, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28,
0x0d, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x24, 0x0a, 0x07, 0x63, 0x68, 0x61, 0x6e,
0x6e, 0x65, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x62, 0x2e, 0x4f,
0x75, 0x74, 0x70, 0x75, 0x74, 0x52, 0x07, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x42, 0x26,
0x5a, 0x24, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6c, 0x62, 0x72,
0x79, 0x69, 0x6f, 0x2f, 0x68, 0x75, 0x62, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,
0x2f, 0x67, 0x6f, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x75, 0x74, 0x70, 0x75, 0x74, 0x52, 0x07, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x22, 0x47,
0x0a, 0x0b, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x12, 0x12, 0x0a,
0x04, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x61, 0x73,
0x68, 0x12, 0x24, 0x0a, 0x0d, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f,
0x6e, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x72,
0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0xc1, 0x03, 0x0a, 0x11, 0x42, 0x6c, 0x6f, 0x63,
0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x12, 0x12, 0x0a,
0x04, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x61, 0x73,
0x68, 0x12, 0x24, 0x0a, 0x0d, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f,
0x6e, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x72,
0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68,
0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12,
0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03,
0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1e, 0x0a, 0x0a, 0x76, 0x65, 0x72,
0x73, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x78, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x76,
0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x78, 0x12, 0x1e, 0x0a, 0x0a, 0x6d, 0x65, 0x72,
0x6b, 0x6c, 0x65, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6d,
0x65, 0x72, 0x6b, 0x6c, 0x65, 0x72, 0x6f, 0x6f, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x69, 0x6d,
0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x1e, 0x0a,
0x0a, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28,
0x03, 0x52, 0x0a, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x14, 0x0a,
0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x6e, 0x6f,
0x6e, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x62, 0x69, 0x74, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28,
0x09, 0x52, 0x04, 0x62, 0x69, 0x74, 0x73, 0x12, 0x1e, 0x0a, 0x0a, 0x64, 0x69, 0x66, 0x66, 0x69,
0x63, 0x75, 0x6c, 0x74, 0x79, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0a, 0x64, 0x69, 0x66,
0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x68, 0x61, 0x69, 0x6e,
0x77, 0x6f, 0x72, 0x6b, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x68, 0x61, 0x69,
0x6e, 0x77, 0x6f, 0x72, 0x6b, 0x12, 0x10, 0x0a, 0x03, 0x6e, 0x54, 0x78, 0x18, 0x0d, 0x20, 0x01,
0x28, 0x03, 0x52, 0x03, 0x6e, 0x54, 0x78, 0x12, 0x2c, 0x0a, 0x11, 0x70, 0x72, 0x65, 0x76, 0x69,
0x6f, 0x75, 0x73, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x68, 0x61, 0x73, 0x68, 0x18, 0x0e, 0x20, 0x01,
0x28, 0x09, 0x52, 0x11, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x62, 0x6c, 0x6f, 0x63,
0x6b, 0x68, 0x61, 0x73, 0x68, 0x12, 0x24, 0x0a, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x62, 0x6c, 0x6f,
0x63, 0x6b, 0x68, 0x61, 0x73, 0x68, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65,
0x78, 0x74, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x68, 0x61, 0x73, 0x68, 0x42, 0x26, 0x5a, 0x24, 0x67,
0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6c, 0x62, 0x72, 0x79, 0x69, 0x6f,
0x2f, 0x68, 0x75, 0x62, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x67, 0x6f,
0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@ -659,14 +924,16 @@ func file_result_proto_rawDescGZIP() []byte {
}
var file_result_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_result_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
var file_result_proto_msgTypes = make([]protoimpl.MessageInfo, 7)
var file_result_proto_goTypes = []interface{}{
(Error_Code)(0), // 0: pb.Error.Code
(*Outputs)(nil), // 1: pb.Outputs
(*Output)(nil), // 2: pb.Output
(*ClaimMeta)(nil), // 3: pb.ClaimMeta
(*Error)(nil), // 4: pb.Error
(*Blocked)(nil), // 5: pb.Blocked
(Error_Code)(0), // 0: pb.Error.Code
(*Outputs)(nil), // 1: pb.Outputs
(*Output)(nil), // 2: pb.Output
(*ClaimMeta)(nil), // 3: pb.ClaimMeta
(*Error)(nil), // 4: pb.Error
(*Blocked)(nil), // 5: pb.Blocked
(*BlockOutput)(nil), // 6: pb.BlockOutput
(*BlockHeaderOutput)(nil), // 7: pb.BlockHeaderOutput
}
var file_result_proto_depIdxs = []int32{
2, // 0: pb.Outputs.txos:type_name -> pb.Output
@ -752,6 +1019,30 @@ func file_result_proto_init() {
return nil
}
}
file_result_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*BlockOutput); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_result_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*BlockHeaderOutput); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
file_result_proto_msgTypes[1].OneofWrappers = []interface{}{
(*Output_Claim)(nil),
@ -763,7 +1054,7 @@ func file_result_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_result_proto_rawDesc,
NumEnums: 1,
NumMessages: 5,
NumMessages: 7,
NumExtensions: 0,
NumServices: 0,
},

View file

@ -50,10 +50,17 @@ Install Go 1.14+
Download `protoc` from https://github.com/protocolbuffers/protobuf/releases and make sure it is
executable and in your path.
Install Go plugin for protoc:
Install Go plugin for protoc and python:
```
go get google.golang.org/protobuf/cmd/protoc-gen-go google.golang.org/grpc/cmd/protoc-gen-go-grpc
pip install grpcio grpcio-tools github3.py
```
Lastly the hub needs protobuf version 3.17.1, it may work with newer version but this is what it's built with, on ubuntu systems you'll have to install this from source see the GitHub actions in `.github/workflows` for an example of this.
```
https://github.com/protocolbuffers/protobuf/releases/download/v3.17.1/protobuf-all-3.17.1.tar.gz
```
If you can run `./protobuf/build.sh` without errors, you have `go` and `protoc` installed correctly.

345
scripts/version.py Normal file
View file

@ -0,0 +1,345 @@
import argparse
import io
import json
import os
import sys
import unittest
from datetime import date, datetime
from getpass import getpass
try:
import github3
except ImportError:
print('To run release tool you need to install github3.py:')
print('')
print(' $ pip install github3.py')
print('')
sys.exit(1)
AREA_RENAME = {
'api': 'API',
'dht': 'DHT'
}
def build_upload_binary(release: github3.repos.release.Release) -> None:
# os.chdir(absolute_path)
os.system("go build .")
with open("./hub", "rb") as f:
release.upload_asset("binary", "hub", f)
def get_github():
config_path = os.path.expanduser('~/.lbry-release-tool.json')
if os.path.exists(config_path):
with open(config_path, 'r') as config_file:
config = json.load(config_file)
return github3.github.GitHub(token=config['token'])
token = os.environ.get("GH_TOKEN")
if not token:
print('GitHub Credentials')
username = input('username: ')
password = getpass('password: ')
gh = github3.github.GitHub(username, password)
token = input('Enter 2FA: ')
with open(config_path, 'w') as config_file:
json.dump({'token': token}, config_file)
gh.login(token=token)
return gh
def get_labels(pr, prefix):
for label in pr.labels:
label_name = label['name']
if label_name.startswith(f'{prefix}: '):
yield label_name[len(f'{prefix}: '):]
def get_label(pr, prefix):
for label in get_labels(pr, prefix):
return label
BACKWARDS_INCOMPATIBLE = 'backwards-incompatible:'
RELEASE_TEXT = 'release-text:'
RELEASE_TEXT_LINES = 'release-text-lines:'
def get_backwards_incompatible(desc: str):
for line in desc.splitlines():
if line.startswith(BACKWARDS_INCOMPATIBLE):
yield line[len(BACKWARDS_INCOMPATIBLE):]
def get_release_text(desc: str):
in_release_lines = False
for line in desc.splitlines():
if in_release_lines:
yield line.rstrip()
elif line.startswith(RELEASE_TEXT_LINES):
in_release_lines = True
elif line.startswith(RELEASE_TEXT):
yield line[len(RELEASE_TEXT):].strip()
yield ''
class Version:
def __init__(self, major=0, date=datetime.now(), micro=0, alphabeta=""):
self.major = int(major)
self.date = date
self.micro = int(micro)
self.alphabeta = alphabeta
@classmethod
def from_string(cls, version_string):
(major, datemicroalphabeta) = version_string.split('.', 1)
parts = datemicroalphabeta.split("-")
if len(parts) > 1:
datemicro, alphabeta = parts[0], parts[1]
else:
datemicro, alphabeta = parts[0], ""
date, micro = datemicro.rsplit('.', 1) if datemicro.count('.') > 2 else (datemicro, "0")
return cls(major.replace("v", ""), datetime.strptime(date, "%Y.%m.%d"), int(micro), alphabeta)
@classmethod
def from_content(cls, content):
src = content.decoded.decode('utf-8')
return cls.from_string(src)
def increment(self, action):
cls = self.__class__
if action == 'major':
return cls(self.major + 1, datetime.now(), self.micro, self.alphabeta)
elif action == 'date':
return cls(self.major, datetime.now(), self.micro, self.alphabeta)
elif action == 'micro':
return cls(self.major, datetime.now(), self.micro + 1, self.alphabeta)
raise ValueError(f'unknown action: {action}')
@property
def tag(self):
return f'{self}'
def __str__(self):
arr = ['v', self.major, '.', self.date.strftime("%Y.%m.%d")]
if self.micro > 0:
arr += [".", self.micro]
if self.alphabeta != "":
arr += ["-", self.alphabeta]
return ''.join(str(p) for p in arr)
def get_draft_prerelease_vars(args) -> (bool, bool):
draft = True
prerelease = False
if args.confirm > 2:
draft = False
elif args.confirm == 2:
draft = False
prerelease = True
return draft, prerelease
def release(args):
gh = get_github()
repo = gh.repository('lbryio', 'hub')
try:
version_file = repo.file_contents('version.txt')
current_version = Version.from_content(version_file)
print(f'Current Version: {current_version}')
except:
current_version = Version()
version_file = repo.create_file("version.txt", message="add version file",
content=str(current_version).encode('utf-8'))
if args.confirm <= 0:
print("\nDRY RUN ONLY. RUN WITH --confirm TO DO A REAL RELEASE.\n")
if args.action == 'current':
new_version = current_version
else:
new_version = current_version.increment(args.action)
print(f' New Version: {new_version}')
tag = args.start_tag if args.start_tag else current_version.tag
try:
previous_release = repo.release_from_tag(tag)
except github3.exceptions.NotFoundError:
previous_release = list(repo.releases())[-1]
print(f' Changelog From: {previous_release.tag_name} ({previous_release.created_at})')
print()
incompats = []
release_texts = []
unlabeled = []
fixups = []
areas = {}
for pr in gh.search_issues(f"merged:>={previous_release._json_data['created_at']} repo:lbryio/hub"):
area_labels = list(get_labels(pr, 'area'))
type_label = get_label(pr, 'type')
if area_labels and type_label:
for area_name in area_labels:
for incompat in get_backwards_incompatible(pr.body or ""):
incompats.append(f' * [{area_name}] {incompat.strip()} ({pr.html_url})')
for release_text in get_release_text(pr.body or ""):
release_texts.append(release_text)
if type_label == 'fixup':
fixups.append(f' * {pr.title} ({pr.html_url}) by {pr.user["login"]}')
else:
area = areas.setdefault(area_name, [])
area.append(f' * [{type_label}] {pr.title} ({pr.html_url}) by {pr.user["login"]}')
else:
unlabeled.append(f' * {pr.title} ({pr.html_url}) by {pr.user["login"]}')
area_names = list(areas.keys())
area_names.sort()
body = io.StringIO()
w = lambda s: body.write(s + '\n')
w(f'## [{new_version}] - {date.today().isoformat()}')
if release_texts:
w('')
for release_text in release_texts:
w(release_text)
if incompats:
w('')
w(f'### Backwards Incompatible Changes')
for incompat in incompats:
w(incompat)
for area in area_names:
prs = areas[area]
area = AREA_RENAME.get(area.lower(), area.capitalize())
w('')
w(f'### {area}')
for pr in prs:
w(pr)
print(body.getvalue())
if unlabeled:
print('The following PRs were skipped and not included in changelog:')
for skipped in unlabeled:
print(skipped)
if fixups:
print('The following PRs were marked as fixups and not included in changelog:')
for skipped in fixups:
print(skipped)
draft, prerelease = get_draft_prerelease_vars(args)
if args.confirm > 0:
commit = version_file.update(
new_version.tag,
version_file.decoded.decode('utf-8').replace(str(current_version), str(new_version)).encode()
)['commit']
release = None
if args.action != "current":
repo.create_tag(
tag=new_version.tag,
message=new_version.tag,
sha=commit.sha,
obj_type='commit',
tagger=commit.committer
)
release = repo.create_release(
new_version.tag,
name=new_version.tag,
body=body.getvalue(),
draft=draft,
prerelease=prerelease
)
build_upload_binary(release)
elif args.action == "current":
try:
print(new_version.tag)
# if we have the tag and release already don't do anything
release = repo.release_from_tag(new_version.tag)
if release.prerelease:
build_upload_binary(release)
release.edit(prerelease=False)
else:
build_upload_binary(release)
return
except Exception as e:
print(e)
try:
# We need to do this to get draft and prerelease releases
release = repo.releases().next()
# Case me have a release and no tag
if release.name == new_version.tag:
release.edit(prerelease=prerelease, draft=draft)
build_upload_binary(release)
return
else:
raise Exception("asdf")
except:
repo.create_tag(
tag=new_version.tag,
message=new_version.tag,
sha=commit.sha,
obj_type='commit',
tagger=commit.committer
)
release = repo.create_release(
new_version.tag,
name=new_version.tag,
body=body.getvalue(),
draft=draft,
prerelease=prerelease
)
finally:
if release:
build_upload_binary(release)
class TestReleaseTool(unittest.TestCase):
def test_version_parsing(self):
self.assertTrue(str(Version.from_string('v1.2020.01.01-beta')), 'v1.2020.01.01-beta')
self.assertTrue(str(Version.from_string('v1.2020.01.01.10')), 'v1.2020.01.01-beta')
def test_version_increment(self):
v = Version.from_string('v1.2020.01.01-beta')
self.assertTrue(str(v.increment('major')), 'v2.2020.01.01.beta')
self.assertTrue(str(v.increment('date')), f'v1.{datetime.now().strftime("YYYY.MM.dd")}-beta')
def test():
runner = unittest.TextTestRunner(verbosity=2)
loader = unittest.TestLoader()
suite = loader.loadTestsFromTestCase(TestReleaseTool)
return 0 if runner.run(suite).wasSuccessful() else 1
def main():
parser = argparse.ArgumentParser()
parser.add_argument("--confirm", default=0, action="count",
help="without this flag, it will only print what it will do but will not actually do it")
parser.add_argument("--start-tag", help="custom starting tag for changelog generation")
parser.add_argument("action", choices=['test', 'current', 'major', 'date', 'micro'])
args = parser.parse_args()
if args.action == "test":
code = test()
else:
code = release(args)
print()
return code
if __name__ == "__main__":
sys.exit(main())

View file

@ -9,6 +9,7 @@ import (
"math"
"reflect"
"strings"
"time"
//"github.com/lbryio/hub/schema"
@ -25,30 +26,30 @@ import (
const DefaultSearchSize = 1000
type record struct {
Txid string `json:"tx_id"`
Nout uint32 `json:"tx_nout"`
Height uint32 `json:"height"`
ClaimId string `json:"claim_id"`
ChannelId string `json:"channel_id"`
RepostedClaimId string `json:"reposted_claim_id"`
CensorType uint32 `json:"censor_type"`
CensoringChannelHash string `json:"censoring_channel_hash"`
ShortUrl string `json:"short_url"`
CanonicalUrl string `json:"canonical_url"`
IsControlling bool `json:"is_controlling"`
TakeOverHeight uint32 `json:"last_take_over_height"`
CreationHeight uint32 `json:"creation_height"`
ActivationHeight uint32 `json:"activation_height"`
ExpirationHeight uint32 `json:"expiration_height"`
ClaimsInChannel uint32 `json:"claims_in_channel"`
Reposted uint32 `json:"reposted"`
EffectiveAmount uint64 `json:"effective_amount"`
SupportAmount uint64 `json:"support_amount"`
TrendingGroup uint32 `json:"trending_group"`
TrendingMixed float32 `json:"trending_mixed"`
TrendingLocal float32 `json:"trending_local"`
TrendingGlobal float32 `json:"trending_global"`
Name string `json:"name"`
Txid string `json:"tx_id"`
Nout uint32 `json:"tx_nout"`
Height uint32 `json:"height"`
ClaimId string `json:"claim_id"`
ChannelId string `json:"channel_id"`
RepostedClaimId string `json:"reposted_claim_id"`
CensorType uint32 `json:"censor_type"`
CensoringChannelId string `json:"censoring_channel_id"`
ShortUrl string `json:"short_url"`
CanonicalUrl string `json:"canonical_url"`
IsControlling bool `json:"is_controlling"`
TakeOverHeight uint32 `json:"last_take_over_height"`
CreationHeight uint32 `json:"creation_height"`
ActivationHeight uint32 `json:"activation_height"`
ExpirationHeight uint32 `json:"expiration_height"`
ClaimsInChannel uint32 `json:"claims_in_channel"`
RepostCount uint32 `json:"repost_count"`
EffectiveAmount uint64 `json:"effective_amount"`
SupportAmount uint64 `json:"support_amount"`
TrendingGroup uint32 `json:"trending_group"`
TrendingMixed float32 `json:"trending_mixed"`
TrendingLocal float32 `json:"trending_local"`
TrendingGlobal float32 `json:"trending_global"`
Name string `json:"name"`
}
type orderField struct {
@ -122,6 +123,16 @@ func AddInvertibleField(q *elastic.BoolQuery, field *pb.InvertibleField, name st
return q.Must(elastic.NewTermsQuery(name, searchVals...))
}
}
func (s *Server) recordErrorAndReturn(err error, typ string) (interface{}, error) {
// TODO record metric
log.Println(err)
return nil, err
}
func (s *Server) recordErrorAndDie(err error) {
// TODO record metric fatal_error_counter
log.Fatalln(err)
}
// Search /*
// Search logic is as follows:
@ -135,19 +146,27 @@ func AddInvertibleField(q *elastic.BoolQuery, field *pb.InvertibleField, name st
// 8) return streams referenced by repost and all channel referenced in extra_txos
//*/
func (s *Server) Search(ctx context.Context, in *pb.SearchRequest) (*pb.Outputs, error) {
var client *elastic.Client = nil
if s.EsClient == nil {
esUrl := s.Args.EsHost + ":" + s.Args.EsPort
tmpClient, err := elastic.NewClient(elastic.SetURL(esUrl), elastic.SetSniff(false))
if err != nil {
log.Println(err)
return nil, err
}
client = tmpClient
s.EsClient = client
} else {
client = s.EsClient
// TODO record metric search_counter
t0 := time.Now()
esUrl := s.Args.EsHost + ":" + s.Args.EsPort
tmpClient, err := elastic.NewClient(elastic.SetURL(esUrl), elastic.SetSniff(false))
if err != nil {
s.recordErrorAndReturn(err, "client_creation_error_counter")
return nil, err
}
var client = tmpClient
//if s.EsClient == nil {
// esUrl := s.Args.EsHost + ":" + s.Args.EsPort
// tmpClient, err := elastic.NewClient(elastic.SetURL(esUrl), elastic.SetSniff(false))
// if err != nil {
// s.recordErrorAndReturn(err, "client_creation_errors")
// return nil, err
// }
// client = tmpClient
// s.EsClient = client
//} else {
// client = s.EsClient
//}
var from = 0
var pageSize = 10
@ -162,7 +181,7 @@ func (s *Server) Search(ctx context.Context, in *pb.SearchRequest) (*pb.Outputs,
// If we're running in dev mode ignore the mainnet claims index
indices, err := client.IndexNames()
if err != nil {
log.Fatalln(err)
s.recordErrorAndDie(err)
}
var numIndices = len(indices)
searchIndices = make([]string, 0, numIndices)
@ -185,14 +204,13 @@ func (s *Server) Search(ctx context.Context, in *pb.SearchRequest) (*pb.Outputs,
Query(q). // specify the query
From(0).Size(DefaultSearchSize)
for _, x := range orderBy {
search = search.Sort(x.Field, x.IsAsc)
}
searchResult, err := search.Do(ctx) // execute
if err != nil {
log.Println(err)
s.recordErrorAndReturn(err, "search_errors")
return nil, err
}
@ -200,6 +218,12 @@ func (s *Server) Search(ctx context.Context, in *pb.SearchRequest) (*pb.Outputs,
txos, extraTxos, blocked := s.postProcessResults(ctx, client, searchResult, in, pageSize, from, searchIndices)
t1 := time.Now()
delta := t1.Unix() - t0.Unix()
log.Printf("delta: %d\n", delta)
// TODO record metric query_time
if in.NoTotals != nil && !in.NoTotals.Value {
return &pb.Outputs{
Txos: txos,
@ -290,9 +314,9 @@ func (s *Server) postProcessResults(
//printJsonFullRecords(blockedRecords)
//Get claims for reposts
repostClaims, repostRecords, repostedMap := getClaimsForReposts(ctx, client, records, searchIndices)
repostClaims, repostRecords, repostedMap := s.getClaimsForReposts(ctx, client, records, searchIndices)
//get all unique channels
channels, channelMap := getUniqueChannels(append(append(records, repostRecords...), blockedRecords...), client, ctx, searchIndices)
channels, channelMap := s.getUniqueChannels(append(append(records, repostRecords...), blockedRecords...), client, ctx, searchIndices)
//add these to extra txos
extraTxos := append(repostClaims, channels...)
@ -342,9 +366,10 @@ func (s *Server) setupEsQuery(
}
replacements := map[string]string {
"name": "normalized",
"name": "normalized_name",
"txid": "tx_id",
"claim_hash": "_id",
//"claim_hash": "_id",
"reposted": "repost_count",
}
textFields := map[string]bool {
@ -355,9 +380,10 @@ func (s *Server) setupEsQuery(
"description": true,
"claim_id": true,
"media_type": true,
"normalized": true,
"normalized_name": true,
"public_key_bytes": true,
"public_key_hash": true,
"public_key_id": true,
"short_url": true,
"signature": true,
"signature_digest": true,
@ -392,7 +418,7 @@ func (s *Server) setupEsQuery(
for i := 0; i < len(in.Name); i++ {
normalized[i] = util.NormalizeName(in.Name[i])
}
in.Normalized = normalized
in.NormalizedName = normalized
}
if len(in.OrderBy) > 0 {
@ -466,18 +492,18 @@ func (s *Server) setupEsQuery(
if in.PublicKeyId != "" {
value := hex.EncodeToString(base58.Decode(in.PublicKeyId)[1:21])
q = q.Must(elastic.NewTermQuery("public_key_hash.keyword", value))
q = q.Must(elastic.NewTermQuery("public_key_id.keyword", value))
}
if in.HasChannelSignature != nil && in.HasChannelSignature.Value {
q = q.Must(elastic.NewExistsQuery("signature_digest"))
if in.SignatureValid != nil {
q = q.Must(elastic.NewTermQuery("signature_valid", in.SignatureValid.Value))
if in.IsSignatureValid != nil {
q = q.Must(elastic.NewTermQuery("is_signature_valid", in.IsSignatureValid.Value))
}
} else if in.SignatureValid != nil {
} else if in.IsSignatureValid != nil {
q = q.MinimumNumberShouldMatch(1)
q = q.Should(elastic.NewBoolQuery().MustNot(elastic.NewExistsQuery("signature_digest")))
q = q.Should(elastic.NewTermQuery("signature_valid", in.SignatureValid.Value))
q = q.Should(elastic.NewTermQuery("is_signature_valid", in.IsSignatureValid.Value))
}
if in.HasSource != nil {
@ -492,14 +518,13 @@ func (s *Server) setupEsQuery(
q = q.Must(elastic.NewTermQuery("tx_nout", in.TxNout.Value))
}
q = AddTermsField(q, in.PublicKeyHash, "public_key_hash.keyword")
q = AddTermsField(q, in.Author, "author.keyword")
q = AddTermsField(q, in.Title, "title.keyword")
q = AddTermsField(q, in.CanonicalUrl, "canonical_url.keyword")
q = AddTermsField(q, in.ClaimName, "claim_name.keyword")
q = AddTermsField(q, in.Description, "description.keyword")
q = AddTermsField(q, in.MediaType, "media_type.keyword")
q = AddTermsField(q, in.Normalized, "normalized.keyword")
q = AddTermsField(q, in.NormalizedName, "normalized_name.keyword")
q = AddTermsField(q, in.PublicKeyBytes, "public_key_bytes.keyword")
q = AddTermsField(q, in.ShortUrl, "short_url.keyword")
q = AddTermsField(q, in.Signature, "signature.keyword")
@ -528,7 +553,7 @@ func (s *Server) setupEsQuery(
q = AddRangeField(q, in.ActivationHeight, "activation_height")
q = AddRangeField(q, in.ExpirationHeight, "expiration_height")
q = AddRangeField(q, in.ReleaseTime, "release_time")
q = AddRangeField(q, in.Reposted, "reposted")
q = AddRangeField(q, in.RepostCount, "repost_count")
q = AddRangeField(q, in.FeeAmount, "fee_amount")
q = AddRangeField(q, in.Duration, "duration")
q = AddRangeField(q, in.CensorType, "censor_type")
@ -555,7 +580,7 @@ func (s *Server) setupEsQuery(
return q
}
func getUniqueChannels(records []*record, client *elastic.Client, ctx context.Context, searchIndices []string) ([]*pb.Output, map[string]*pb.Output) {
func (s *Server) getUniqueChannels(records []*record, client *elastic.Client, ctx context.Context, searchIndices []string) ([]*pb.Output, map[string]*pb.Output) {
channels := make(map[string]*pb.Output)
channelsSet := make(map[string]bool)
var mget = client.Mget()
@ -568,32 +593,34 @@ func getUniqueChannels(records []*record, client *elastic.Client, ctx context.Co
mget = mget.Add(nmget)
totalChannels++
}
if r.CensorType != 0 && !channelsSet[r.CensoringChannelHash] {
channelsSet[r.CensoringChannelHash] = true
nmget := elastic.NewMultiGetItem().Id(r.CensoringChannelHash).Index(searchIndex)
if r.CensorType != 0 && !channelsSet[r.CensoringChannelId] {
channelsSet[r.CensoringChannelId] = true
nmget := elastic.NewMultiGetItem().Id(r.CensoringChannelId).Index(searchIndex)
mget = mget.Add(nmget)
totalChannels++
}
}
}
if totalChannels == 0 {
s.recordErrorAndReturn(nil, "zero_channels_counter")
return []*pb.Output{}, make(map[string]*pb.Output)
}
res, err := mget.Do(ctx)
if err != nil {
log.Println(err)
s.recordErrorAndReturn(err, "get_unique_channels_errors")
return []*pb.Output{}, make(map[string]*pb.Output)
}
channelTxos := make([]*pb.Output, totalChannels)
//repostedRecords := make([]*record, totalReposted)
log.Println("total channel", totalChannels)
//log.Println("total channel", totalChannels)
for i, doc := range res.Docs {
var r record
err := json.Unmarshal(doc.Source, &r)
if err != nil {
s.recordErrorAndReturn(err, "json_errors")
return []*pb.Output{}, make(map[string]*pb.Output)
}
channelTxos[i] = r.recordToOutput()
@ -605,7 +632,7 @@ func getUniqueChannels(records []*record, client *elastic.Client, ctx context.Co
return channelTxos, channels
}
func getClaimsForReposts(ctx context.Context, client *elastic.Client, records []*record, searchIndices []string) ([]*pb.Output, []*record, map[string]*pb.Output) {
func (s * Server) getClaimsForReposts(ctx context.Context, client *elastic.Client, records []*record, searchIndices []string) ([]*pb.Output, []*record, map[string]*pb.Output) {
var totalReposted = 0
var mget = client.Mget()//.StoredFields("_id")
@ -627,12 +654,13 @@ func getClaimsForReposts(ctx context.Context, client *elastic.Client, records []
}
//mget = mget.Add(nmget)
if totalReposted == 0 {
// TODO record metric no_reposted_counter
return []*pb.Output{}, []*record{}, make(map[string]*pb.Output)
}
res, err := mget.Do(ctx)
if err != nil {
log.Println(err)
s.recordErrorAndReturn(err, "mget_error_counter")
return []*pb.Output{}, []*record{}, make(map[string]*pb.Output)
}
@ -640,11 +668,12 @@ func getClaimsForReposts(ctx context.Context, client *elastic.Client, records []
repostedRecords := make([]*record, totalReposted)
respostedMap := make(map[string]*pb.Output)
log.Println("reposted records", totalReposted)
//log.Println("reposted records", totalReposted)
for i, doc := range res.Docs {
var r record
err := json.Unmarshal(doc.Source, &r)
if err != nil {
s.recordErrorAndReturn(err, "json_error_counter")
return []*pb.Output{}, []*record{}, make(map[string]*pb.Output)
}
claims[i] = r.recordToOutput()
@ -723,7 +752,7 @@ func (r *record) recordToOutput() *pb.Output {
ActivationHeight: r.ActivationHeight,
ExpirationHeight: r.ExpirationHeight,
ClaimsInChannel: r.ClaimsInChannel,
Reposted: r.Reposted,
Reposted: r.RepostCount,
EffectiveAmount: r.EffectiveAmount,
SupportAmount: r.SupportAmount,
TrendingGroup: r.TrendingGroup,
@ -785,15 +814,15 @@ func removeBlocked(searchHits []*record) ([]*record, []*record, map[string]*pb.B
blockedChannels := make(map[string]*pb.Blocked)
for _, r := range searchHits {
if r.CensorType != 0 {
if blockedChannels[r.CensoringChannelHash] == nil {
if blockedChannels[r.CensoringChannelId] == nil {
blockedObj := &pb.Blocked{
Count: 1,
Channel: nil,
}
blockedChannels[r.CensoringChannelHash] = blockedObj
blockedChannels[r.CensoringChannelId] = blockedObj
blockedHits = append(blockedHits, r)
} else {
blockedChannels[r.CensoringChannelHash].Count += 1
blockedChannels[r.CensoringChannelId].Count += 1
}
} else {
newHits = append(newHits, r)

View file

@ -1,12 +1,17 @@
package server
import (
"log"
"regexp"
"context"
"fmt"
pb "github.com/lbryio/hub/protobuf/go"
"github.com/olivere/elastic/v7"
"github.com/prometheus/client_golang/prometheus/promhttp"
"google.golang.org/grpc"
"google.golang.org/protobuf/types/known/wrapperspb"
"log"
"net/http"
"regexp"
"time"
)
type Server struct {
@ -15,11 +20,27 @@ type Server struct {
MultiSpaceRe *regexp.Regexp
WeirdCharsRe *regexp.Regexp
EsClient *elastic.Client
Servers []*FederatedServer
pb.UnimplementedHubServer
}
type FederatedServer struct {
Address string
Port string
Ts time.Time
Ping int //?
}
const majorVersion = 0
const (
ServeCmd = iota
SearchCmd = iota
)
type Args struct {
Serve bool
// TODO Make command types an enum
CmdType int
Host string
Port string
EsHost string
@ -27,6 +48,15 @@ type Args struct {
Dev bool
}
func getVersion(alphaBeta string) string {
strPortion := time.Now().Format("2006.01.02")
majorVersionDate := fmt.Sprintf("v%d.%s", majorVersion, strPortion)
if len(alphaBeta) > 0 {
return fmt.Sprintf("%s-%s", majorVersionDate, alphaBeta)
}
return majorVersionDate
}
/*
'blockchain.block.get_chunk'
'blockchain.block.get_header'
@ -67,7 +97,7 @@ type Args struct {
*/
func MakeHubServer(args *Args) *Server {
grpcServer := grpc.NewServer()
grpcServer := grpc.NewServer(grpc.NumStreamWorkers(10))
multiSpaceRe, err := regexp.Compile("\\s{2,}")
if err != nil {
@ -78,13 +108,46 @@ func MakeHubServer(args *Args) *Server {
if err != nil {
log.Fatal(err)
}
self := &FederatedServer{
Address: "127.0.0.1",
Port: args.Port,
Ts: time.Now(),
Ping: 0,
}
servers := make([]*FederatedServer, 10)
servers = append(servers, self)
s := &Server {
GrpcServer: grpcServer,
Args: args,
MultiSpaceRe: multiSpaceRe,
WeirdCharsRe: weirdCharsRe,
Servers: servers,
}
return s
}
}
func (s *Server) PromethusEndpoint(port string, endpoint string) error {
http.Handle("/" + endpoint, promhttp.Handler())
log.Println(fmt.Sprintf("listening on :%s /%s", port, endpoint))
err := http.ListenAndServe(":" + port, nil)
if err != nil {
return err
}
log.Fatalln("Shouldn't happen??!?!")
return nil
}
func (s *Server) Hello(context context.Context, args *FederatedServer) (*FederatedServer, error) {
s.Servers = append(s.Servers, args)
return s.Servers[0], nil
}
func (s *Server) Ping(context context.Context, args *pb.EmptyMessage) (*wrapperspb.StringValue, error) {
return &wrapperspb.StringValue{Value: "Hello, world!"}, nil
}
func (s *Server) Version(context context.Context, args *pb.EmptyMessage) (*wrapperspb.StringValue, error) {
return &wrapperspb.StringValue{Value: getVersion("beta")}, nil
}