diff --git a/config/cfg.go b/config/cfg.go index adf1bb59b..fd0cdc7ca 100644 --- a/config/cfg.go +++ b/config/cfg.go @@ -23,6 +23,7 @@ var ( HtlcMaxFee = 0.01 TrackerHost = "127.0.0.1:60060" + TrackerHostGrpc = "127.0.0.1:60061" ChainNodeType = "regtest" //P2P @@ -91,4 +92,5 @@ func Init() { return } TrackerHost = tracker.Key("host").MustString("localhost:60060") + TrackerHostGrpc = tracker.Key("grpc").MustString("localhost:60061") } diff --git a/config/conf.ini b/config/conf.ini index 81bd6237b..20f2b9a29 100644 --- a/config/conf.ini +++ b/config/conf.ini @@ -32,4 +32,6 @@ port = 4001 ;https://omnilaboratory.github.io/obd/#/nodes-in-testnet ; host = 62.234.216.108:60060 -;host = 127.0.0.1:60060 \ No newline at end of file +grpc = 62.234.216.108:60061 +;host = 127.0.0.1:60060 +;grpc = 127.0.0.1:60061 \ No newline at end of file diff --git a/go.mod b/go.mod index 70f028bda..11a636bbd 100644 --- a/go.mod +++ b/go.mod @@ -15,8 +15,9 @@ require ( github.com/fastly/go-utils v0.0.0-20180712184237-d95a45783239 // indirect github.com/gin-gonic/gin v1.6.3 github.com/go-ini/ini v1.56.0 - github.com/golang/protobuf v1.4.0 + github.com/golang/protobuf v1.5.2 github.com/gorilla/websocket v1.4.2 + github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.3 github.com/happierall/l v0.0.0-20190729144513-5eb32176fb02 github.com/jehiah/go-strftime v0.0.0-20171201141054-1d33003b3869 // indirect github.com/jonboulle/clockwork v0.1.0 // indirect @@ -33,6 +34,7 @@ require ( github.com/satori/go.uuid v1.2.0 github.com/shopspring/decimal v1.2.0 github.com/smartystreets/goconvey v1.6.4 // indirect + github.com/stretchr/testify v1.7.0 github.com/tebeka/strftime v0.1.4 // indirect github.com/tidwall/gjson v1.6.0 github.com/tyler-smith/go-bip32 v0.0.0-20170922074101-2c9cfd177564 @@ -42,10 +44,11 @@ require ( github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect go.etcd.io/bbolt v1.3.4 // indirect golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 - golang.org/x/sys v0.0.0-20201024232916-9f70ab9862d5 // indirect golang.org/x/tools v0.0.0-20201023174141-c8cfbd0f21e6 // indirect - google.golang.org/grpc v1.31.1 + google.golang.org/grpc v1.43.0 + google.golang.org/protobuf v1.27.1 gopkg.in/ini.v1 v1.56.0 // indirect - gopkg.in/yaml.v2 v2.3.0 // indirect + gorm.io/driver/sqlite v1.2.6 + gorm.io/gorm v1.22.4 launchpad.net/gocheck v0.0.0-20140225173054-000000000087 // indirect ) diff --git a/go.sum b/go.sum index dafe9aacc..50e71f0b0 100644 --- a/go.sum +++ b/go.sum @@ -1,4 +1,36 @@ 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= +cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= +cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= +cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= +cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= +cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= +cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= +cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= +cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= +cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= +cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= +cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= +cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= +cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= +cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= +cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= +cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= +cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= +cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= +cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= +cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= +cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= +cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= +cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= +cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= +cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= +cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= +cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= +cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= +cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/AndreasBriese/bbloom v0.0.0-20180913140656-343706a395b7/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= github.com/Azure/azure-pipeline-go v0.2.1/go.mod h1:UGSo8XybXnIGZ3epmeBw7Jdz+HiUVpqIlpz/HKHylF4= @@ -16,6 +48,7 @@ github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6L github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk= github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/DataDog/zstd v1.4.5 h1:EndNeuB0l9syBZhut0wns3gV1hL8zX8LIu6ZiVHWLIQ= github.com/DataDog/zstd v1.4.5/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo= github.com/FactomProject/basen v0.0.0-20150613233007-fe3947df716e h1:ahyvB3q25YnZWly5Gq1ekg6jcmWaGj/vG/MhF4aisoc= @@ -32,6 +65,7 @@ github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBA github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= +github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/aristanetworks/goarista v0.0.0-20170210015632-ea17b1a17847/go.mod h1:D/tb0zPVXnP7fmsLZjtdUhSsumbK/ij54UXjjVgMGxQ= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/asdine/storm v2.1.2+incompatible h1:dczuIkyqwY2LrtXPz8ixMrU/OFgZp71kbKTHGrXYt/Q= @@ -61,11 +95,20 @@ github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA github.com/cespare/cp v0.1.0/go.mod h1:SOGHArjBr4JWaSDEVpWpo/hNg6RoKrls6Oh40hiwW+s= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cloudflare/cloudflare-go v0.10.2-0.20190916151808-a80f83b9add9/go.mod h1:1MxXX1Ux4x6mqPmjkUgTP1CdXIBXKX7T+Jk9Gxrmx+U= github.com/cmars/basen v0.0.0-20150613233007-fe3947df716e h1:0XBUw73chJ1VYSsfvcPvVT7auykAJce9FpRr10L6Qhw= github.com/cmars/basen v0.0.0-20150613233007-fe3947df716e/go.mod h1:P13beTBKr5Q18lJe1rIoLUqjM+CB1zYrRg44ZqGuQSA= 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= +github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= +github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= @@ -98,7 +141,11 @@ github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25Kn github.com/edsrzf/mmap-go v0.0.0-20160512033002-935e0e8a636c/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= github.com/elastic/gosigar v0.8.1-0.20180330100440-37f05ff46ffa/go.mod h1:cdorVVzy1fhmEqmtgqkoE3bYtCfSCkVyjTyCIo22xvs= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= +github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/ethereum/go-ethereum v1.9.14 h1:/rGoPYujLeajAHyDs8aZKYcLrurLdUJP9AzHk73QNr0= github.com/ethereum/go-ethereum v1.9.14/go.mod h1:oP8FC5+TbICUyftkTWs+8JryntjIJLJvWvApK3z2AYw= @@ -111,11 +158,15 @@ github.com/flynn/noise v0.0.0-20180327030543-2492fe189ae6/go.mod h1:1i71OnUq3iUe github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= github.com/gin-gonic/gin v1.6.3 h1:ahKqKTFpO5KTPHxWZjEdPScmYaGtLo8Y4DMHoEsnp14= github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M= github.com/go-check/check v0.0.0-20180628173108-788fd7840127/go.mod h1:9ES+weclKsC9YodN5RgxqK/VD9HM9JsCSh7rNhMZE98= +github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-ini/ini v1.56.0 h1:6HjxSjqdmgnujDPhlzR4a44lxK3w03WPN8te0SoUSeM= github.com/go-ini/ini v1.56.0/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= @@ -137,42 +188,72 @@ github.com/gogo/protobuf v1.3.0/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXP github.com/gogo/protobuf v1.3.1 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls= github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6 h1:ZgQEtGgCBiWRM39fZuwSd1LwSqqSW0hOdXCYYDX0R3I= +github.com/golang/glog v1.0.0 h1:nfP3RFugxnNRyKgeWd4oI1nYvXpxrx8ck8ZrcizshdQ= +github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e h1:1r7pUrabqp18hOBcwBwiTsbnFeTZHV9eER/QT5JVZxY= +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/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= +github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.0/go.mod h1:Qd/q+1AKNOZr9uGQzbzCmRO6sUih6GTPZv6a1/R87v0= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2-0.20190517061210-b285ee9cfc6c/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.3 h1:gyjaxf+svBWX08ZjK86iN9geUJF0H6gp2IRKX6Nf6/I= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= 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= github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= -github.com/golang/protobuf v1.4.0 h1:oOuy+ugB+P/kBdUnG5QaMXSIyJ1q38wWSojYCb3z5VQ= github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.3.1 h1:Xye71clBPdm5HgqGwUkwhbynsUJZhDbS20FvLhQ2izg= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.4.1/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.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o= +github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/gopacket v1.1.17 h1:rMrlX2ZY2UbvT+sdz3+6J+pp2z+msCq9MxTU6ymxbBY= github.com/google/gopacket v1.1.17/go.mod h1:UdDNZ1OO62aGYVnPhxT1U6aI7ukYtA/kB8vaU0diBUM= github.com/google/gopacket v1.1.18 h1:lum7VRA9kdlvBi7/v2p7/zcbkduHaCH/SVVyurs7OpY= github.com/google/gopacket v1.1.18/go.mod h1:UdDNZ1OO62aGYVnPhxT1U6aI7ukYtA/kB8vaU0diBUM= +github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= +github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/websocket v1.4.1-0.20190629185528-ae1634f6a989/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= @@ -180,6 +261,10 @@ github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/ad github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/graph-gophers/graphql-go v0.0.0-20191115155744-f33e81362277/go.mod h1:9CQHMSxwO4MprSdzoIEobiHpoLtHm77vfxsvsIN5Vuc= +github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= +github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.3 h1:I8MsauTJQXZ8df8qJvEln0kYNc3bSapuaSsEsnFdEFU= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.3/go.mod h1:lZdb/YAJUSj9OqrCHs2ihjtoO3+xK3G53wTYXFWRGDo= github.com/gxed/hashland/keccakpg v0.0.1/go.mod h1:kRzw3HkwxFU1mpmPP8v1WyQzwdGfmKFJ6tItnhQ67kU= github.com/gxed/hashland/murmur3 v0.0.1/go.mod h1:KjXop02n4/ckmZSnY2+HKcLud/tcmvhST0bie/0lS48= github.com/happierall/l v0.0.0-20190729144513-5eb32176fb02 h1:o9ChMZOaq4VHCdGhZPHlyFQN4gCQCamy0Geg9I5uTQ0= @@ -193,19 +278,17 @@ github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc= github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/huin/goupnp v1.0.0 h1:wg75sLpL6DZqwHQN6E1Cfk6mtfzS45z8OV+ic+DtHRo= github.com/huin/goupnp v1.0.0/go.mod h1:n9v9KO1tAxYH82qOn+UTIFQDmx5n1Zxd/ClZDMX7Bnc= github.com/huin/goutil v0.0.0-20170803182201-1ca381bf3150/go.mod h1:PpLOETDnJ0o3iZrZfqZzyLl6l7F3c6L1oWn7OICBi6o= -github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= +github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/influxdata/influxdb v1.2.3-0.20180221223340-01288bdb0883/go.mod h1:qZna6X/4elxqT3yI9iZYdZrWWdeFOOprn86kgg4+IzY= github.com/ipfs/go-cid v0.0.1/go.mod h1:GHWU/WuQdMPmIosc4Yn1bcCT7dSeX4lBafM7iqUPQvM= github.com/ipfs/go-cid v0.0.2/go.mod h1:GHWU/WuQdMPmIosc4Yn1bcCT7dSeX4lBafM7iqUPQvM= github.com/ipfs/go-cid v0.0.3/go.mod h1:GHWU/WuQdMPmIosc4Yn1bcCT7dSeX4lBafM7iqUPQvM= github.com/ipfs/go-cid v0.0.4/go.mod h1:4LLaPOQwmk5z9LBgQnpkivrx8BJjUyGwTXCd5Xfj6+M= -github.com/ipfs/go-cid v0.0.5 h1:o0Ix8e/ql7Zb5UVUJEUfjsWCIY8t48++9lR8qi6oiJU= github.com/ipfs/go-cid v0.0.5/go.mod h1:plgt+Y5MnOey4vO4UlUazGqdbEXuFYitED67FexhXog= github.com/ipfs/go-cid v0.0.6/go.mod h1:6Ux9z5e+HpkQdckYoX1PG/6xqKspzlEIR5SDmgqgC/I= github.com/ipfs/go-cid v0.0.7 h1:ysQJVJA3fNDF1qigJbsSQOdjhVLsOEoPdh0+R97k3jY= @@ -230,7 +313,6 @@ github.com/ipfs/go-ds-leveldb v0.1.0/go.mod h1:hqAW8y4bwX5LWcCtku2rFNX3vjDZCy5LZ github.com/ipfs/go-ds-leveldb v0.4.1/go.mod h1:jpbku/YqBSsBc1qgME8BkWS4AxzF2cEu1Ii2r79Hh9s= github.com/ipfs/go-ds-leveldb v0.4.2/go.mod h1:jpbku/YqBSsBc1qgME8BkWS4AxzF2cEu1Ii2r79Hh9s= github.com/ipfs/go-ipfs-delay v0.0.0-20181109222059-70721b86a9a8/go.mod h1:8SP1YXK1M1kXuc4KJZINY3TQQ03J2rwBG9QfXmbRPrw= -github.com/ipfs/go-ipfs-util v0.0.1 h1:Wz9bL2wB2YBJqggkA4dD7oSmqB4cAnpNbGrlHJulv50= github.com/ipfs/go-ipfs-util v0.0.1/go.mod h1:spsl5z8KUnrve+73pOhSVZND1SIxPW5RyBCNzQxlJBc= github.com/ipfs/go-ipfs-util v0.0.2 h1:59Sswnk1MFaiq+VcaknX7aYEyGyGDAA73ilhEK2POp8= github.com/ipfs/go-ipfs-util v0.0.2/go.mod h1:CbPtkWJzjLdEcezDns2XYaehFVNXG9zrdrtMecczcsQ= @@ -243,7 +325,6 @@ github.com/ipfs/go-log v1.0.4 h1:6nLQdX4W8P9yZZFH7mO+X/PzjN8Laozm/lMJ6esdgzY= github.com/ipfs/go-log v1.0.4/go.mod h1:oDCg2FkjogeFOhqqb+N39l2RpTNPL6F/StPkB3kPgcs= github.com/ipfs/go-log/v2 v2.0.2/go.mod h1:O7P1lJt27vWHhOwQmcFEvlmo49ry2VY2+JfBWFaa9+0= github.com/ipfs/go-log/v2 v2.0.3/go.mod h1:O7P1lJt27vWHhOwQmcFEvlmo49ry2VY2+JfBWFaa9+0= -github.com/ipfs/go-log/v2 v2.0.5 h1:fL4YI+1g5V/b1Yxr1qAiXTMg1H8z9vx/VmJxBuQMHvU= github.com/ipfs/go-log/v2 v2.0.5/go.mod h1:eZs4Xt4ZUJQFM3DlanGhy7TkwwawCZcSByscwkWG+dw= github.com/ipfs/go-log/v2 v2.1.1 h1:G4TtqN+V9y9HY9TA6BwbCVyyBZ2B9MbCjR2MtGx8FR0= github.com/ipfs/go-log/v2 v2.1.1/go.mod h1:2v2nsGfZsvvAJz13SyFzf9ObaqwHiHxsPLEHntrv9KM= @@ -266,12 +347,19 @@ github.com/jehiah/go-strftime v0.0.0-20171201141054-1d33003b3869 h1:IPJ3dvxmJ4uc github.com/jehiah/go-strftime v0.0.0-20171201141054-1d33003b3869/go.mod h1:cJ6Cj7dQo+O6GJNiMx+Pa94qKj+TG8ONdKHgMNIyyag= github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= +github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= +github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= +github.com/jinzhu/now v1.1.2/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= +github.com/jinzhu/now v1.1.3 h1:PlHq1bSCSZL9K0wUhbm2pGLoTWs2GwVhsP6emvGV/ZI= +github.com/jinzhu/now v1.1.3/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jonboulle/clockwork v0.1.0 h1:VKV+ZcuP6l3yW9doeqz6ziZGgcynBVQO+obU0+0hcPo= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ= github.com/json-iterator/go v1.1.9 h1:9yzud/Ht36ygwatGx56VwCZtlI/2AD15T1X2sjSuGns= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.1.1-0.20170430222011-975b5c4c7c21/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= @@ -311,7 +399,6 @@ github.com/libp2p/go-cidranger v1.1.0/go.mod h1:KWZTfSr+r9qEo9OkI9/SIEeAtw+NNoU0 github.com/libp2p/go-conn-security-multistream v0.1.0/go.mod h1:aw6eD7LOsHEX7+2hJkDxw1MteijaVcI+/eP2/x3J1xc= github.com/libp2p/go-conn-security-multistream v0.2.0 h1:uNiDjS58vrvJTg9jO6bySd1rMKejieG7v45ekqHbZ1M= github.com/libp2p/go-conn-security-multistream v0.2.0/go.mod h1:hZN4MjlNetKD3Rq5Jb/P5ohUnFLNzEAR4DLSzpn2QLU= -github.com/libp2p/go-eventbus v0.1.0 h1:mlawomSAjjkk97QnYiEmHsLu7E136+2oCWSHRUvMfzQ= github.com/libp2p/go-eventbus v0.1.0/go.mod h1:vROgu5cs5T7cv7POWlWxBaVLxfSegC5UGQf8A2eEmx4= github.com/libp2p/go-eventbus v0.2.1 h1:VanAdErQnpTioN2TowqNcOijf6YwhuODe4pPKSDpxGc= github.com/libp2p/go-eventbus v0.2.1/go.mod h1:jc2S4SoEVPP48H9Wpzm5aiGwUCBMfGhVhhBjyhhCJs8= @@ -334,7 +421,6 @@ github.com/libp2p/go-libp2p-autonat v0.2.2/go.mod h1:HsM62HkqZmHR2k1xgX34WuWDzk/ github.com/libp2p/go-libp2p-autonat v0.4.0 h1:3y8XQbpr+ssX8QfZUHekjHCYK64sj6/4hnf/awD4+Ug= github.com/libp2p/go-libp2p-autonat v0.4.0/go.mod h1:YxaJlpr81FhdOv3W3BTconZPfhaYivRdf53g+S2wobk= github.com/libp2p/go-libp2p-blankhost v0.1.1/go.mod h1:pf2fvdLJPsC1FsVrNP3DUUvMzUts2dsLLBEpo1vW1ro= -github.com/libp2p/go-libp2p-blankhost v0.1.4 h1:I96SWjR4rK9irDHcHq3XHN6hawCRTPUADzkJacgZLvk= github.com/libp2p/go-libp2p-blankhost v0.1.4/go.mod h1:oJF0saYsAXQCSfDq254GMNmLNz6ZTHTOvtF4ZydUvwU= github.com/libp2p/go-libp2p-blankhost v0.2.0 h1:3EsGAi0CBGcZ33GwRuXEYJLLPoVWyXJ1bcJzAJjINkk= github.com/libp2p/go-libp2p-blankhost v0.2.0/go.mod h1:eduNKXGTioTuQAUcZ5epXi9vMl+t4d8ugUBRQ4SqaNQ= @@ -356,14 +442,12 @@ github.com/libp2p/go-libp2p-core v0.5.1/go.mod h1:uN7L2D4EvPCvzSH5SrhR72UWbnSGpt github.com/libp2p/go-libp2p-core v0.5.3/go.mod h1:uN7L2D4EvPCvzSH5SrhR72UWbnSGpt5/a35Sm4upn4Y= github.com/libp2p/go-libp2p-core v0.5.4/go.mod h1:uN7L2D4EvPCvzSH5SrhR72UWbnSGpt5/a35Sm4upn4Y= github.com/libp2p/go-libp2p-core v0.5.5/go.mod h1:vj3awlOr9+GMZJFH9s4mpt9RHHgGqeHCopzbYKZdRjM= -github.com/libp2p/go-libp2p-core v0.5.6 h1:IxFH4PmtLlLdPf4fF/i129SnK/C+/v8WEX644MxhC48= github.com/libp2p/go-libp2p-core v0.5.6/go.mod h1:txwbVEhHEXikXn9gfC7/UDDw7rkxuX0bJvM49Ykaswo= github.com/libp2p/go-libp2p-core v0.5.7/go.mod h1:txwbVEhHEXikXn9gfC7/UDDw7rkxuX0bJvM49Ykaswo= github.com/libp2p/go-libp2p-core v0.6.0/go.mod h1:txwbVEhHEXikXn9gfC7/UDDw7rkxuX0bJvM49Ykaswo= github.com/libp2p/go-libp2p-core v0.6.1/go.mod h1:FfewUH/YpvWbEB+ZY9AQRQ4TAD8sJBt/G1rVvhz5XT8= github.com/libp2p/go-libp2p-core v0.7.0 h1:4a0TMjrWNTZlNvcqxZmrMRDi/NQWrhwO2pkTuLSQ/IQ= github.com/libp2p/go-libp2p-core v0.7.0/go.mod h1:FfewUH/YpvWbEB+ZY9AQRQ4TAD8sJBt/G1rVvhz5XT8= -github.com/libp2p/go-libp2p-crypto v0.1.0 h1:k9MFy+o2zGDNGsaoZl0MA3iZ75qXxr9OOoAZF+sD5OQ= github.com/libp2p/go-libp2p-crypto v0.1.0/go.mod h1:sPUokVISZiy+nNuTTH/TY+leRSxnFj/2GLjtOTW90hI= github.com/libp2p/go-libp2p-discovery v0.2.0/go.mod h1:s4VGaxYMbw4+4+tsoQTqh7wfxg97AEdo4GYBt6BadWg= github.com/libp2p/go-libp2p-discovery v0.3.0/go.mod h1:o03drFnz9BVAZdzC/QUQ+NeQOu38Fu7LJGEOK2gQltw= @@ -378,7 +462,6 @@ github.com/libp2p/go-libp2p-loggables v0.1.0/go.mod h1:EyumB2Y6PrYjr55Q3/tiJ/o3x github.com/libp2p/go-libp2p-mplex v0.2.0/go.mod h1:Ejl9IyjvXJ0T9iqUTE1jpYATQ9NM3g+OtR+EMMODbKo= github.com/libp2p/go-libp2p-mplex v0.2.1/go.mod h1:SC99Rxs8Vuzrf/6WhmH41kNn13TiYdAWNYHrwImKLnE= github.com/libp2p/go-libp2p-mplex v0.2.2/go.mod h1:74S9eum0tVQdAfFiKxAyKzNdSuLqw5oadDq7+L/FELo= -github.com/libp2p/go-libp2p-mplex v0.2.3 h1:2zijwaJvpdesST2MXpI5w9wWFRgYtMcpRX7rrw0jmOo= github.com/libp2p/go-libp2p-mplex v0.2.3/go.mod h1:CK3p2+9qH9x+7ER/gWWDYJ3QW5ZxWDkm+dVvjfuG3ek= github.com/libp2p/go-libp2p-mplex v0.3.0 h1:CZyqqKP0BSGQyPLvpRQougbfXaaaJZdGgzhCpJNuNSk= github.com/libp2p/go-libp2p-mplex v0.3.0/go.mod h1:l9QWxRbbb5/hQMECEb908GbS9Sm2UAR2KFZKUJEynEs= @@ -389,7 +472,6 @@ github.com/libp2p/go-libp2p-netutil v0.1.0 h1:zscYDNVEcGxyUpMd0JReUZTrpMfia8PmLK github.com/libp2p/go-libp2p-netutil v0.1.0/go.mod h1:3Qv/aDqtMLTUyQeundkKsA+YCThNdbQD54k3TqjpbFU= github.com/libp2p/go-libp2p-noise v0.1.1 h1:vqYQWvnIcHpIoWJKC7Al4D6Hgj0H012TuXRhPwSMGpQ= github.com/libp2p/go-libp2p-noise v0.1.1/go.mod h1:QDFLdKX7nluB7DEnlVPbz7xlLHdwHFA9HiohJRr3vwM= -github.com/libp2p/go-libp2p-peer v0.2.0 h1:EQ8kMjaCUwt/Y5uLgjT8iY2qg0mGUT0N1zUjer50DsY= github.com/libp2p/go-libp2p-peer v0.2.0/go.mod h1:RCffaCvUyW2CJmG2gAWVqwePwW7JMgxjsHm7+J5kjWY= github.com/libp2p/go-libp2p-peerstore v0.1.0/go.mod h1:2CeHkQsr8svp4fZ+Oi9ykN1HBb6u0MOvdJ7YIsmcwtY= github.com/libp2p/go-libp2p-peerstore v0.1.3/go.mod h1:BJ9sHlm59/80oSkpWgr1MyY1ciXAXV397W6h1GH/uKI= @@ -408,7 +490,6 @@ github.com/libp2p/go-libp2p-routing-helpers v0.2.3/go.mod h1:795bh+9YeoFl99rMASo github.com/libp2p/go-libp2p-secio v0.1.0/go.mod h1:tMJo2w7h3+wN4pgU2LSYeiKPrfqBgkOsdiKK77hE7c8= github.com/libp2p/go-libp2p-secio v0.2.0/go.mod h1:2JdZepB8J5V9mBp79BmwsaPQhRPNN2NrnB2lKQcdy6g= github.com/libp2p/go-libp2p-secio v0.2.1/go.mod h1:cWtZpILJqkqrSkiYcDBh5lA3wbT2Q+hz3rJQq3iftD8= -github.com/libp2p/go-libp2p-secio v0.2.2 h1:rLLPvShPQAcY6eNurKNZq3eZjPWfU9kXF2eI9jIYdrg= github.com/libp2p/go-libp2p-secio v0.2.2/go.mod h1:wP3bS+m5AUnFA+OFO7Er03uO1mncHG0uVwGrwvjYlNY= github.com/libp2p/go-libp2p-swarm v0.1.0/go.mod h1:wQVsCdjsuZoc730CgOvh5ox6K8evllckjebkdiY5ta4= github.com/libp2p/go-libp2p-swarm v0.2.2/go.mod h1:fvmtQ0T1nErXym1/aa1uJEyN7JzaTNyBcHImCxRpPKU= @@ -421,7 +502,6 @@ github.com/libp2p/go-libp2p-testing v0.0.2/go.mod h1:gvchhf3FQOtBdr+eFUABet5a4MB github.com/libp2p/go-libp2p-testing v0.0.3/go.mod h1:gvchhf3FQOtBdr+eFUABet5a4MBLK8jM3V4Zghvmi+E= github.com/libp2p/go-libp2p-testing v0.0.4/go.mod h1:gvchhf3FQOtBdr+eFUABet5a4MBLK8jM3V4Zghvmi+E= github.com/libp2p/go-libp2p-testing v0.1.0/go.mod h1:xaZWMJrPUM5GlDBxCeGUi7kI4eqnjVyavGroI2nxEM0= -github.com/libp2p/go-libp2p-testing v0.1.1 h1:U03z3HnGI7Ni8Xx6ONVZvUFOAzWYmolWf5W5jAOPNmU= github.com/libp2p/go-libp2p-testing v0.1.1/go.mod h1:xaZWMJrPUM5GlDBxCeGUi7kI4eqnjVyavGroI2nxEM0= github.com/libp2p/go-libp2p-testing v0.1.2-0.20200422005655-8775583591d8/go.mod h1:Qy8sAncLKpwXtS2dSnDOP8ktexIAHKu+J+pnZOFZLTc= github.com/libp2p/go-libp2p-testing v0.3.0 h1:ZiBYstPamsi7y6NJZebRudUzsYmVkt998hltyLqf8+g= @@ -435,7 +515,6 @@ github.com/libp2p/go-libp2p-transport-upgrader v0.3.0/go.mod h1:i+SKzbRnvXdVbU3D github.com/libp2p/go-libp2p-yamux v0.2.0/go.mod h1:Db2gU+XfLpm6E4rG5uGCFX6uXA8MEXOxFcRoXUODaK8= github.com/libp2p/go-libp2p-yamux v0.2.2/go.mod h1:lIohaR0pT6mOt0AZ0L2dFze9hds9Req3OfS+B+dv4qw= github.com/libp2p/go-libp2p-yamux v0.2.5/go.mod h1:Zpgj6arbyQrmZ3wxSZxfBmbdnWtbZ48OpsfmQVTErwA= -github.com/libp2p/go-libp2p-yamux v0.2.7 h1:vzKu0NVtxvEIDGCv6mjKRcK0gipSgaXmJZ6jFv0d/dk= github.com/libp2p/go-libp2p-yamux v0.2.7/go.mod h1:X28ENrBMU/nm4I3Nx4sZ4dgjZ6VhLEn0XhIoZ5viCwU= github.com/libp2p/go-libp2p-yamux v0.2.8/go.mod h1:/t6tDqeuZf0INZMTgd0WxIRbtK2EzI2h7HbFm9eAKI4= github.com/libp2p/go-libp2p-yamux v0.4.0 h1:qunEZzWwwmfSBYTtSyd81PlD1TjB5uuWcGYHWVXLbUg= @@ -446,35 +525,29 @@ github.com/libp2p/go-maddr-filter v0.1.0/go.mod h1:VzZhTXkMucEGGEOSKddrwGiOv0tUh github.com/libp2p/go-mplex v0.0.3/go.mod h1:pK5yMLmOoBR1pNCqDlA2GQrdAVTMkqFalaTWe7l4Yd0= github.com/libp2p/go-mplex v0.1.0/go.mod h1:SXgmdki2kwCUlCCbfGLEgHjC4pFqhTp0ZoV6aiKgxDU= github.com/libp2p/go-mplex v0.1.1/go.mod h1:Xgz2RDCi3co0LeZfgjm4OgUF15+sVR8SRcu3SFXI1lk= -github.com/libp2p/go-mplex v0.1.2 h1:qOg1s+WdGLlpkrczDqmhYzyk3vCfsQ8+RxRTQjOZWwI= github.com/libp2p/go-mplex v0.1.2/go.mod h1:Xgz2RDCi3co0LeZfgjm4OgUF15+sVR8SRcu3SFXI1lk= github.com/libp2p/go-mplex v0.2.0 h1:Ov/D+8oBlbRkjBs1R1Iua8hJ8cUfbdiW8EOdZuxcgaI= github.com/libp2p/go-mplex v0.2.0/go.mod h1:0Oy/A9PQlwBytDRp4wSkFnzHYDKcpLot35JQ6msjvYQ= github.com/libp2p/go-msgio v0.0.2/go.mod h1:63lBBgOTDKQL6EWazRMCwXsEeEeK9O2Cd+0+6OOuipQ= -github.com/libp2p/go-msgio v0.0.4 h1:agEFehY3zWJFUHK6SEMR7UYmk2z6kC3oeCM7ybLhguA= github.com/libp2p/go-msgio v0.0.4/go.mod h1:63lBBgOTDKQL6EWazRMCwXsEeEeK9O2Cd+0+6OOuipQ= github.com/libp2p/go-msgio v0.0.6 h1:lQ7Uc0kS1wb1EfRxO2Eir/RJoHkHn7t6o+EiwsYIKJA= github.com/libp2p/go-msgio v0.0.6/go.mod h1:4ecVB6d9f4BDSL5fqvPiC4A3KivjWn+Venn/1ALLMWA= github.com/libp2p/go-nat v0.0.4/go.mod h1:Nmw50VAvKuk38jUBcmNh6p9lUJLoODbJRvYAa/+KSDo= github.com/libp2p/go-nat v0.0.5 h1:qxnwkco8RLKqVh1NmjQ+tJ8p8khNLFxuElYG/TwqW4Q= github.com/libp2p/go-nat v0.0.5/go.mod h1:B7NxsVNPZmRLvMOwiEO1scOSyjA56zxYAGv1yQgRkEU= -github.com/libp2p/go-netroute v0.1.2 h1:UHhB35chwgvcRI392znJA3RCBtZ3MpE3ahNCN5MR4Xg= github.com/libp2p/go-netroute v0.1.2/go.mod h1:jZLDV+1PE8y5XxBySEBgbuVAXbhtuHSdmLPL2n9MKbk= github.com/libp2p/go-netroute v0.1.3 h1:1ngWRx61us/EpaKkdqkMjKk/ufr/JlIFYQAxV2XX8Ig= github.com/libp2p/go-netroute v0.1.3/go.mod h1:jZLDV+1PE8y5XxBySEBgbuVAXbhtuHSdmLPL2n9MKbk= github.com/libp2p/go-openssl v0.0.2/go.mod h1:v8Zw2ijCSWBQi8Pq5GAixw6DbFfa9u6VIYDXnvOXkc0= github.com/libp2p/go-openssl v0.0.3/go.mod h1:unDrJpgy3oFr+rqXsarWifmJuNnJR4chtO1HmaZjggc= github.com/libp2p/go-openssl v0.0.4/go.mod h1:unDrJpgy3oFr+rqXsarWifmJuNnJR4chtO1HmaZjggc= -github.com/libp2p/go-openssl v0.0.5 h1:pQkejVhF0xp08D4CQUcw8t+BFJeXowja6RVcb5p++EA= github.com/libp2p/go-openssl v0.0.5/go.mod h1:unDrJpgy3oFr+rqXsarWifmJuNnJR4chtO1HmaZjggc= github.com/libp2p/go-openssl v0.0.7 h1:eCAzdLejcNVBzP/iZM9vqHnQm+XyCEbSSIheIPRGNsw= github.com/libp2p/go-openssl v0.0.7/go.mod h1:unDrJpgy3oFr+rqXsarWifmJuNnJR4chtO1HmaZjggc= -github.com/libp2p/go-reuseport v0.0.1 h1:7PhkfH73VXfPJYKQ6JwS5I/eVcoyYi9IMNGc6FWpFLw= github.com/libp2p/go-reuseport v0.0.1/go.mod h1:jn6RmB1ufnQwl0Q1f+YxAj8isJgDCQzaaxIFYDhcYEA= github.com/libp2p/go-reuseport v0.0.2 h1:XSG94b1FJfGA01BUrT82imejHQyTxO4jEWqheyCXYvU= github.com/libp2p/go-reuseport v0.0.2/go.mod h1:SPD+5RwGC7rcnzngoYC86GjPzjSywuQyMVAheVBD9nQ= github.com/libp2p/go-reuseport-transport v0.0.2/go.mod h1:YkbSDrvjUVDL6b8XqriyA20obEtsW9BLkuOUyQAOCbs= -github.com/libp2p/go-reuseport-transport v0.0.3 h1:zzOeXnTooCkRvoH+bSXEfXhn76+LAiwoneM0gnXjF2M= github.com/libp2p/go-reuseport-transport v0.0.3/go.mod h1:Spv+MPft1exxARzP2Sruj2Wb5JSyHNncjf1Oi2dEbzM= github.com/libp2p/go-reuseport-transport v0.0.4 h1:OZGz0RB620QDGpv300n1zaOcKGGAoGVf8h9txtt/1uM= github.com/libp2p/go-reuseport-transport v0.0.4/go.mod h1:trPa7r/7TJK/d+0hdBLOCGvpQQVOU74OXbNCIMkufGw= @@ -486,7 +559,6 @@ github.com/libp2p/go-stream-muxer-multistream v0.3.0 h1:TqnSHPJEIqDEO7h1wZZ0p3DX github.com/libp2p/go-stream-muxer-multistream v0.3.0/go.mod h1:yDh8abSIzmZtqtOt64gFJUXEryejzNb0lisTt+fAMJA= github.com/libp2p/go-tcp-transport v0.1.0/go.mod h1:oJ8I5VXryj493DEJ7OsBieu8fcg2nHGctwtInJVpipc= github.com/libp2p/go-tcp-transport v0.1.1/go.mod h1:3HzGvLbx6etZjnFlERyakbaYPdfjg2pWP97dFZworkY= -github.com/libp2p/go-tcp-transport v0.2.0 h1:YoThc549fzmNJIh7XjHVtMIFaEDRtIrtWciG5LyYAPo= github.com/libp2p/go-tcp-transport v0.2.0/go.mod h1:vX2U0CnWimU4h0SGSEsg++AzvBcroCGYw28kh94oLe0= github.com/libp2p/go-tcp-transport v0.2.1 h1:ExZiVQV+h+qL16fzCWtd1HSzPsqWottJ8KXwWaVi8Ns= github.com/libp2p/go-tcp-transport v0.2.1/go.mod h1:zskiJ70MEfWz2MKxvFB/Pv+tPIB1PpPUrHIWQ8aFw7M= @@ -497,7 +569,6 @@ github.com/libp2p/go-ws-transport v0.3.1/go.mod h1:bpgTJmRZAvVHrgHybCVyqoBmyLQ1f github.com/libp2p/go-yamux v1.2.2/go.mod h1:FGTiPvoV/3DVdgWpX+tM0OW3tsM+W5bSE3gZwqQTcow= github.com/libp2p/go-yamux v1.3.0/go.mod h1:FGTiPvoV/3DVdgWpX+tM0OW3tsM+W5bSE3gZwqQTcow= github.com/libp2p/go-yamux v1.3.3/go.mod h1:FGTiPvoV/3DVdgWpX+tM0OW3tsM+W5bSE3gZwqQTcow= -github.com/libp2p/go-yamux v1.3.5 h1:ibuz4naPAully0pN6J/kmUARiqLpnDQIzI/8GCOrljg= github.com/libp2p/go-yamux v1.3.5/go.mod h1:FGTiPvoV/3DVdgWpX+tM0OW3tsM+W5bSE3gZwqQTcow= github.com/libp2p/go-yamux v1.3.7/go.mod h1:fr7aVgmdNGJK+N1g+b6DW6VxzbRCjCOejR/hkmpooHE= github.com/libp2p/go-yamux v1.4.0 h1:7nqe0T95T2CWh40IdJ/tp8RMor4ubc9/wYZpB2a/Hx0= @@ -506,7 +577,6 @@ github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czP github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.0/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-colorable v0.1.1 h1:G1f5SKeVxmagw/IyvzvtZE4Gybcc4Tr1tf7I8z0XgOg= github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= github.com/mattn/go-ieproxy v0.0.0-20190610004146-91bb50d98149/go.mod h1:31jz6HNzdxOmlERGGEc4v/dMssOfmp2p5bT/okiKFFc= github.com/mattn/go-ieproxy v0.0.0-20190702010315-6dee0af9227d/go.mod h1:31jz6HNzdxOmlERGGEc4v/dMssOfmp2p5bT/okiKFFc= @@ -516,8 +586,9 @@ github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hd github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-runewidth v0.0.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mattn/go-runewidth v0.0.4 h1:2BvfKmzob6Bmd4YsL0zygOqfdFnK7GR4QL06Do4/p7Y= github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= +github.com/mattn/go-sqlite3 v1.14.9 h1:10HX2Td0ocZpYEjhilsuo6WWtUqttj2Kb0KtD86/KYA= +github.com/mattn/go-sqlite3 v1.14.9/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE= github.com/miekg/dns v1.1.12/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= @@ -541,7 +612,6 @@ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lN github.com/mr-tron/base58 v1.1.0/go.mod h1:xcD2VGqlgYjBdcBLw+TuYLr8afG+Hj8g2eTVqeSzSU8= github.com/mr-tron/base58 v1.1.1/go.mod h1:xcD2VGqlgYjBdcBLw+TuYLr8afG+Hj8g2eTVqeSzSU8= github.com/mr-tron/base58 v1.1.2/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= -github.com/mr-tron/base58 v1.1.3 h1:v+sk57XuaCKGXpWtVBX8YJzO7hMGx4Aajh4TQbdEFdc= github.com/mr-tron/base58 v1.1.3/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= github.com/mr-tron/base58 v1.2.0 h1:T/HDJBh4ZCPbU39/+c3rRvE0uKBQlU27+QI8LJ4t64o= github.com/mr-tron/base58 v1.2.0/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= @@ -556,7 +626,6 @@ github.com/multiformats/go-multiaddr v0.1.0/go.mod h1:xKVEak1K9cS1VdmPZW3LSIb6lg github.com/multiformats/go-multiaddr v0.1.1/go.mod h1:aMKBKNEYmzmDmxfX88/vz+J5IU55txyt0p4aiWVohjo= github.com/multiformats/go-multiaddr v0.2.0/go.mod h1:0nO36NvPpyV4QzvTLi/lafl2y95ncPj0vFwVF6k6wJ4= github.com/multiformats/go-multiaddr v0.2.1/go.mod h1:s/Apk6IyxfvMjDafnhJgJ3/46z7tZ04iMk5wP4QMGGE= -github.com/multiformats/go-multiaddr v0.2.2 h1:XZLDTszBIJe6m0zF6ITBrEcZR73OPUhCBBS9rYAuUzI= github.com/multiformats/go-multiaddr v0.2.2/go.mod h1:NtfXiOtHvghW9KojvtySjH5y0u0xW5UouOmQQrn6a3Y= github.com/multiformats/go-multiaddr v0.3.0/go.mod h1:dF9kph9wfJ+3VLAaeBqo9Of8x4fJxp6ggJGteB8HQTI= github.com/multiformats/go-multiaddr v0.3.1 h1:1bxa+W7j9wZKTZREySx1vPMs2TqrYWjVZ7zE6/XLG1I= @@ -574,11 +643,9 @@ github.com/multiformats/go-multiaddr-net v0.1.1/go.mod h1:5JNbcfBOP4dnhoZOv10JJV github.com/multiformats/go-multiaddr-net v0.1.2/go.mod h1:QsWt3XK/3hwvNxZJp92iMQKME1qHfpYmyIjFVsSOY6Y= github.com/multiformats/go-multiaddr-net v0.1.3/go.mod h1:ilNnaM9HbmVFqsb/qcNysjCu4PVONlrBZpHIrw/qQuA= github.com/multiformats/go-multiaddr-net v0.1.4/go.mod h1:ilNnaM9HbmVFqsb/qcNysjCu4PVONlrBZpHIrw/qQuA= -github.com/multiformats/go-multiaddr-net v0.1.5 h1:QoRKvu0xHN1FCFJcMQLbG/yQE2z441L5urvG3+qyz7g= github.com/multiformats/go-multiaddr-net v0.1.5/go.mod h1:ilNnaM9HbmVFqsb/qcNysjCu4PVONlrBZpHIrw/qQuA= github.com/multiformats/go-multiaddr-net v0.2.0 h1:MSXRGN0mFymt6B1yo/6BPnIRpLPEnKgQNvVfCX5VDJk= github.com/multiformats/go-multiaddr-net v0.2.0/go.mod h1:gGdH3UXny6U3cKKYCvpXI5rnK7YaOIEOPVDI9tsJbEA= -github.com/multiformats/go-multibase v0.0.1 h1:PN9/v21eLywrFWdFNsFKaU04kLJzuYzmrJR+ubhT9qA= github.com/multiformats/go-multibase v0.0.1/go.mod h1:bja2MqRZ3ggyXtZSEDKpl0uO/gviWFaSteVbWT51qgs= github.com/multiformats/go-multibase v0.0.3 h1:l/B6bJDQjvQ5G52jw4QGSYeOTZoAwIO77RblWplfIqk= github.com/multiformats/go-multibase v0.0.3/go.mod h1:5+1R4eQrT3PkYZ24C3W2Ue2tPwIdYQD509ZjSb5y9Oc= @@ -587,18 +654,15 @@ github.com/multiformats/go-multihash v0.0.5/go.mod h1:lt/HCbqlQwlPBz7lv0sQCdtfcM github.com/multiformats/go-multihash v0.0.8/go.mod h1:YSLudS+Pi8NHE7o6tb3D8vrpKa63epEDmG8nTduyAew= github.com/multiformats/go-multihash v0.0.9/go.mod h1:YSLudS+Pi8NHE7o6tb3D8vrpKa63epEDmG8nTduyAew= github.com/multiformats/go-multihash v0.0.10/go.mod h1:YSLudS+Pi8NHE7o6tb3D8vrpKa63epEDmG8nTduyAew= -github.com/multiformats/go-multihash v0.0.13 h1:06x+mk/zj1FoMsgNejLpy6QTvJqlSt/BhLEy87zidlc= github.com/multiformats/go-multihash v0.0.13/go.mod h1:VdAWLKTwram9oKAatUcLxBNUjdtcVwxObEQBtRfuyjc= github.com/multiformats/go-multihash v0.0.14 h1:QoBceQYQQtNUuf6s7wHxnE2c8bhbMqhfGzNI032se/I= github.com/multiformats/go-multihash v0.0.14/go.mod h1:VdAWLKTwram9oKAatUcLxBNUjdtcVwxObEQBtRfuyjc= github.com/multiformats/go-multistream v0.1.0/go.mod h1:fJTiDfXJVmItycydCnNx4+wSzZ5NwG2FEVAI30fiovg= -github.com/multiformats/go-multistream v0.1.1 h1:JlAdpIFhBhGRLxe9W6Om0w++Gd6KMWoFPZL/dEnm9nI= github.com/multiformats/go-multistream v0.1.1/go.mod h1:KmHZ40hzVxiaiwlj3MEbYgK9JFk2/9UktWZAF54Du38= github.com/multiformats/go-multistream v0.2.0 h1:6AuNmQVKUkRnddw2YiDjt5Elit40SFxMJkVnhmETXtU= github.com/multiformats/go-multistream v0.2.0/go.mod h1:5GZPQZbkWOLOn3J2y4Y99vVW7vOfsAflxARk3x14o6k= github.com/multiformats/go-varint v0.0.1/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE= github.com/multiformats/go-varint v0.0.2/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE= -github.com/multiformats/go-varint v0.0.5 h1:XVZwSo04Cs3j/jS0uAEPpT3JY6DzMcVLLoWOSnCxOjg= github.com/multiformats/go-varint v0.0.5/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE= github.com/multiformats/go-varint v0.0.6 h1:gk85QWKxh3TazbLxED/NlDVv8+q+ReFJk7Y2W/KhfNY= github.com/multiformats/go-varint v0.0.6/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE= @@ -612,7 +676,6 @@ github.com/olekukonko/tablewriter v0.0.2-0.20190409134802-7e037d187b0c/go.mod h1 github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.12.0 h1:Iw5WCbBcaAAd0fpRb1c9r5YCylv4XDoCSigm1zLevwU= github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0HfGg= github.com/onsi/ginkgo v1.12.1 h1:mFwc4LvZ0xpSvDZ3E+k8Yte0hLOMxXUlP+yXtJqkYfQ= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= @@ -622,13 +685,11 @@ github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7J github.com/onsi/gomega v1.9.0 h1:R1uwffexN6Pr340GtYRIdZmAiN4J+iw6WG4wog1DUXg= github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= -github.com/opentracing/opentracing-go v1.1.0 h1:pWlfV3Bxv7k65HYwkikxat0+s3pV4bsqf19k25Ur8rU= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs= github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= github.com/pborman/uuid v0.0.0-20170112150404-1b00554d8222/go.mod h1:VyrYX9gd7irzKovcSS6BIIEwPRkP2Wm2m9ufcdFSJ34= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/peterh/liner v1.1.1-0.20190123174540-a2c9a5303de7 h1:oYW+YCJ1pachXTQmzR3rNLYGGz4g/UgFcjb28p/viDM= github.com/peterh/liner v1.1.1-0.20190123174540-a2c9a5303de7/go.mod h1:CRroGNssyjTd/qIG2FyxByd2S8JEAZXBl4qUrZf8GS0= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -643,6 +704,7 @@ github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7q github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/tsdb v0.6.2-0.20190402121629-4f204dcbc150/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/rjeczalik/notify v0.9.1/go.mod h1:rKwnCoCGeuQnwBtTSPL9Dad03Vh2n40ePRrjvIXnJho= +github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rs/cors v0.0.0-20160617231935-a62a804a8a00/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/rs/xhandler v0.0.0-20160618193221-ed27b6fd6521/go.mod h1:RvLn4FgxWubrpZHtQLnOf6EwhN2hEMusxZOhcW9H3UQ= @@ -670,10 +732,8 @@ github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0b github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cobra v0.0.5 h1:f0B+LkLX6DtmRH1isoNA9VTtNUK9K8xYd28JNNfOv/s= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= -github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= github.com/src-d/envconfig v1.0.0/go.mod h1:Q9YQZ7BKITldTBnoxsE5gOeB5y66RyPXeue/R4aaNBc= @@ -684,12 +744,11 @@ 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 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= -github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= 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/syndtr/goleveldb v1.0.0/go.mod h1:ZVVdQEZoIme9iO1Ch2Jdy24qqXrMMOU6lpPAyBWyWuQ= github.com/syndtr/goleveldb v1.0.1-0.20190923125748-758128399b1d/go.mod h1:9OrXJhf154huy1nPWmuSrkgjPUtUNhA+Zmy+6AESzuA= github.com/tebeka/strftime v0.1.4 h1:e0FKSyxthD1Xk4cIixFPoyfD33u2SbjNngOaaC3ePoU= @@ -729,16 +788,20 @@ github.com/whyrusleeping/multiaddr-filter v0.0.0-20160516205228-e903e4adabd7/go. github.com/wsddn/go-ecdh v0.0.0-20161211032359-48726bab9208/go.mod h1:IotVbo4F+mw0EzQ08zFqg7pK3FebNXpaMsRy2RT+Ees= github.com/x-cray/logrus-prefixed-formatter v0.5.2/go.mod h1:2duySbKsL6M18s5GU7VPsoEPHyzalCE06qoARUCeBBE= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= +github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= go.etcd.io/bbolt v1.3.4 h1:hi1bXHMVrlQh6WwxAy+qZCV/SYIlqo+Ushwdpa4tAKg= go.etcd.io/bbolt v1.3.4/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= +go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.1/go.mod h1:Ap50jQcDJrx6rB6VgeeFPtuPIf3wMRvRfrfYDO6+BmA= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.3 h1:8sGtKOrtQqkN1bp2AtX+misvLIlOmsEsNd+9NIcPEm8= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4 h1:LYy1Hy3MJdrCdMwwzxA/dRok4ejH+RwNGbuoD9fCjto= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.6.0 h1:Ezj3JGmsOnG1MoRWQkPBsKLe9DwWD9QeXzTRzzldNVk= go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= @@ -750,7 +813,6 @@ go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKY go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee h1:0mgffUl7nfd+FpvXMVz4IDEaUSmT1ysygQC7qYo7sG4= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= -go.uber.org/zap v1.14.1 h1:nYDKopTbvAPq/NrUVZwT15y2lpROBiLLyoRTbXOYWOo= go.uber.org/zap v1.14.1/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc= go.uber.org/zap v1.15.0/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc= go.uber.org/zap v1.16.0 h1:uFRZXykJGK9lLY4HtgSw44DnIcAM+kRBP7x5m+NpAOM= @@ -764,10 +826,10 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190513172903-22d7a77e9e5f/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190618222545-ea8f1a30c443/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20200115085410-6d4e4cb37c7d h1:2+ZP7EfsZV7Vvmx3TIqSlSzATMkTAKqM14YGFPoSKjI= golang.org/x/crypto v0.0.0-20200115085410-6d4e4cb37c7d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200311171314-f7b00557c8c4/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= @@ -775,36 +837,85 @@ golang.org/x/crypto v0.0.0-20200423211502-4bdfaf469ed5/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= +golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= +golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= +golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190930215403-16217165b5de h1:5hukYrvBGR8/eNkX5mdUezrA6JiaEZDtJb9Ei+1LlBs= +golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= +golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20200302205851-738671d3881b h1:Wh+f8QHJXR411sJR8/vRBTZ7YapZaRvUcLFFJhusH0k= +golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0 h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4= 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-20181011144130-49bb7cea24b1/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-20190227160552-c95aed5357e7/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a h1:oWX7TPOiFAMXLq8o0ikBYfCJVlRHBcsciT5bXOrH628= 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-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200425230154-ff2c4b7c35a0/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20201021035429-f5854403a974 h1:IX6qOQeG5uLjB/hjjwjedwfjND0hgjPMMyO1RoIXQNI= +golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200822124328-c89045814202/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-20210405180319-a5a99cb37ef4 h1:4nGaVu0QrbjT/AK2PRLuQfQuh6DJve+pELhqTdAj3x0= +golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= 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/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= 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-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU= 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-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9 h1:SQFwaSi55rU7vdNs9Yr0Z324VNlrF+0wMqRXT4St8ck= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -812,35 +923,56 @@ golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a h1:1BGLXjeY4akVXGgbC9HugT3Jv3hCI0z56oJR5vAMgBU= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190219092855-153ac476189d/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190228124157-a34e9553db1e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190405154228-4b34438f7a67/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190526052359-791d8a0f4d09/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200116001909-b77594299b42 h1:vEOn+mP2zCOVzKckCZy6YsCtDblrpj/w7B9nxGNELpg= +golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd h1:xhmwyvizuTgC2qz7ZlMluP20uW+C3Rm0FD/WLDX8884= +golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201024232916-9f70ab9862d5 h1:iCaAy5bMeEvwANu3YnJfWwI0kWAGkEa2RXPdweI/ysk= -golang.org/x/sys v0.0.0-20201024232916-9f70ab9862d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210510120138-977fb7262007 h1:gG67DSER+11cZvqIMb8S8bt0vZtiN6xWYARwirrOSfE= +golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= +golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.5 h1:i6eZZ+zk0SOf0xgBpEpPD18qWcJda6q1sxt3S0kzyUQ= +golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -848,54 +980,149 @@ golang.org/x/tools v0.0.0-20181130052023-1c3d964395ce/go.mod h1:n7NCudcB/nEzxVGm golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191108193012-7d206e10da11 h1:Yq9t9jnGoR+dBuitxdo9l6Q7xh/zOyNnYUtDKaQ3x0E= golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191216052735-49a3e744a425 h1:VvQyQJN0tSuecqgcIxMWnnfG5kSmgy9KZR9sW3W5QeA= +golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191216052735-49a3e744a425/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= +golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20201023174141-c8cfbd0f21e6 h1:rbvTkL9AkFts1cgI78+gG6Yu1pwaqX6hjSJAatB78E4= golang.org/x/tools v0.0.0-20201023174141-c8cfbd0f21e6/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898 h1:/atklqdjdhuosWIl6AIbOeHJjicWYPqR9bpxqxYG2pA= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= +google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= +google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= +google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= +google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.6 h1:lMO5rYAqUxkmaj76jAkRUvt5JZgFymx/+Q5Mzfivuhc= +google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55 h1:gSJIx1SDwno+2ElGhA4+qG2zF97qiUzTM+rQ0klBOcE= +google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= +google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= +google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= +google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20220118154757-00ab72f36ad5 h1:zzNejm+EgrbLfDZ6lu9Uud2IVvHySPl8vQzf04laR5Q= +google.golang.org/genproto v0.0.0-20220118154757-00ab72f36ad5/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= google.golang.org/grpc v1.28.1/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= -google.golang.org/grpc v1.31.1 h1:SfXqXS5hkufcdZ/mHtYCh53P2b+92WQq/DZcKLgsFRs= +google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= +google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= +google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= +google.golang.org/grpc v1.43.0 h1:Eeu7bZtDZ2DpRCsLhUlcrLnvYaMK1Gz86a+hMVvELmM= +google.golang.org/grpc v1.43.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= -google.golang.org/protobuf v1.23.0 h1:4MY060fB1DLGMB/7MBTLnwQUY6+F09GEiz6SsrNqyzM= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= +google.golang.org/protobuf v1.27.1/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-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/ini.v1 v1.56.0 h1:DPMeDvGTM54DXbPkVIZsp19fp/I2K7zwA/itHYHKo8Y= gopkg.in/ini.v1 v1.56.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= @@ -908,17 +1135,30 @@ gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWD gopkg.in/urfave/cli.v1 v1.20.0/go.mod h1:vuBzUtMdQeixQj8LVd+/98pzhxNGQoyuPBlsXHOQNO0= 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.3/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.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= 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.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= 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= +gorm.io/driver/sqlite v1.2.6 h1:SStaH/b+280M7C8vXeZLz/zo9cLQmIGwwj3cSj7p6l4= +gorm.io/driver/sqlite v1.2.6/go.mod h1:gyoX0vHiiwi0g49tv+x2E7l8ksauLK0U/gShcdUsjWY= +gorm.io/gorm v1.22.3/go.mod h1:F+OptMscr0P2F2qU97WT1WimdH9GaQPoDW7AYd5i2Y0= +gorm.io/gorm v1.22.4 h1:8aPcyEJhY0MAt8aY6Dc524Pn+pO29K+ydu+e/cXSpQM= +gorm.io/gorm v1.22.4/go.mod h1:1aeVC+pe9ZmvKZban/gW4QPra7PRoTEssyc922qCAkk= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.1-2019.2.3 h1:3JgtbtFHMiCmsznwGVTUWbgGov+pVqnlf1dEJTNAXeM= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +honnef.co/go/tools v0.0.1-2020.1.4 h1:UoveltGrhghAA7ePc+e+QYDHXrBps2PqFZiHkGR/xK8= +honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= launchpad.net/gocheck v0.0.0-20140225173054-000000000087 h1:Izowp2XBH6Ya6rv+hqbceQyw/gSGoXfH/UPoTGduL54= launchpad.net/gocheck v0.0.0-20140225173054-000000000087/go.mod h1:hj7XX3B/0A+80Vse0e+BUHsHMTEhd0O4cpUHr/e/BUM= +rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= +rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= +sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= diff --git a/lightclient/connect_tracker.go b/lightclient/connect_tracker.go index 57b0b5c5c..340adec3e 100644 --- a/lightclient/connect_tracker.go +++ b/lightclient/connect_tracker.go @@ -1,42 +1,24 @@ package lightclient import ( - "encoding/json" + "context" "github.com/asdine/storm" "github.com/asdine/storm/q" - "github.com/gorilla/websocket" "github.com/omnilaboratory/obd/bean" - "github.com/omnilaboratory/obd/bean/enum" "github.com/omnilaboratory/obd/config" "github.com/omnilaboratory/obd/conn" "github.com/omnilaboratory/obd/dao" "github.com/omnilaboratory/obd/service" "github.com/omnilaboratory/obd/tool" - trackerBean "github.com/omnilaboratory/obd/tracker/bean" - "github.com/tidwall/gjson" + "github.com/omnilaboratory/obd/tracker/tkrpc" "io/ioutil" "log" - "net/url" - "reflect" "strings" "time" ) -var conn *websocket.Conn -var ticker3m *time.Ticker -var isReset = true - func ConnectToTracker() (err error) { - u := url.URL{Scheme: "ws", Host: config.TrackerHost, Path: "/ws"} - log.Printf("begin to connect to tracker: %s", u.String()) - - conn, _, err = websocket.DefaultDialer.Dial(u.String(), nil) - if err != nil { - log.Println("fail to dial tracker:", err) - return err - } - chainNodeType, trackerP2pAddress, err := conn2tracker.GetChainNodeType() if err != nil { return err @@ -48,157 +30,55 @@ func ConnectToTracker() (err error) { if err != nil { return err } + SynData() + //HeartBeat will set obd-node online info. + go HeartBeat() - if service.TrackerChan == nil { - service.TrackerChan = make(chan []byte) - } - - if isReset { - go readDataFromWs() - } - - if ticker3m == nil { - startSchedule() - } return nil } -func readDataFromWs() { - isReset = false - ticker := time.NewTicker(time.Minute * 2) - defer ticker.Stop() - - defer func(ticker *time.Ticker) { - if r := recover(); r != nil { - log.Println("tracker goroutine recover") - ticker.Stop() - conn = nil - isReset = true - } - }(ticker) - defer conn.Close() - - // read message - go func() { - for { - if conn == nil { - isReset = true - return - } - - _, message, err := conn.ReadMessage() - if err != nil { - isReset = true - log.Println("socket to tracker get err:", err) - conn = nil - return - } - - //log.Println("get data from tracker", string(message)) - replyMessage := bean.ReplyMessage{} - err = json.Unmarshal(message, &replyMessage) - if err == nil { - switch replyMessage.Type { - case enum.MsgType_Tracker_GetHtlcPath_351: - v := reflect.ValueOf(replyMessage.Result) - requestMessage := bean.RequestMessage{} - requestMessage.Type = replyMessage.Type - requestMessage.Data = "" - if v.Kind() == reflect.Map { - dataMap := replyMessage.Result.(map[string]interface{}) - requestMessage.RecipientUserPeerId = dataMap["senderPeerId"].(string) - requestMessage.Data = dataMap["h"].(string) + "_" + dataMap["path"].(string) + "_" + tool.FloatToString(dataMap["amount"].(float64), 8) - //requestMessage.Data = dataMap["h"].(string) + "_" + dataMap["path"].(string) - } - htlcTrackerDealModule(requestMessage) - case enum.MsgType_Tracker_Connect_301: - config.ChainNodeType = replyMessage.Result.(string) - go SynData() - } - } - } - }() - - // heartbeat and check whether - for { - select { - case t := <-ticker.C: - if conn != nil { - info := make(map[string]interface{}) - info["type"] = enum.MsgType_Tracker_HeartBeat_302 - info["data"] = t.String() - bytes, err := json.Marshal(info) - err = conn.WriteMessage(websocket.TextMessage, bytes) - if err != nil { - log.Println("HeartBeat:", err) - isReset = true - log.Println("socket to tracker get err:", err) - conn = nil - return - } - } else { - return - } - } - } -} - +var ITclient=service.ITclient func SynData() { log.Println("synData to tracker") - updateP2pAddressLogin() - sycUserInfos() - sycChannelInfos() -} - -func updateP2pAddressLogin() { - info := make(map[string]interface{}) - info["type"] = enum.MsgType_Tracker_NodeLogin_303 - nodeLoginInfo := &bean.ObdNodeLoginRequest{} - nodeLoginInfo.NodeId = tool.GetObdNodeId() - nodeLoginInfo.P2PAddress = localServerDest - info["data"] = nodeLoginInfo - bytes, err := json.Marshal(info) - if err != nil { - log.Println(err) - } else { - sendMsgToTracker(bytes) - } -} -func sycUserInfos() { - - nodes := make([]bean.ObdNodeUserLoginRequest, 0) + //sycUserInfos() + ureq:=&tkrpc.UpdateUserInfosReq{ } for userId, _ := range GlobalWsClientManager.OnlineClientMap { - user := bean.ObdNodeUserLoginRequest{} - user.UserId = userId - nodes = append(nodes, user) + req:=&tkrpc.UpdateUserInfoReq{UserId: userId} + ureq.UpdateUserInfoReqs=append(ureq.UpdateUserInfoReqs,req) } - if len(nodes) > 0 { - log.Println("syn UserInfo data to tracker", nodes) - info := make(map[string]interface{}) - info["type"] = enum.MsgType_Tracker_UpdateUserInfo_353 - info["data"] = nodes - bytes, err := json.Marshal(&info) - if err == nil { - sendMsgToTracker(bytes) - } + _,err:= ITclient.UpdateUserInfos(todo,ureq) + if err != nil { + panic(err) + } + log.Println("synced userinfos") + + //sycChannelInfos() + creq:=&tkrpc.UpdateChannelInfosReq{} + channels := getChannelInfos() + for _, channel := range channels { + cInfo:= &tkrpc.ChannelInfo{} + cInfo.ChannelId =channel.ChannelId + cInfo.PropertyId =channel.PropertyId + cInfo.CurrState =tkrpc.ChannelState(int(channel.CurrState)) + cInfo.PeerIda =channel.PeerIdA + cInfo.PeerIdb =channel.PeerIdB + cInfo.AmountA =channel.AmountA + cInfo.AmountB =channel.AmountB + cInfo.IsAlice =channel.IsAlice + cInfo.NodeId =tool.GetObdNodeId() + creq.ChannelInfos=append(creq.ChannelInfos,cInfo) + } + _,err= ITclient.UpdateChannelInfos(todo,creq) + if err != nil { + panic(err) } -} + log.Println("synced ChannelInfos") -//同步通道信息 -func sycChannelInfos() { - nodes := getChannelInfos() - if len(nodes) > 0 { - info := make(map[string]interface{}) - info["type"] = enum.MsgType_Tracker_UpdateChannelInfo_350 - info["data"] = nodes - bytes, err := json.Marshal(info) - if err == nil { - sendMsgToTracker(bytes) - } - } } +var todo=context.TODO() + func getChannelInfos() []bean.ChannelInfoRequest { _dir := config.DataDirectory + "/" + config.ChainNodeType files, _ := ioutil.ReadDir(_dir) @@ -334,55 +214,22 @@ func checkChannel(userId string, db storm.Node, nodes []bean.ChannelInfoRequest) return nodes } -func sendMsgToTracker(msg []byte) { - //log.Println("send to tracker", string(msg)) - if conn == nil { - isReset = true - err := ConnectToTracker() - if err != nil { - log.Println(err) - return - } - } - err := conn.WriteMessage(websocket.TextMessage, msg) - if err != nil { - log.Println("write:", err) - return - } -} - -func startSchedule() { - go func() { - for { - select { - case msg := <-service.TrackerChan: - sendMsgToTracker(msg) - msgType := gjson.Parse(string(msg)).Get("type").Int() - if msgType == 350 { - message := &trackerBean.RequestMessage{} - err := json.Unmarshal(msg, message) - if err == nil { - marshal, err := json.Marshal(message.Data) - if err == nil { - sendChannelInfoToIndirectTracker(string(marshal)) - } - } +func HeartBeat() { + ninfo := &tkrpc.UpdateNodeInfoReq{NodeId: tool.GetObdNodeId(), P2PAddress: localServerDest, IsOnline: 1} + for { + cliStream, err := ITclient.HeartBeat(context.TODO(), nil) + if err == nil { + for { + err = cliStream.Send(ninfo) + if err != nil { + break } + time.Sleep(1 * time.Minute) } } - }() - - go func() { - ticker3m = time.NewTicker(1 * time.Minute) - defer ticker3m.Stop() - for { - select { - case t := <-ticker3m.C: - if conn == nil { - log.Println("reconnect tracker ", t) - _ = ConnectToTracker() - } - } + if err != nil { + log.Println("heartBeat error", err) } - }() + time.Sleep(2 * time.Second) + } } diff --git a/lightclient/p2p_util.go b/lightclient/p2p_util.go index db78024c8..4846928d9 100644 --- a/lightclient/p2p_util.go +++ b/lightclient/p2p_util.go @@ -370,23 +370,24 @@ func sendP2PMsg(remoteP2PPeerId string, msg string) error { return nil } -func sendInfoOnUserStateChange(userId string) { - for key := range trackerNodeIdMap { - findID, err := peer.Decode(key) - if err == nil { - findPeer, err := kademliaDHT.FindPeer(ctx, findID) - if err == nil { - stream, err := hostNode.NewStream(ctx, findPeer.ID, bean.ProtocolIdForUserState) - if err == nil { - rw := bufio.NewReadWriter(bufio.NewReader(stream), bufio.NewWriter(stream)) - _, _ = rw.WriteString(hostNode.ID().Pretty() + "_" + userId + "_" + localServerDest + "~") - err = rw.Flush() - log.Println(err) - } - } - } - } -} +//just send userinfo to backup trackers. tracker msg sync mode will tune, and this function will delete +//func sendInfoOnUserStateChange(userId string) { +// for key := range trackerNodeIdMap { +// findID, err := peer.Decode(key) +// if err == nil { +// findPeer, err := kademliaDHT.FindPeer(ctx, findID) +// if err == nil { +// stream, err := hostNode.NewStream(ctx, findPeer.ID, bean.ProtocolIdForUserState) +// if err == nil { +// rw := bufio.NewReadWriter(bufio.NewReader(stream), bufio.NewWriter(stream)) +// _, _ = rw.WriteString(hostNode.ID().Pretty() + "_" + userId + "_" + localServerDest + "~") +// err = rw.Flush() +// log.Println(err) +// } +// } +// } +// } +//} func sendChannelInfoToIndirectTracker(msg string) { //log.Println("sendChannelInfoToIndirectTracker", msg) diff --git a/lightclient/wsclient_htlc.go b/lightclient/wsclient_htlc.go index e81ab68f1..5b96ead8e 100644 --- a/lightclient/wsclient_htlc.go +++ b/lightclient/wsclient_htlc.go @@ -7,6 +7,8 @@ import ( "github.com/omnilaboratory/obd/bean/enum" conn2tracker "github.com/omnilaboratory/obd/conn" "github.com/omnilaboratory/obd/service" + "github.com/omnilaboratory/obd/tool" + "github.com/omnilaboratory/obd/tracker/tkrpc" "log" ) @@ -86,7 +88,7 @@ func (client *Client) HtlcHModule(msg bean.RequestMessage) (enum.SendTargetType, sendType = enum.SendTargetType_SendToSomeone case enum.MsgType_HTLC_FindPath_401: tempClientMap[client.User.PeerId] = client - respond, isPrivate, err := service.HtlcForwardTxService.PayerRequestFindPath(msg.Data, *client.User) + respond, isPrivate,pubPathRequst, err := service.HtlcForwardTxService.PayerRequestFindPath(msg.Data, *client.User) if err != nil { data = err.Error() client.SendToMyself(msg.Type, status, data) @@ -112,6 +114,28 @@ func (client *Client) HtlcHModule(msg bean.RequestMessage) (enum.SendTargetType, sendType, bytes, status = client.HtlcHModule(newMsg) data = string(bytes) } + }else { + //old obd/service/htlc_tx_forward.go HtlcForwardTxService.PayerRequestFindPath sendMsgToTracker(enum.MsgType_Tracker_GetHtlcPath_351, pathRequest) move here + //MsgType_Tracker_GetHtlcPath_351 now we can get response from grpc-conn directly;then continue old MsgType_Tracker_GetHtlcPath_351-response process use old weektype function htlcTrackerDealModule + //pubPathRequst := trackerBean.HtlcPathRequest{} + gpReq := &tkrpc.HtlcGetPathReq{} + gpReq.PayerObdNodeId = pubPathRequst.PayerObdNodeId + gpReq.RealPayerPeerId = pubPathRequst.RealPayerPeerId + gpReq.PayeePeerId = pubPathRequst.PayeePeerId + gpReq.PropertyId = pubPathRequst.PropertyId + gpReq.H = pubPathRequst.H + gpReq.Amount = pubPathRequst.Amount + res, err1 := ITclient.HtlcGetPath(todo, gpReq) + err = err1 + if err == nil { + requestMessage := bean.RequestMessage{} + requestMessage.Type = enum.MsgType_Tracker_GetHtlcPath_351 + requestMessage.Data = "" + requestMessage.RecipientUserPeerId = res.SenderPeerId + requestMessage.Data = res.H + "_" + res.Path + "_" + tool.FloatToString(res.Amount, 8) + //requestMessage.Data = dataMap["h"].(string) + "_" + dataMap["path"].(string) + htlcTrackerDealModule(requestMessage) + } } } sendType = enum.SendTargetType_SendToSomeone diff --git a/lightclient/wsclient_manager.go b/lightclient/wsclient_manager.go index fa94e31a3..5797cf919 100644 --- a/lightclient/wsclient_manager.go +++ b/lightclient/wsclient_manager.go @@ -9,6 +9,7 @@ import ( "github.com/omnilaboratory/obd/conn" "github.com/omnilaboratory/obd/service" "github.com/omnilaboratory/obd/tool" + "github.com/omnilaboratory/obd/tracker/tkrpc" "log" ) @@ -66,8 +67,10 @@ func (clientManager *clientManager) cleanConn(client *Client) { } delete(clientManager.ClientsMap, client) if client.User != nil { + user:=client.User + ITclient.UpdateUserInfo(todo,&tkrpc.UpdateUserInfoReq{UserId:user.PeerId,NodeId:user.P2PLocalPeerId,P2PAddress:user.P2PLocalAddress,IsOnline: 2}) _ = service.UserService.UserLogout(client.User) - sendInfoOnUserStateChange(client.User.PeerId) + //sendInfoOnUserStateChange(client.User.PeerId) delete(clientManager.OnlineClientMap, client.User.PeerId) delete(service.OnlineUserMap, client.User.PeerId) client.User = nil diff --git a/lightclient/wsclient_user.go b/lightclient/wsclient_user.go index 059e4b3c4..2264cc689 100644 --- a/lightclient/wsclient_user.go +++ b/lightclient/wsclient_user.go @@ -8,6 +8,7 @@ import ( "github.com/omnilaboratory/obd/config" "github.com/omnilaboratory/obd/service" "github.com/omnilaboratory/obd/tool" + "github.com/omnilaboratory/obd/tracker/tkrpc" "github.com/tidwall/gjson" ) @@ -64,7 +65,7 @@ func (client *Client) UserModule(msg bean.RequestMessage) (enum.SendTargetType, if client.User != nil { if client.User.Mnemonic != mnemonic { _ = service.UserService.UserLogout(client.User) - sendInfoOnUserStateChange(client.User.PeerId) + //sendInfoOnUserStateChange(client.User.PeerId) delete(GlobalWsClientManager.OnlineClientMap, client.User.PeerId) delete(service.OnlineUserMap, client.User.PeerId) client.User = nil @@ -90,7 +91,7 @@ func (client *Client) UserModule(msg bean.RequestMessage) (enum.SendTargetType, } else { err = service.UserService.UserLogin(&user) if err == nil { - sendInfoOnUserStateChange(user.PeerId) + //sendInfoOnUserStateChange(user.PeerId) } } if err == nil { @@ -127,8 +128,11 @@ func (client *Client) UserModule(msg bean.RequestMessage) (enum.SendTargetType, client.SendToMyself(msg.Type, status, data) if exist == false { + user:=client.User + ITclient.UpdateUserInfo(todo,&tkrpc.UpdateUserInfoReq{UserId:user.PeerId,NodeId:user.P2PLocalPeerId,P2PAddress:user.P2PLocalAddress,IsOnline: 2}) + _ = service.UserService.UserLogout(client.User) - sendInfoOnUserStateChange(client.User.PeerId) + //sendInfoOnUserStateChange(client.User.PeerId) delete(GlobalWsClientManager.ClientsMap, client) delete(GlobalWsClientManager.OnlineClientMap, client.User.PeerId) diff --git a/service/communicate_with_tracker.go b/service/communicate_with_tracker.go index 9ffdb0111..07e63f3d1 100644 --- a/service/communicate_with_tracker.go +++ b/service/communicate_with_tracker.go @@ -1,28 +1,32 @@ package service import ( - "encoding/json" - "github.com/omnilaboratory/obd/bean" - "github.com/omnilaboratory/obd/bean/enum" + "context" + "crypto/tls" + "fmt" + "github.com/omnilaboratory/obd/config" "github.com/omnilaboratory/obd/dao" - trackerBean "github.com/omnilaboratory/obd/tracker/bean" - "github.com/tidwall/gjson" - "strings" + "github.com/omnilaboratory/obd/tracker/tkrpc" + "google.golang.org/grpc" + "google.golang.org/grpc/credentials" + "log" + "time" ) -var TrackerChan chan []byte +//var TrackerChan chan []byte // sendChannelStateToTracker func sendChannelStateToTracker(channelInfo dao.ChannelInfo, commitmentTx dao.CommitmentTransaction) { if channelInfo.IsPrivate { return } - infoRequest := bean.ChannelInfoRequest{} + infoRequest := &tkrpc.ChannelInfo{} + //infoRequest := bean.ChannelInfoRequest{} infoRequest.ChannelId = channelInfo.ChannelId infoRequest.PropertyId = channelInfo.PropertyId - infoRequest.CurrState = channelInfo.CurrState - infoRequest.PeerIdA = channelInfo.PeerIdA - infoRequest.PeerIdB = channelInfo.PeerIdB + infoRequest.CurrState =tkrpc.ChannelState(int( channelInfo.CurrState)) + infoRequest.PeerIda = channelInfo.PeerIdA + infoRequest.PeerIdb = channelInfo.PeerIdB infoRequest.IsAlice = false if commitmentTx.Id > 0 { @@ -35,38 +39,45 @@ func sendChannelStateToTracker(channelInfo dao.ChannelInfo, commitmentTx dao.Com infoRequest.AmountA = commitmentTx.AmountToCounterparty } } - nodes := make([]bean.ChannelInfoRequest, 0) - nodes = append(nodes, infoRequest) - go sendMsgToTracker(enum.MsgType_Tracker_UpdateChannelInfo_350, nodes) + _,err:=ITclient.UpdateChannelInfo(todo,infoRequest) + if err != nil { + log.Println("UpdateChannelInfo err",err) + } + //nodes := make([]bean.ChannelInfoRequest, 0) + //nodes = append(nodes, infoRequest) + //go sendMsgToTracker(enum.MsgType_Tracker_UpdateChannelInfo_350, nodes) } func noticeTrackerUserLogin(user dao.User) { - loginRequest := bean.ObdNodeUserLoginRequest{UserId: user.PeerId} - sendMsgToTracker(enum.MsgType_Tracker_UserLogin_304, loginRequest) + _,err:=ITclient.UpdateUserInfo(todo,&tkrpc.UpdateUserInfoReq{UserId:user.PeerId,NodeId:user.P2PLocalPeerId,P2PAddress:user.P2PLocalAddress,IsOnline: 1}) + if err != nil { + log.Println("UpdateUserInfo err",err) + } + //loginRequest := bean.ObdNodeUserLoginRequest{UserId: user.PeerId} + //sendMsgToTracker(enum.MsgType_Tracker_UserLogin_304, loginRequest) } func noticeTrackerUserLogout(user dao.User) { - loginRequest := bean.ObdNodeUserLoginRequest{UserId: user.PeerId} - sendMsgToTracker(enum.MsgType_Tracker_UserLogout_305, loginRequest) + //loginRequest := bean.ObdNodeUserLoginRequest{UserId: user.PeerId} + //sendMsgToTracker(enum.MsgType_Tracker_UserLogout_305, loginRequest) + _,err:=ITclient.UpdateUserInfo(todo,&tkrpc.UpdateUserInfoReq{UserId:user.PeerId,NodeId:user.P2PLocalPeerId,P2PAddress:user.P2PLocalAddress,IsOnline: 2}) + if err != nil { + log.Println("UpdateUserInfo err",err) + } } -func sendMsgToTracker(msgType enum.MsgType, data interface{}) { - - message := trackerBean.RequestMessage{Type: msgType} - - dataBytes, _ := json.Marshal(data) - dataStr := string(dataBytes) - - parse := gjson.Parse(dataStr) - result := parse.Value() - if strings.HasPrefix(dataStr, "{") == false && strings.HasPrefix(dataStr, "[") == false { - result = dataStr +var ITclient tkrpc.InfoTrackerClient +func init(){ + tc,_:=context.WithTimeout(context.Background(),5*time.Second) + creds := credentials.NewTLS(&tls.Config{ + //TLS Config values here + }) + conn, err := grpc.DialContext(tc,config.TrackerHostGrpc, grpc.WithBlock(),grpc.WithTransportCredentials(creds)) //grpc.WithInsecure(), + if err == nil { + ITclient = tkrpc.NewInfoTrackerClient(conn) + log.Println("connected tracker grpc",config.TrackerHostGrpc) } - - message.Data = result - //log.Println(message.Data) - bytes, _ := json.Marshal(message) - if TrackerChan != nil { - TrackerChan <- bytes + if err != nil { + panic(fmt.Errorf("Tracker grpc Client err %s",err.Error())) } } diff --git a/service/htlc_tx_backward.go b/service/htlc_tx_backward.go index 55c779094..0efa74f1b 100644 --- a/service/htlc_tx_backward.go +++ b/service/htlc_tx_backward.go @@ -13,6 +13,7 @@ import ( "github.com/omnilaboratory/obd/omnicore" "github.com/omnilaboratory/obd/tool" trackerBean "github.com/omnilaboratory/obd/tracker/bean" + "github.com/omnilaboratory/obd/tracker/tkrpc" "github.com/tidwall/gjson" "log" "strconv" @@ -493,7 +494,8 @@ func (service *htlcBackwardTxManager) OnGetHeRdDataAtBobObd(msg string, user bea if channelInfo.IsPrivate == false { //update htlc state on tracker - txStateRequest := trackerBean.UpdateHtlcTxStateRequest{} + //txStateRequest := trackerBean.UpdateHtlcTxStateRequest{} + txStateRequest := &tkrpc.HtlcInfo{} txStateRequest.Path = latestCommitment.HtlcRoutingPacket txStateRequest.H = latestCommitment.HtlcH if strings.HasSuffix(latestCommitment.HtlcRoutingPacket, channelInfo.ChannelId) { @@ -501,7 +503,9 @@ func (service *htlcBackwardTxManager) OnGetHeRdDataAtBobObd(msg string, user bea } txStateRequest.DirectionFlag = trackerBean.HtlcTxState_ConfirmPayMoney txStateRequest.CurrChannelId = channelInfo.ChannelId - sendMsgToTracker(enum.MsgType_Tracker_UpdateHtlcTxState_352, txStateRequest) + + ITclient.UpdateHtlcInfo(todo,txStateRequest) + //sendMsgToTracker(enum.MsgType_Tracker_UpdateHtlcTxState_352, txStateRequest) } totalDurationObd += time.Now().Sub(beginTime).Milliseconds() beginTime = time.Now() diff --git a/service/htlc_tx_forward.go b/service/htlc_tx_forward.go index d49506995..a34f765f6 100644 --- a/service/htlc_tx_forward.go +++ b/service/htlc_tx_forward.go @@ -1,6 +1,7 @@ package service import ( + "context" "encoding/json" "errors" "fmt" @@ -14,6 +15,7 @@ import ( "github.com/omnilaboratory/obd/omnicore" "github.com/omnilaboratory/obd/tool" trackerBean "github.com/omnilaboratory/obd/tracker/bean" + "github.com/omnilaboratory/obd/tracker/tkrpc" "github.com/shopspring/decimal" "log" "strconv" @@ -177,16 +179,16 @@ func (service *htlcForwardTxManager) ParseInvoice(msgData string, user bean.User } // 401 htlc find path -func (service *htlcForwardTxManager) PayerRequestFindPath(msgData string, user bean.User) (data interface{}, isPrivate bool, err error) { +func (service *htlcForwardTxManager) PayerRequestFindPath(msgData string, user bean.User) (data interface{}, isPrivate bool,pubPathRequest *trackerBean.HtlcPathRequest, err error) { if tool.CheckIsString(&msgData) == false { - return nil, false, errors.New(enum.Tips_common_empty + "msg data") + return nil, false,nil, errors.New(enum.Tips_common_empty + "msg data") } requestData := &bean.HtlcRequestFindPath{} err = json.Unmarshal([]byte(msgData), requestData) if err != nil { log.Println(err.Error()) - return nil, false, err + return nil, false,nil, err } var requestFindPathInfo bean.HtlcRequestFindPathInfo @@ -194,23 +196,23 @@ func (service *htlcForwardTxManager) PayerRequestFindPath(msgData string, user b if tool.CheckIsString(&requestData.Invoice) { htlcRequestInvoice, err := tool.DecodeInvoiceObjFromCodes(requestData.Invoice) if err != nil { - return nil, false, errors.New(enum.Tips_common_wrong + "invoice") + return nil, false,nil, errors.New(enum.Tips_common_wrong + "invoice") } if err = findUserIsOnline(htlcRequestInvoice.RecipientNodePeerId, htlcRequestInvoice.RecipientUserPeerId); err != nil { - return nil, requestFindPathInfo.IsPrivate, err + return nil, requestFindPathInfo.IsPrivate,nil, err } requestFindPathInfo = htlcRequestInvoice.HtlcRequestFindPathInfo } else { requestFindPathInfo = requestData.HtlcRequestFindPathInfo if tool.CheckIsString(&requestFindPathInfo.RecipientNodePeerId) == false { - return nil, requestFindPathInfo.IsPrivate, errors.New(enum.Tips_common_wrong + "recipient_node_peer_id") + return nil, requestFindPathInfo.IsPrivate, nil,errors.New(enum.Tips_common_wrong + "recipient_node_peer_id") } if tool.CheckIsString(&requestFindPathInfo.RecipientUserPeerId) == false { - return nil, requestFindPathInfo.IsPrivate, errors.New(enum.Tips_common_wrong + "recipient_user_peer_id") + return nil, requestFindPathInfo.IsPrivate, nil,errors.New(enum.Tips_common_wrong + "recipient_user_peer_id") } if err = findUserIsOnline(requestFindPathInfo.RecipientNodePeerId, requestFindPathInfo.RecipientUserPeerId); err != nil { - return nil, requestFindPathInfo.IsPrivate, err + return nil, requestFindPathInfo.IsPrivate,nil, err } } @@ -220,24 +222,24 @@ func (service *htlcForwardTxManager) PayerRequestFindPath(msgData string, user b if cacheDataForTx.Id != 0 { now := time.Now().Add(-1 * time.Minute) if cacheDataForTx.IsFinish && cacheDataForTx.CreateAt.After(now) { - return nil, false, errors.New("request too fast") + return nil, false,nil, errors.New("request too fast") } } if requestFindPathInfo.RecipientUserPeerId == user.PeerId && requestFindPathInfo.RecipientNodePeerId == user.P2PLocalPeerId { - return nil, requestFindPathInfo.IsPrivate, errors.New("recipient_user_peer_id can not be yourself") + return nil, requestFindPathInfo.IsPrivate,nil, errors.New("recipient_user_peer_id can not be yourself") } if requestFindPathInfo.PropertyId < 0 { - return nil, requestFindPathInfo.IsPrivate, errors.New(enum.Tips_common_wrong + "property_id") + return nil, requestFindPathInfo.IsPrivate,nil, errors.New(enum.Tips_common_wrong + "property_id") } if requestFindPathInfo.Amount < tool.GetOmniDustBtc() { - return nil, requestFindPathInfo.IsPrivate, errors.New(enum.Tips_common_wrong + "amount") + return nil, requestFindPathInfo.IsPrivate, nil,errors.New(enum.Tips_common_wrong + "amount") } if time.Now().After(time.Time(requestFindPathInfo.ExpiryTime)) { - return nil, requestFindPathInfo.IsPrivate, errors.New(fmt.Sprintf(enum.Tips_htlc_expiryTimeAfterNow, "expiry_time")) + return nil, requestFindPathInfo.IsPrivate,nil, errors.New(fmt.Sprintf(enum.Tips_htlc_expiryTimeAfterNow, "expiry_time")) } if requestFindPathInfo.IsPrivate == false { @@ -262,15 +264,16 @@ func (service *htlcForwardTxManager) PayerRequestFindPath(msgData string, user b bytes, _ := json.Marshal(requestFindPathInfo) cacheDataForTx.Data = bytes _ = user.Db.Save(cacheDataForTx) - - sendMsgToTracker(enum.MsgType_Tracker_GetHtlcPath_351, pathRequest) - return make(map[string]interface{}), requestFindPathInfo.IsPrivate, nil + //user login info will send when obd/lightclient/wsclient_htlc.go process MsgType_HTLC_FindPath_401 + //sendMsgToTracker(enum.MsgType_Tracker_GetHtlcPath_351, pathRequest) + return make(map[string]interface{}), requestFindPathInfo.IsPrivate, &pathRequest,nil } else { requestData.HtlcRequestFindPathInfo = requestFindPathInfo - return getPrivateChannelForHtlc(requestData, user) + data , isPrivate , err:=getPrivateChannelForHtlc(requestData, user) + return data , isPrivate ,nil, err } } - +var todo=context.TODO() func getPrivateChannelForHtlc(requestData *bean.HtlcRequestFindPath, user bean.User) (data interface{}, isPrivate bool, err error) { tx, err := user.Db.Begin(true) if err != nil { @@ -592,12 +595,14 @@ func (service *htlcForwardTxManager) AliceAddHtlcAtAliceSide(msg bean.RequestMes //更新tracker的htlc的状态 if channelInfo.IsPrivate == false { - txStateRequest := trackerBean.UpdateHtlcTxStateRequest{} + //txStateRequest := trackerBean.UpdateHtlcTxStateRequest{} + txStateRequest := &tkrpc.HtlcInfo{} txStateRequest.Path = latestCommitmentTx.HtlcRoutingPacket txStateRequest.H = latestCommitmentTx.HtlcH txStateRequest.DirectionFlag = trackerBean.HtlcTxState_PayMoney txStateRequest.CurrChannelId = channelInfo.ChannelId - sendMsgToTracker(enum.MsgType_Tracker_UpdateHtlcTxState_352, txStateRequest) + ITclient.UpdateHtlcInfo(todo,txStateRequest) + //sendMsgToTracker(enum.MsgType_Tracker_UpdateHtlcTxState_352, txStateRequest) } } else { if requestData.CurrHtlcTempAddressForHt1aPubKey != htlcRequestInfo.CurrHtlcTempAddressForHt1aPubKey { diff --git a/service/user.go b/service/user.go index 37e22dde0..e723941f9 100644 --- a/service/user.go +++ b/service/user.go @@ -56,8 +56,9 @@ func (service *UserManager) UserLogin(user *bean.User) error { node.LatestLoginTime = time.Now() err = userDB.Update(&node) } - - noticeTrackerUserLogin(node) + if err == nil { + noticeTrackerUserLogin(node) + } if err != nil { return err diff --git a/tracker/bean/message.go b/tracker/bean/message.go index 7ca5d3b2d..9bc36a7a3 100644 --- a/tracker/bean/message.go +++ b/tracker/bean/message.go @@ -35,8 +35,8 @@ const ( //GetHtlcTxStateRequest type GetHtlcTxStateRequest struct { - Path string `json:"path"` - H string `json:"h"` + Path string `json:"path" form:"path"` + H string `json:"h" form:"h"` } //GetChannelStateRequest diff --git a/tracker/config/cfg.go b/tracker/config/cfg.go index 5f03220de..328544411 100644 --- a/tracker/config/cfg.go +++ b/tracker/config/cfg.go @@ -30,6 +30,7 @@ var ( ReadTimeout = 60 * time.Second WriteTimeout = 60 * time.Second TrackerServerPort = 60060 + TrackerServerGrpcPort = "60061" HtlcFeeRate = 0.0001 diff --git a/tracker/config/sqldb.go b/tracker/config/sqldb.go new file mode 100644 index 000000000..b9f0db587 --- /dev/null +++ b/tracker/config/sqldb.go @@ -0,0 +1,38 @@ +package cfg + +import ( + "fmt" + "github.com/omnilaboratory/obd/tracker/tkrpc" + "gorm.io/driver/sqlite" + "gorm.io/gorm" + "log" + "strings" +) + +func GetSqldb (connstr string, dbType string) (db *gorm.DB) { + log.Println("connect:",connstr) + var err error + if dbType=="mysql"{ + //db, err = gorm.Open(mysql.Open( connstr)) + }else if strings.HasPrefix( dbType,"sqlite"){ + fname:="./dbdata/data_sql_main.db" + items:=strings.Split(dbType,":") + if len(items)>1{ + fname=fmt.Sprintf("./dbdata/data_sql_%s.db",items[1]) + } + db, err = gorm.Open(sqlite.Open(fname), &gorm.Config{}) + }else{ + log.Fatalln("err dbtype:",dbType) + } + if err!=nil{ + fmt.Println(err); + panic(err) + } + fmt.Println("InitGormBD,dbType",dbType,connstr); + return db +} +var Orm *gorm.DB +func init(){ + Orm=GetSqldb("","sqlite") + Orm.AutoMigrate(tkrpc.NodeInfo{},tkrpc.UserInfo{},tkrpc.LockHtlcPath{}) +} diff --git a/tracker/router/router.go b/tracker/router/router.go index 401d25843..99b895c52 100644 --- a/tracker/router/router.go +++ b/tracker/router/router.go @@ -1,24 +1,40 @@ package router import ( + "context" "fmt" "github.com/gin-gonic/gin" - "github.com/gorilla/websocket" + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + cfg "github.com/omnilaboratory/obd/tracker/config" "github.com/omnilaboratory/obd/tracker/service" - "github.com/satori/go.uuid" + "github.com/omnilaboratory/obd/tracker/tkrpc" + "google.golang.org/grpc" + "google.golang.org/grpc/credentials/insecure" "net/http" "strings" ) - +func grpcGateWay(router *gin.Engine){ + // Register gRPC server endpoint + // Note: Make sure the gRPC server is running properly and accessible + mux := runtime.NewServeMux() + opts := []grpc.DialOption{grpc.WithTransportCredentials(insecure.NewCredentials())} + err := tkrpc.RegisterInfoTrackerHandlerFromEndpoint(context.TODO(), mux, "localhost:"+cfg.TrackerServerGrpcPort, opts) + if err != nil { + panic(err) + } + router.GET("/gw/*all",func( c *gin.Context){ + mux.ServeHTTP(c.Writer,c.Request) + }) +} func InitRouter() *gin.Engine { gin.SetMode(gin.ReleaseMode) router := gin.New() router.Use(gin.Logger()) router.Use(gin.Recovery()) router.Use(cors()) - go service.ObdNodeManager.TrackerStart() - router.GET("/ws", wsClientConnect) + grpcGateWay(router) + //apiv1's data can return by grpc-gateway too, should replace it at jsdk apiv1 := router.Group("/api/v1/") { apiv1.GET("GetHtlcCurrState", service.HtlcService.GetHtlcCurrState) @@ -27,6 +43,7 @@ func InitRouter() *gin.Engine { apiv1.GET("getUserP2pNodeId", service.NodeAccountService.GetUserP2pNodeId) apiv1.GET("getNodeInfoByP2pAddress", service.NodeAccountService.GetNodeInfoByP2pAddress) } + //apiv2's data can return by grpc-gateway too, should replace it at jsdk apiv2 := router.Group("/api/common/") { apiv2.GET("getObdNodes", service.NodeAccountService.GetAllObdNodes) @@ -106,18 +123,4 @@ func cors() gin.HandlerFunc { } } -func wsClientConnect(c *gin.Context) { - conn, err := (&websocket.Upgrader{CheckOrigin: func(r *http.Request) bool { return true }}).Upgrade(c.Writer, c.Request, nil) - if err != nil { - http.NotFound(c.Writer, c.Request) - return - } - uuidStr := uuid.NewV4() - newClient := &service.ObdNode{ - Id: uuidStr.String(), - Socket: conn, - SendChannel: make(chan []byte)} - service.ObdNodeManager.Connected <- newClient - go newClient.Write() - go newClient.Read() -} + diff --git a/tracker/service/client_service.go b/tracker/service/client_service.go index 724c95461..ef45913df 100644 --- a/tracker/service/client_service.go +++ b/tracker/service/client_service.go @@ -1,196 +1,12 @@ package service import ( - "encoding/json" - "errors" - "fmt" - "github.com/gorilla/websocket" - "github.com/omnilaboratory/obd/bean/enum" "github.com/omnilaboratory/obd/tool" - "github.com/omnilaboratory/obd/tracker/bean" "github.com/omnilaboratory/obd/tracker/config" - "github.com/tidwall/gjson" - "log" "strconv" - "strings" ) - -var tracker *ObdNode - -func init() { - tracker = &ObdNode{Id: GetTrackerNodeId()} -} - // get tracker node id func GetTrackerNodeId() string { source := "tracker:" + tool.GetMacAddrs() + ":" + strconv.Itoa(cfg.TrackerServerPort) return tool.SignMsgWithSha256([]byte(source)) + cfg.ChainNode_Type } - -type ObdNode struct { - Id string - ObdP2pNodeId string - Socket *websocket.Conn - SendChannel chan []byte - IsLogin bool -} - -func (this *ObdNode) sendMsgBackToSender(msgType enum.MsgType, status bool, data string) { - jsonMessage := getReplyObj(data, msgType, status, tracker, this) - this.SendChannel <- jsonMessage -} - -func (this *ObdNode) findSomeNode(nodeId *string) (*ObdNode, error) { - if tool.CheckIsString(nodeId) { - itemClient := ObdNodeManager.ObdNodeMap[*nodeId] - if itemClient != nil { - return itemClient, nil - } - } - return nil, errors.New(fmt.Sprintf(enum.Tips_user_notExistOrOnline, nodeId)) -} - -func (this *ObdNode) Read() { - defer func() { - ObdNodeManager.Disconnected <- this - _ = this.Socket.Close() - log.Println("socket closed") - }() - - for { - _, dataReq, err := this.Socket.ReadMessage() - if err != nil { - log.Println(err) - return - } - log.Println("get data from client: ", string(dataReq)) - reqDataJson := gjson.Parse(string(dataReq)) - msgType := enum.MsgType(reqDataJson.Get("type").Int()) - if bean.CheckExist(msgType) == false { - this.sendMsgBackToSender(msgType, false, "not exist the msg type") - continue - } - if msgType > enum.MsgType_Tracker_UserLogin_304 && this.IsLogin == false { - this.sendMsgBackToSender(msgType, false, "obd need login") - continue - } - - msgData := reqDataJson.Get("data").String() - switch msgType { - case enum.MsgType_Tracker_HeartBeat_302: - this.sendMsgBackToSender(msgType, true, "echo") - case enum.MsgType_Tracker_NodeLogin_303: - retData, err := NodeAccountService.login(this, msgData) - sendDataBackToSender(this, msgType, retData, err) - case enum.MsgType_Tracker_UserLogin_304: - _, _ = NodeAccountService.userLogin(this, msgData) - case enum.MsgType_Tracker_UserLogout_305: - _ = NodeAccountService.userLogout(this, msgData) - case enum.MsgType_Tracker_UpdateChannelInfo_350: - _ = ChannelService.updateChannelInfo(this.ObdP2pNodeId, msgData) - case enum.MsgType_Tracker_GetHtlcPath_351: - path, err := HtlcService.getPath(this, msgData) - sendDataBackToSender(this, msgType, path, err) - case enum.MsgType_Tracker_UpdateHtlcTxState_352: - _ = HtlcService.updateHtlcInfo(this, msgData) - case enum.MsgType_Tracker_UpdateUserInfo_353: - _ = NodeAccountService.updateUsers(this, msgData) - } - } -} - -func sendDataBackToSender(this *ObdNode, msgType enum.MsgType, retData interface{}, err error) { - var data interface{} - status := false - if err != nil { - data = err.Error() - } else { - status = true - data = retData - } - bytes, _ := json.Marshal(data) - this.sendMsgBackToSender(msgType, status, string(bytes)) -} - -func (this *ObdNode) Write() { - defer func() { - e := this.Socket.Close() - if e != nil { - log.Println(e) - } else { - log.Println("socket closed after writing...") - } - }() - - for { - select { - case data, ok := <-this.SendChannel: - if !ok { - _ = this.Socket.WriteMessage(websocket.CloseMessage, []byte{}) - return - } - err := this.Socket.WriteMessage(websocket.TextMessage, data) - if err != nil { - log.Println("fail to send data ", string(data)) - return - } else { - log.Println("send data", string(data)) - } - } - } -} - -func getReplyObj(data string, msgType enum.MsgType, status bool, fromClient, toClient *ObdNode) []byte { - parse := gjson.Parse(data) - result := parse.Value() - if strings.HasPrefix(data, "{") == false && strings.HasPrefix(data, "[") == false { - result = data - } - - jsonMessage, _ := json.Marshal(&bean.ReplyMessage{Type: msgType, Status: status, From: fromClient.Id, To: toClient.Id, Result: result}) - return jsonMessage -} - -type obdNodeManager struct { - Broadcast chan []byte - Connected chan *ObdNode - Disconnected chan *ObdNode - ClientsMap map[*ObdNode]bool - ObdNodeMap map[string]*ObdNode -} - -var ObdNodeManager = obdNodeManager{ - Broadcast: make(chan []byte), - Connected: make(chan *ObdNode), - Disconnected: make(chan *ObdNode), - ClientsMap: make(map[*ObdNode]bool), - ObdNodeMap: make(map[string]*ObdNode), -} - -func (endManager *obdNodeManager) TrackerStart() { - for { - select { - case newConn := <-endManager.Connected: - endManager.ClientsMap[newConn] = true - endManager.ObdNodeMap[newConn.Id] = newConn - newConn.sendMsgBackToSender(enum.MsgType_Tracker_Connect_301, true, cfg.ChainNode_Type) - case currConn := <-endManager.Disconnected: - if _, ok := endManager.ClientsMap[currConn]; ok { - currConn.sendMsgBackToSender(enum.MsgType_Tracker_Connect_301, true, "disconnect from server successfully") - _ = NodeAccountService.logout(currConn) - delete(endManager.ClientsMap, currConn) - delete(endManager.ObdNodeMap, currConn.Id) - close(currConn.SendChannel) - } - case msg := <-endManager.Broadcast: - for conn := range endManager.ClientsMap { - select { - case conn.SendChannel <- msg: - default: - close(conn.SendChannel) - delete(endManager.ClientsMap, conn) - } - } - } - } -} diff --git a/tracker/service/htlc_service.go b/tracker/service/htlc_service.go index 5bdedb618..227856bca 100644 --- a/tracker/service/htlc_service.go +++ b/tracker/service/htlc_service.go @@ -37,7 +37,7 @@ type htlcManager struct { var HtlcService htlcManager -func (manager *htlcManager) getPath(obdClient *ObdNode, msgData string) (path interface{}, err error) { +func (manager *htlcManager) getPath(msgData string) (path interface{}, err error) { manager.mu.Lock() defer manager.mu.Unlock() @@ -102,12 +102,12 @@ func (manager *htlcManager) getPathIndex() int { channelInfo := &dao.ChannelInfo{} err := db.Select(q.Eq("ChannelId", item), q.Eq("CurrState", cbean.ChannelState_CanUse)).First(channelInfo) if err == nil { - if len(channelInfo.ObdNodeIdA) > 0 && sendChannelLockInfoToObd(channelInfo.ChannelId, channelInfo.PeerIdA, channelInfo.ObdNodeIdA) == false { + if len(channelInfo.ObdNodeIdA) > 0 && SendChannelLockInfoToObd(channelInfo.ChannelId, channelInfo.PeerIdA, channelInfo.ObdNodeIdA,false) == false { lockResult = false break } - if len(channelInfo.ObdNodeIdB) > 0 && sendChannelLockInfoToObd(channelInfo.ChannelId, channelInfo.PeerIdB, channelInfo.ObdNodeIdB) == false { + if len(channelInfo.ObdNodeIdB) > 0 && SendChannelLockInfoToObd(channelInfo.ChannelId, channelInfo.PeerIdB, channelInfo.ObdNodeIdB,false) == false { lockResult = false break } @@ -133,7 +133,7 @@ func (manager *htlcManager) getPathIndex() int { return resultIndex } -func (manager *htlcManager) updateHtlcInfo(obdClient *ObdNode, msgData string) (err error) { +func (manager *htlcManager) updateHtlcInfo( msgData string) (err error) { manager.mu.Lock() defer manager.mu.Unlock() @@ -175,11 +175,9 @@ func (manager *htlcManager) updateHtlcInfo(obdClient *ObdNode, msgData string) ( } return nil } - func (manager *htlcManager) GetHtlcCurrState(context *gin.Context) { manager.mu.Lock() defer manager.mu.Unlock() - reqData := &bean.GetHtlcTxStateRequest{} reqData.Path = context.Query("path") if tool.CheckIsString(&reqData.Path) == false { diff --git a/tracker/service/p2p_service.go b/tracker/service/p2p_service.go index 81f8da9cd..421d9c024 100644 --- a/tracker/service/p2p_service.go +++ b/tracker/service/p2p_service.go @@ -1,24 +1,25 @@ package service -import ( +import +( "bufio" "context" "encoding/binary" "encoding/json" "fmt" - "github.com/asdine/storm/q" "github.com/libp2p/go-libp2p" circuit "github.com/libp2p/go-libp2p-circuit" "github.com/libp2p/go-libp2p-core/crypto" "github.com/libp2p/go-libp2p-core/host" "github.com/libp2p/go-libp2p-core/network" "github.com/libp2p/go-libp2p-core/peer" + "github.com/libp2p/go-libp2p-core/protocol" discovery "github.com/libp2p/go-libp2p-discovery" dht "github.com/libp2p/go-libp2p-kad-dht" ma "github.com/multiformats/go-multiaddr" "github.com/omnilaboratory/obd/bean" cfg "github.com/omnilaboratory/obd/tracker/config" - "github.com/omnilaboratory/obd/tracker/dao" + "github.com/omnilaboratory/obd/tracker/tkrpc" "log" "math/rand" "strconv" @@ -263,17 +264,20 @@ func handleChannelStream(stream network.Stream) { _ = stream.Close() } -func sendChannelLockInfoToObd(channelId, userId, obdP2pNodeId string) bool { +func SendChannelLockInfoToObd(channelId, userId, obdP2pNodeId string, isUnlock bool) bool { findID, err := peer.Decode(obdP2pNodeId) if err == nil { findPeer, err := kademliaDHT.FindPeer(ctx, findID) if err == nil { - stream, err := hostNode.NewStream(ctx, findPeer.ID, bean.ProtocolIdForLockChannel) + protoId:=bean.ProtocolIdForLockChannel + if isUnlock { + protoId=bean.ProtocolIdForUnlockChannel + } + stream, err := hostNode.NewStream(ctx, findPeer.ID, protocol.ID( protoId)) if err == nil { rw := bufio.NewReadWriter(bufio.NewReader(stream), bufio.NewWriter(stream)) request := bean.TrackerLockChannelRequest{UserId: userId, ChannelId: channelId} marshal, _ := json.Marshal(request) - _, _ = rw.WriteString(string(marshal) + "~") err = rw.Flush() if err == nil { @@ -299,41 +303,41 @@ func sendChannelLockInfoToObd(channelId, userId, obdP2pNodeId string) bool { return false } +var Orm=cfg.Orm func updateLockChannel() { - var infos []dao.LockHtlcPath + var infos []tkrpc.LockHtlcPath now := time.Now().Add(-20 * time.Second) - _ = db.Select(q.Or(q.Eq("CurrState", 0), q.Eq("CurrState", 1)), q.Lt("CreateAt", now)).Find(&infos) + Orm.Find(&infos,"(curr_state=0 or curr_state=1 ) and created_at = 0; index-- { channelId = paths[index] - err := db.Select(q.Eq("ChannelId", channelId)).First(channelInfo) + channelInfo := &tkrpc.ChannelInfo{} + err:=Orm.First(channelInfo,tkrpc.ChannelInfo{ChannelId:channelId}) if err == nil { - if sendChannelUnlockInfoToObd(channelInfo.ChannelId, channelInfo.PeerIdA, channelInfo.ObdNodeIdA) && - sendChannelUnlockInfoToObd(channelInfo.ChannelId, channelInfo.PeerIdB, channelInfo.ObdNodeIdB) { - channelInfo.CurrState = bean.ChannelState_CanUse - _ = db.Update(channelInfo) + if SendChannelLockInfoToObd(channelInfo.ChannelId, channelInfo.PeerIda, channelInfo.ObdNodeIda,true) && + SendChannelLockInfoToObd(channelInfo.ChannelId, channelInfo.PeerIdb, channelInfo.ObdNodeIdb,true) { + channelInfo.CurrState = tkrpc.ChannelState_CanUse + _ = Orm.Save(channelInfo) } else { notifyObdFinish = false } @@ -341,45 +345,8 @@ func updateLockChannel() { } if notifyObdFinish { item.CurrState = 2 - _ = db.Update(&item) + _ = Orm.Save(&item) } } } -func sendChannelUnlockInfoToObd(channelId, userId, obdP2pNodeId string) bool { - if len(obdP2pNodeId) == 0 { - return false - } - findID, err := peer.Decode(obdP2pNodeId) - if err == nil { - findPeer, err := kademliaDHT.FindPeer(ctx, findID) - if err == nil { - stream, err := hostNode.NewStream(ctx, findPeer.ID, bean.ProtocolIdForUnlockChannel) - if err == nil { - rw := bufio.NewReadWriter(bufio.NewReader(stream), bufio.NewWriter(stream)) - request := bean.TrackerLockChannelRequest{UserId: userId, ChannelId: channelId} - marshal, _ := json.Marshal(request) - - _, _ = rw.WriteString(string(marshal) + "~") - err = rw.Flush() - if err == nil { - str, err := rw.ReadString('~') - if err != nil { - return false - } - if str == "" { - return false - } - if str != "" { - str = strings.TrimSuffix(str, "~") - if str == "1" { - return true - } - } - } - _ = stream.Close() - } - } - } - return false -} diff --git a/tracker/tkrpc/common.go b/tracker/tkrpc/common.go new file mode 100644 index 000000000..b78108f05 --- /dev/null +++ b/tracker/tkrpc/common.go @@ -0,0 +1,58 @@ +package tkrpc + +import ( + "errors" + "strings" +) + +func(list *ListReq) Offset() int{ + res:=int((list.Page-1)*list.Size) + if res==0{ + res=10 + } + return res +} +func(list *ListReq) Limit() int{ + res:=list.Size + if res==0{ + res=1 + } + return int(res) +} +func(list *ListReq) SortStr() string{ + orderstr:="" + for _, item := range strings.Split(list.Sort,",") { + if len(item)==1{ + continue + } + if strings.HasPrefix(item,"-"){ + orderstr+=item[1:]+" desc," + }else{ + orderstr+=item+"," + } + } + orderstr=strings.TrimSuffix(orderstr,",") + return orderstr +} + +func(info *HtlcInfo) ValidteClientData() (err error) { + if info.Path==""{ + return errors.New("miss path") + } + if info.H==""{ + return errors.New("miss h") + } + if info.CurrChannelId==""{ + return errors.New("miss CurrChannelId") + } + return nil +} +func(info *ChannelInfo) ValidteClientData() (err error) { + if info.ChannelId==""{ + return errors.New("miss ChannelId") + } + if info.NodeId==""{ + return errors.New("miss NodeId") + } + return nil +} \ No newline at end of file diff --git a/tracker/tkrpc/gen_protos.sh b/tracker/tkrpc/gen_protos.sh new file mode 100755 index 000000000..f0d6e2b94 --- /dev/null +++ b/tracker/tkrpc/gen_protos.sh @@ -0,0 +1,42 @@ +#!/bin/bash + +set -e + +# generate compiles the *.pb.go stubs from the *.proto files. +function generate() { + echo "Generating root gRPC server protos" + + PROTOS="*.proto " + + # For each of the sub-servers, we then generate their protos, but a restricted + # set as they don't yet require REST proxies, or swagger docs. + for file in $PROTOS; do + DIRECTORY=$(dirname "${file}") + echo "Generating protos from ${file}, into ${DIRECTORY}" + + # Generate the protos. --go-grpc_opt=require_unimplemented_servers=false + protoc -I/usr/local/include -I. \ + --go_out . --go_opt paths=source_relative \ + --go-grpc_out . --go-grpc_opt paths=source_relative \ + "${file}" + + # Generate the REST reverse proxy. + annotationsFile=${file//proto/yaml} + protoc -I/usr/local/include -I. \ + --grpc-gateway_out . \ + --grpc-gateway_opt logtostderr=true \ + --grpc-gateway_opt paths=source_relative \ + --grpc-gateway_opt grpc_api_configuration=${annotationsFile} \ + "${file}" + + # Generate the swagger file which describes the REST API in detail. + protoc -I/usr/local/include -I. \ + --openapiv2_out ./swagger/ \ + --openapiv2_opt logtostderr=true \ + --openapiv2_opt grpc_api_configuration=${annotationsFile} \ + --openapiv2_opt json_names_for_fields=false \ + --openapiv2_opt enums_as_ints=true \ + "${file}" + done +} +generate diff --git a/tracker/tkrpc/info-tracker.pb.go b/tracker/tkrpc/info-tracker.pb.go new file mode 100644 index 000000000..57301a5be --- /dev/null +++ b/tracker/tkrpc/info-tracker.pb.go @@ -0,0 +1,1971 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.1 +// protoc v3.6.1 +// source: info-tracker.proto + +package tkrpc + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type ChannelState int32 + +const ( + ChannelState_unknown ChannelState = 0 + ChannelState_Create ChannelState = 10 + ChannelState_WaitFundAsset ChannelState = 11 + ChannelState_NewTx ChannelState = 12 + ChannelState_CanUse ChannelState = 20 + ChannelState_Close ChannelState = 21 + ChannelState_HtlcTx ChannelState = 22 + ChannelState_LockByTracker ChannelState = 23 + ChannelState_OpenChannelRefuse ChannelState = 30 +) + +// Enum value maps for ChannelState. +var ( + ChannelState_name = map[int32]string{ + 0: "unknown", + 10: "Create", + 11: "WaitFundAsset", + 12: "NewTx", + 20: "CanUse", + 21: "Close", + 22: "HtlcTx", + 23: "LockByTracker", + 30: "OpenChannelRefuse", + } + ChannelState_value = map[string]int32{ + "unknown": 0, + "Create": 10, + "WaitFundAsset": 11, + "NewTx": 12, + "CanUse": 20, + "Close": 21, + "HtlcTx": 22, + "LockByTracker": 23, + "OpenChannelRefuse": 30, + } +) + +func (x ChannelState) Enum() *ChannelState { + p := new(ChannelState) + *p = x + return p +} + +func (x ChannelState) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ChannelState) Descriptor() protoreflect.EnumDescriptor { + return file_info_tracker_proto_enumTypes[0].Descriptor() +} + +func (ChannelState) Type() protoreflect.EnumType { + return &file_info_tracker_proto_enumTypes[0] +} + +func (x ChannelState) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ChannelState.Descriptor instead. +func (ChannelState) EnumDescriptor() ([]byte, []int) { + return file_info_tracker_proto_rawDescGZIP(), []int{0} +} + +type HtlcGetPathReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PayerObdNodeId string `protobuf:"bytes,1,opt,name=payer_obd_node_id,json=payerObdNodeId,proto3" json:"payer_obd_node_id,omitempty"` + RealPayerPeerId string `protobuf:"bytes,2,opt,name=real_payer_peer_id,json=realPayerPeerId,proto3" json:"real_payer_peer_id,omitempty"` + PayeePeerId string `protobuf:"bytes,3,opt,name=payee_peer_id,json=payeePeerId,proto3" json:"payee_peer_id,omitempty"` + PropertyId int64 `protobuf:"varint,4,opt,name=property_id,json=propertyId,proto3" json:"property_id,omitempty"` + H string `protobuf:"bytes,5,opt,name=h,proto3" json:"h,omitempty"` + Amount float64 `protobuf:"fixed64,6,opt,name=amount,proto3" json:"amount,omitempty"` +} + +func (x *HtlcGetPathReq) Reset() { + *x = HtlcGetPathReq{} + if protoimpl.UnsafeEnabled { + mi := &file_info_tracker_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HtlcGetPathReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HtlcGetPathReq) ProtoMessage() {} + +func (x *HtlcGetPathReq) ProtoReflect() protoreflect.Message { + mi := &file_info_tracker_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 HtlcGetPathReq.ProtoReflect.Descriptor instead. +func (*HtlcGetPathReq) Descriptor() ([]byte, []int) { + return file_info_tracker_proto_rawDescGZIP(), []int{0} +} + +func (x *HtlcGetPathReq) GetPayerObdNodeId() string { + if x != nil { + return x.PayerObdNodeId + } + return "" +} + +func (x *HtlcGetPathReq) GetRealPayerPeerId() string { + if x != nil { + return x.RealPayerPeerId + } + return "" +} + +func (x *HtlcGetPathReq) GetPayeePeerId() string { + if x != nil { + return x.PayeePeerId + } + return "" +} + +func (x *HtlcGetPathReq) GetPropertyId() int64 { + if x != nil { + return x.PropertyId + } + return 0 +} + +func (x *HtlcGetPathReq) GetH() string { + if x != nil { + return x.H + } + return "" +} + +func (x *HtlcGetPathReq) GetAmount() float64 { + if x != nil { + return x.Amount + } + return 0 +} + +type HtlcGetPathRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + SenderPeerId string `protobuf:"bytes,1,opt,name=senderPeerId,proto3" json:"senderPeerId,omitempty"` + H string `protobuf:"bytes,2,opt,name=h,proto3" json:"h,omitempty"` + Amount float64 `protobuf:"fixed64,3,opt,name=amount,proto3" json:"amount,omitempty"` + Path string `protobuf:"bytes,4,opt,name=path,proto3" json:"path,omitempty"` +} + +func (x *HtlcGetPathRes) Reset() { + *x = HtlcGetPathRes{} + if protoimpl.UnsafeEnabled { + mi := &file_info_tracker_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HtlcGetPathRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HtlcGetPathRes) ProtoMessage() {} + +func (x *HtlcGetPathRes) ProtoReflect() protoreflect.Message { + mi := &file_info_tracker_proto_msgTypes[1] + 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 HtlcGetPathRes.ProtoReflect.Descriptor instead. +func (*HtlcGetPathRes) Descriptor() ([]byte, []int) { + return file_info_tracker_proto_rawDescGZIP(), []int{1} +} + +func (x *HtlcGetPathRes) GetSenderPeerId() string { + if x != nil { + return x.SenderPeerId + } + return "" +} + +func (x *HtlcGetPathRes) GetH() string { + if x != nil { + return x.H + } + return "" +} + +func (x *HtlcGetPathRes) GetAmount() float64 { + if x != nil { + return x.Amount + } + return 0 +} + +func (x *HtlcGetPathRes) GetPath() string { + if x != nil { + return x.Path + } + return "" +} + +type GetHtlcInfoReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + H string `protobuf:"bytes,2,opt,name=h,proto3" json:"h,omitempty"` + Path string `protobuf:"bytes,4,opt,name=path,proto3" json:"path,omitempty"` +} + +func (x *GetHtlcInfoReq) Reset() { + *x = GetHtlcInfoReq{} + if protoimpl.UnsafeEnabled { + mi := &file_info_tracker_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetHtlcInfoReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetHtlcInfoReq) ProtoMessage() {} + +func (x *GetHtlcInfoReq) ProtoReflect() protoreflect.Message { + mi := &file_info_tracker_proto_msgTypes[2] + 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 GetHtlcInfoReq.ProtoReflect.Descriptor instead. +func (*GetHtlcInfoReq) Descriptor() ([]byte, []int) { + return file_info_tracker_proto_rawDescGZIP(), []int{2} +} + +func (x *GetHtlcInfoReq) GetH() string { + if x != nil { + return x.H + } + return "" +} + +func (x *GetHtlcInfoReq) GetPath() string { + if x != nil { + return x.Path + } + return "" +} + +type SimpleFilter struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + ChannelId string `protobuf:"bytes,2,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` + UserId string `protobuf:"bytes,3,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` +} + +func (x *SimpleFilter) Reset() { + *x = SimpleFilter{} + if protoimpl.UnsafeEnabled { + mi := &file_info_tracker_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SimpleFilter) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SimpleFilter) ProtoMessage() {} + +func (x *SimpleFilter) ProtoReflect() protoreflect.Message { + mi := &file_info_tracker_proto_msgTypes[3] + 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 SimpleFilter.ProtoReflect.Descriptor instead. +func (*SimpleFilter) Descriptor() ([]byte, []int) { + return file_info_tracker_proto_rawDescGZIP(), []int{3} +} + +func (x *SimpleFilter) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *SimpleFilter) GetChannelId() string { + if x != nil { + return x.ChannelId + } + return "" +} + +func (x *SimpleFilter) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +//Empty response +type EmptyRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *EmptyRes) Reset() { + *x = EmptyRes{} + if protoimpl.UnsafeEnabled { + mi := &file_info_tracker_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EmptyRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EmptyRes) ProtoMessage() {} + +func (x *EmptyRes) ProtoReflect() protoreflect.Message { + mi := &file_info_tracker_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 EmptyRes.ProtoReflect.Descriptor instead. +func (*EmptyRes) Descriptor() ([]byte, []int) { + return file_info_tracker_proto_rawDescGZIP(), []int{4} +} + +type UpdateNodeInfoReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + NodeId string `protobuf:"bytes,2,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` + P2PAddress string `protobuf:"bytes,3,opt,name=p2p_address,json=p2pAddress,proto3" json:"p2p_address,omitempty"` + // 1 online 2 offline + IsOnline int32 `protobuf:"varint,5,opt,name=is_online,json=isOnline,proto3" json:"is_online,omitempty"` +} + +func (x *UpdateNodeInfoReq) Reset() { + *x = UpdateNodeInfoReq{} + if protoimpl.UnsafeEnabled { + mi := &file_info_tracker_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateNodeInfoReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateNodeInfoReq) ProtoMessage() {} + +func (x *UpdateNodeInfoReq) ProtoReflect() protoreflect.Message { + mi := &file_info_tracker_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 UpdateNodeInfoReq.ProtoReflect.Descriptor instead. +func (*UpdateNodeInfoReq) Descriptor() ([]byte, []int) { + return file_info_tracker_proto_rawDescGZIP(), []int{5} +} + +func (x *UpdateNodeInfoReq) GetNodeId() string { + if x != nil { + return x.NodeId + } + return "" +} + +func (x *UpdateNodeInfoReq) GetP2PAddress() string { + if x != nil { + return x.P2PAddress + } + return "" +} + +func (x *UpdateNodeInfoReq) GetIsOnline() int32 { + if x != nil { + return x.IsOnline + } + return 0 +} + +//obd-node info +type NodeInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + //node_peer_id + NodeId string `protobuf:"bytes,2,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` + P2PAddress string `protobuf:"bytes,3,opt,name=p2p_address,json=p2pAddress,proto3" json:"p2p_address,omitempty"` + AccessIp string `protobuf:"bytes,4,opt,name=access_ip,json=accessIp,proto3" json:"access_ip,omitempty"` + // 1 online 2 offline + IsOnline int32 `protobuf:"varint,5,opt,name=is_online,json=isOnline,proto3" json:"is_online,omitempty"` + HearBeatCounter int32 `protobuf:"varint,6,opt,name=hear_beat_counter,json=hearBeatCounter,proto3" json:"hear_beat_counter,omitempty"` + LastHearBeat int64 `protobuf:"varint,7,opt,name=last_hear_beat,json=lastHearBeat,proto3" json:"last_hear_beat,omitempty"` + //unix timestamp in seconds ; google.protobuf.Timestamp will more better,but sql database not support. + UpdatedAt int64 `protobuf:"varint,8,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` + CreatedAt int64 `protobuf:"varint,9,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` +} + +func (x *NodeInfo) Reset() { + *x = NodeInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_info_tracker_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NodeInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NodeInfo) ProtoMessage() {} + +func (x *NodeInfo) ProtoReflect() protoreflect.Message { + mi := &file_info_tracker_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 NodeInfo.ProtoReflect.Descriptor instead. +func (*NodeInfo) Descriptor() ([]byte, []int) { + return file_info_tracker_proto_rawDescGZIP(), []int{6} +} + +func (x *NodeInfo) GetId() int32 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *NodeInfo) GetNodeId() string { + if x != nil { + return x.NodeId + } + return "" +} + +func (x *NodeInfo) GetP2PAddress() string { + if x != nil { + return x.P2PAddress + } + return "" +} + +func (x *NodeInfo) GetAccessIp() string { + if x != nil { + return x.AccessIp + } + return "" +} + +func (x *NodeInfo) GetIsOnline() int32 { + if x != nil { + return x.IsOnline + } + return 0 +} + +func (x *NodeInfo) GetHearBeatCounter() int32 { + if x != nil { + return x.HearBeatCounter + } + return 0 +} + +func (x *NodeInfo) GetLastHearBeat() int64 { + if x != nil { + return x.LastHearBeat + } + return 0 +} + +func (x *NodeInfo) GetUpdatedAt() int64 { + if x != nil { + return x.UpdatedAt + } + return 0 +} + +func (x *NodeInfo) GetCreatedAt() int64 { + if x != nil { + return x.CreatedAt + } + return 0 +} + +//obd-user-info +type UserInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + //user_peer_id + UserId string `protobuf:"bytes,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + //node_peer_id + NodeId string `protobuf:"bytes,3,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` + // 1 online 2 offline + IsOnline int32 `protobuf:"varint,4,opt,name=is_online,json=isOnline,proto3" json:"is_online,omitempty"` + AccessIp string `protobuf:"bytes,5,opt,name=access_ip,json=accessIp,proto3" json:"access_ip,omitempty"` + UpdatedAt int64 `protobuf:"varint,6,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` + CreatedAt int64 `protobuf:"varint,7,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` +} + +func (x *UserInfo) Reset() { + *x = UserInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_info_tracker_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UserInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UserInfo) ProtoMessage() {} + +func (x *UserInfo) ProtoReflect() protoreflect.Message { + mi := &file_info_tracker_proto_msgTypes[7] + 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 UserInfo.ProtoReflect.Descriptor instead. +func (*UserInfo) Descriptor() ([]byte, []int) { + return file_info_tracker_proto_rawDescGZIP(), []int{7} +} + +func (x *UserInfo) GetId() int32 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *UserInfo) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *UserInfo) GetNodeId() string { + if x != nil { + return x.NodeId + } + return "" +} + +func (x *UserInfo) GetIsOnline() int32 { + if x != nil { + return x.IsOnline + } + return 0 +} + +func (x *UserInfo) GetAccessIp() string { + if x != nil { + return x.AccessIp + } + return "" +} + +func (x *UserInfo) GetUpdatedAt() int64 { + if x != nil { + return x.UpdatedAt + } + return 0 +} + +func (x *UserInfo) GetCreatedAt() int64 { + if x != nil { + return x.CreatedAt + } + return 0 +} + +type UpdateUserInfoReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + NodeId string `protobuf:"bytes,2,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` + P2PAddress string `protobuf:"bytes,3,opt,name=p2p_address,json=p2pAddress,proto3" json:"p2p_address,omitempty"` + // 1 online 2 offline + IsOnline int32 `protobuf:"varint,4,opt,name=is_online,json=isOnline,proto3" json:"is_online,omitempty"` +} + +func (x *UpdateUserInfoReq) Reset() { + *x = UpdateUserInfoReq{} + if protoimpl.UnsafeEnabled { + mi := &file_info_tracker_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateUserInfoReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateUserInfoReq) ProtoMessage() {} + +func (x *UpdateUserInfoReq) ProtoReflect() protoreflect.Message { + mi := &file_info_tracker_proto_msgTypes[8] + 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 UpdateUserInfoReq.ProtoReflect.Descriptor instead. +func (*UpdateUserInfoReq) Descriptor() ([]byte, []int) { + return file_info_tracker_proto_rawDescGZIP(), []int{8} +} + +func (x *UpdateUserInfoReq) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *UpdateUserInfoReq) GetNodeId() string { + if x != nil { + return x.NodeId + } + return "" +} + +func (x *UpdateUserInfoReq) GetP2PAddress() string { + if x != nil { + return x.P2PAddress + } + return "" +} + +func (x *UpdateUserInfoReq) GetIsOnline() int32 { + if x != nil { + return x.IsOnline + } + return 0 +} + +type UpdateUserInfosReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UpdateUserInfoReqs []*UpdateUserInfoReq `protobuf:"bytes,1,rep,name=UpdateUserInfoReqs,proto3" json:"UpdateUserInfoReqs,omitempty"` +} + +func (x *UpdateUserInfosReq) Reset() { + *x = UpdateUserInfosReq{} + if protoimpl.UnsafeEnabled { + mi := &file_info_tracker_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateUserInfosReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateUserInfosReq) ProtoMessage() {} + +func (x *UpdateUserInfosReq) ProtoReflect() protoreflect.Message { + mi := &file_info_tracker_proto_msgTypes[9] + 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 UpdateUserInfosReq.ProtoReflect.Descriptor instead. +func (*UpdateUserInfosReq) Descriptor() ([]byte, []int) { + return file_info_tracker_proto_rawDescGZIP(), []int{9} +} + +func (x *UpdateUserInfosReq) GetUpdateUserInfoReqs() []*UpdateUserInfoReq { + if x != nil { + return x.UpdateUserInfoReqs + } + return nil +} + +type UpdateChannelInfosReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ChannelInfos []*ChannelInfo `protobuf:"bytes,1,rep,name=ChannelInfos,proto3" json:"ChannelInfos,omitempty"` +} + +func (x *UpdateChannelInfosReq) Reset() { + *x = UpdateChannelInfosReq{} + if protoimpl.UnsafeEnabled { + mi := &file_info_tracker_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateChannelInfosReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateChannelInfosReq) ProtoMessage() {} + +func (x *UpdateChannelInfosReq) ProtoReflect() protoreflect.Message { + mi := &file_info_tracker_proto_msgTypes[10] + 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 UpdateChannelInfosReq.ProtoReflect.Descriptor instead. +func (*UpdateChannelInfosReq) Descriptor() ([]byte, []int) { + return file_info_tracker_proto_rawDescGZIP(), []int{10} +} + +func (x *UpdateChannelInfosReq) GetChannelInfos() []*ChannelInfo { + if x != nil { + return x.ChannelInfos + } + return nil +} + +type ChannelInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + ObdNodeIda string `protobuf:"bytes,2,opt,name=obd_node_ida,json=obdNodeIda,proto3" json:"obd_node_ida,omitempty"` + ObdNodeIdb string `protobuf:"bytes,3,opt,name=obd_node_idb,json=obdNodeIdb,proto3" json:"obd_node_idb,omitempty"` + ChannelId string `protobuf:"bytes,4,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` + PropertyId int64 `protobuf:"varint,5,opt,name=property_id,json=propertyId,proto3" json:"property_id,omitempty"` + CurrState ChannelState `protobuf:"varint,6,opt,name=curr_state,json=currState,proto3,enum=tkrpc.ChannelState" json:"curr_state,omitempty"` + PeerIda string `protobuf:"bytes,7,opt,name=peer_ida,json=peerIda,proto3" json:"peer_ida,omitempty"` + PeerIdb string `protobuf:"bytes,8,opt,name=peer_idb,json=peerIdb,proto3" json:"peer_idb,omitempty"` + AmountA float64 `protobuf:"fixed64,9,opt,name=amount_a,json=amountA,proto3" json:"amount_a,omitempty"` + AmountB float64 `protobuf:"fixed64,10,opt,name=amount_b,json=amountB,proto3" json:"amount_b,omitempty"` + UpdatedAt int64 `protobuf:"varint,11,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` + CreatedAt int64 `protobuf:"varint,12,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + //database will not store it + IsAlice bool `protobuf:"varint,13,opt,name=is_alice,json=isAlice,proto3" json:"is_alice,omitempty"` + //database will not store it + NodeId string `protobuf:"bytes,14,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` +} + +func (x *ChannelInfo) Reset() { + *x = ChannelInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_info_tracker_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChannelInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChannelInfo) ProtoMessage() {} + +func (x *ChannelInfo) ProtoReflect() protoreflect.Message { + mi := &file_info_tracker_proto_msgTypes[11] + 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 ChannelInfo.ProtoReflect.Descriptor instead. +func (*ChannelInfo) Descriptor() ([]byte, []int) { + return file_info_tracker_proto_rawDescGZIP(), []int{11} +} + +func (x *ChannelInfo) GetId() int32 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *ChannelInfo) GetObdNodeIda() string { + if x != nil { + return x.ObdNodeIda + } + return "" +} + +func (x *ChannelInfo) GetObdNodeIdb() string { + if x != nil { + return x.ObdNodeIdb + } + return "" +} + +func (x *ChannelInfo) GetChannelId() string { + if x != nil { + return x.ChannelId + } + return "" +} + +func (x *ChannelInfo) GetPropertyId() int64 { + if x != nil { + return x.PropertyId + } + return 0 +} + +func (x *ChannelInfo) GetCurrState() ChannelState { + if x != nil { + return x.CurrState + } + return ChannelState_unknown +} + +func (x *ChannelInfo) GetPeerIda() string { + if x != nil { + return x.PeerIda + } + return "" +} + +func (x *ChannelInfo) GetPeerIdb() string { + if x != nil { + return x.PeerIdb + } + return "" +} + +func (x *ChannelInfo) GetAmountA() float64 { + if x != nil { + return x.AmountA + } + return 0 +} + +func (x *ChannelInfo) GetAmountB() float64 { + if x != nil { + return x.AmountB + } + return 0 +} + +func (x *ChannelInfo) GetUpdatedAt() int64 { + if x != nil { + return x.UpdatedAt + } + return 0 +} + +func (x *ChannelInfo) GetCreatedAt() int64 { + if x != nil { + return x.CreatedAt + } + return 0 +} + +func (x *ChannelInfo) GetIsAlice() bool { + if x != nil { + return x.IsAlice + } + return false +} + +func (x *ChannelInfo) GetNodeId() string { + if x != nil { + return x.NodeId + } + return "" +} + +type ListReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + //page number + Page int32 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"` + //page size + Size int32 `protobuf:"varint,2,opt,name=size,proto3" json:"size,omitempty"` + //sort set the sql order-by sort=[-]field_name . example sort=-updated_at will sort by:"desc id";sort=updated_at sort by:"asc id" + Sort string `protobuf:"bytes,3,opt,name=sort,proto3" json:"sort,omitempty"` + UserId string `protobuf:"bytes,4,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` +} + +func (x *ListReq) Reset() { + *x = ListReq{} + if protoimpl.UnsafeEnabled { + mi := &file_info_tracker_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListReq) ProtoMessage() {} + +func (x *ListReq) ProtoReflect() protoreflect.Message { + mi := &file_info_tracker_proto_msgTypes[12] + 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 ListReq.ProtoReflect.Descriptor instead. +func (*ListReq) Descriptor() ([]byte, []int) { + return file_info_tracker_proto_rawDescGZIP(), []int{12} +} + +func (x *ListReq) GetPage() int32 { + if x != nil { + return x.Page + } + return 0 +} + +func (x *ListReq) GetSize() int32 { + if x != nil { + return x.Size + } + return 0 +} + +func (x *ListReq) GetSort() string { + if x != nil { + return x.Sort + } + return "" +} + +func (x *ListReq) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +type UserInfosRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Count int64 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` + Results []*UserInfo `protobuf:"bytes,2,rep,name=results,proto3" json:"results,omitempty"` +} + +func (x *UserInfosRes) Reset() { + *x = UserInfosRes{} + if protoimpl.UnsafeEnabled { + mi := &file_info_tracker_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UserInfosRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UserInfosRes) ProtoMessage() {} + +func (x *UserInfosRes) ProtoReflect() protoreflect.Message { + mi := &file_info_tracker_proto_msgTypes[13] + 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 UserInfosRes.ProtoReflect.Descriptor instead. +func (*UserInfosRes) Descriptor() ([]byte, []int) { + return file_info_tracker_proto_rawDescGZIP(), []int{13} +} + +func (x *UserInfosRes) GetCount() int64 { + if x != nil { + return x.Count + } + return 0 +} + +func (x *UserInfosRes) GetResults() []*UserInfo { + if x != nil { + return x.Results + } + return nil +} + +type NodeInfosRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Count int64 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` + Results []*NodeInfo `protobuf:"bytes,2,rep,name=results,proto3" json:"results,omitempty"` +} + +func (x *NodeInfosRes) Reset() { + *x = NodeInfosRes{} + if protoimpl.UnsafeEnabled { + mi := &file_info_tracker_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NodeInfosRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NodeInfosRes) ProtoMessage() {} + +func (x *NodeInfosRes) ProtoReflect() protoreflect.Message { + mi := &file_info_tracker_proto_msgTypes[14] + 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 NodeInfosRes.ProtoReflect.Descriptor instead. +func (*NodeInfosRes) Descriptor() ([]byte, []int) { + return file_info_tracker_proto_rawDescGZIP(), []int{14} +} + +func (x *NodeInfosRes) GetCount() int64 { + if x != nil { + return x.Count + } + return 0 +} + +func (x *NodeInfosRes) GetResults() []*NodeInfo { + if x != nil { + return x.Results + } + return nil +} + +type ChannelInfosRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Count int64 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` + Results []*ChannelInfo `protobuf:"bytes,2,rep,name=results,proto3" json:"results,omitempty"` +} + +func (x *ChannelInfosRes) Reset() { + *x = ChannelInfosRes{} + if protoimpl.UnsafeEnabled { + mi := &file_info_tracker_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChannelInfosRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChannelInfosRes) ProtoMessage() {} + +func (x *ChannelInfosRes) ProtoReflect() protoreflect.Message { + mi := &file_info_tracker_proto_msgTypes[15] + 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 ChannelInfosRes.ProtoReflect.Descriptor instead. +func (*ChannelInfosRes) Descriptor() ([]byte, []int) { + return file_info_tracker_proto_rawDescGZIP(), []int{15} +} + +func (x *ChannelInfosRes) GetCount() int64 { + if x != nil { + return x.Count + } + return 0 +} + +func (x *ChannelInfosRes) GetResults() []*ChannelInfo { + if x != nil { + return x.Results + } + return nil +} + +type HtlcInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"` + H string `protobuf:"bytes,3,opt,name=h,proto3" json:"h,omitempty"` + R string `protobuf:"bytes,4,opt,name=r,proto3" json:"r,omitempty"` + DirectionFlag int32 `protobuf:"varint,5,opt,name=direction_flag,json=directionFlag,proto3" json:"direction_flag,omitempty"` + CurrChannelId string `protobuf:"bytes,6,opt,name=curr_channel_id,json=currChannelId,proto3" json:"curr_channel_id,omitempty"` + UpdatedAt int64 `protobuf:"varint,7,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` + CreatedAt int64 `protobuf:"varint,8,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` +} + +func (x *HtlcInfo) Reset() { + *x = HtlcInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_info_tracker_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HtlcInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HtlcInfo) ProtoMessage() {} + +func (x *HtlcInfo) ProtoReflect() protoreflect.Message { + mi := &file_info_tracker_proto_msgTypes[16] + 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 HtlcInfo.ProtoReflect.Descriptor instead. +func (*HtlcInfo) Descriptor() ([]byte, []int) { + return file_info_tracker_proto_rawDescGZIP(), []int{16} +} + +func (x *HtlcInfo) GetId() int32 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *HtlcInfo) GetPath() string { + if x != nil { + return x.Path + } + return "" +} + +func (x *HtlcInfo) GetH() string { + if x != nil { + return x.H + } + return "" +} + +func (x *HtlcInfo) GetR() string { + if x != nil { + return x.R + } + return "" +} + +func (x *HtlcInfo) GetDirectionFlag() int32 { + if x != nil { + return x.DirectionFlag + } + return 0 +} + +func (x *HtlcInfo) GetCurrChannelId() string { + if x != nil { + return x.CurrChannelId + } + return "" +} + +func (x *HtlcInfo) GetUpdatedAt() int64 { + if x != nil { + return x.UpdatedAt + } + return 0 +} + +func (x *HtlcInfo) GetCreatedAt() int64 { + if x != nil { + return x.CreatedAt + } + return 0 +} + +type LockHtlcPath struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"` + // 0 创建,1,标记作废,2 标记通知完成 + CurrState int32 `protobuf:"varint,3,opt,name=curr_state,json=currState,proto3" json:"curr_state,omitempty"` + CreatedAt int64 `protobuf:"varint,8,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + UpdatedAt int64 `protobuf:"varint,7,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` +} + +func (x *LockHtlcPath) Reset() { + *x = LockHtlcPath{} + if protoimpl.UnsafeEnabled { + mi := &file_info_tracker_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LockHtlcPath) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LockHtlcPath) ProtoMessage() {} + +func (x *LockHtlcPath) ProtoReflect() protoreflect.Message { + mi := &file_info_tracker_proto_msgTypes[17] + 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 LockHtlcPath.ProtoReflect.Descriptor instead. +func (*LockHtlcPath) Descriptor() ([]byte, []int) { + return file_info_tracker_proto_rawDescGZIP(), []int{17} +} + +func (x *LockHtlcPath) GetId() int32 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *LockHtlcPath) GetPath() string { + if x != nil { + return x.Path + } + return "" +} + +func (x *LockHtlcPath) GetCurrState() int32 { + if x != nil { + return x.CurrState + } + return 0 +} + +func (x *LockHtlcPath) GetCreatedAt() int64 { + if x != nil { + return x.CreatedAt + } + return 0 +} + +func (x *LockHtlcPath) GetUpdatedAt() int64 { + if x != nil { + return x.UpdatedAt + } + return 0 +} + +var File_info_tracker_proto protoreflect.FileDescriptor + +var file_info_tracker_proto_rawDesc = []byte{ + 0x0a, 0x12, 0x69, 0x6e, 0x66, 0x6f, 0x2d, 0x74, 0x72, 0x61, 0x63, 0x6b, 0x65, 0x72, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x05, 0x74, 0x6b, 0x72, 0x70, 0x63, 0x22, 0xd3, 0x01, 0x0a, 0x0e, + 0x48, 0x74, 0x6c, 0x63, 0x47, 0x65, 0x74, 0x50, 0x61, 0x74, 0x68, 0x52, 0x65, 0x71, 0x12, 0x29, + 0x0a, 0x11, 0x70, 0x61, 0x79, 0x65, 0x72, 0x5f, 0x6f, 0x62, 0x64, 0x5f, 0x6e, 0x6f, 0x64, 0x65, + 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x70, 0x61, 0x79, 0x65, 0x72, + 0x4f, 0x62, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x12, 0x2b, 0x0a, 0x12, 0x72, 0x65, 0x61, + 0x6c, 0x5f, 0x70, 0x61, 0x79, 0x65, 0x72, 0x5f, 0x70, 0x65, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x72, 0x65, 0x61, 0x6c, 0x50, 0x61, 0x79, 0x65, 0x72, + 0x50, 0x65, 0x65, 0x72, 0x49, 0x64, 0x12, 0x22, 0x0a, 0x0d, 0x70, 0x61, 0x79, 0x65, 0x65, 0x5f, + 0x70, 0x65, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, + 0x61, 0x79, 0x65, 0x65, 0x50, 0x65, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x72, + 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x49, 0x64, 0x12, 0x0c, 0x0a, 0x01, 0x68, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x01, 0x68, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, + 0x75, 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x01, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, + 0x74, 0x22, 0x6e, 0x0a, 0x0e, 0x48, 0x74, 0x6c, 0x63, 0x47, 0x65, 0x74, 0x50, 0x61, 0x74, 0x68, + 0x52, 0x65, 0x73, 0x12, 0x22, 0x0a, 0x0c, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x50, 0x65, 0x65, + 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x73, 0x65, 0x6e, 0x64, 0x65, + 0x72, 0x50, 0x65, 0x65, 0x72, 0x49, 0x64, 0x12, 0x0c, 0x0a, 0x01, 0x68, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x01, 0x68, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x01, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x12, 0x0a, + 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, + 0x68, 0x22, 0x32, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x48, 0x74, 0x6c, 0x63, 0x49, 0x6e, 0x66, 0x6f, + 0x52, 0x65, 0x71, 0x12, 0x0c, 0x0a, 0x01, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x01, + 0x68, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x70, 0x61, 0x74, 0x68, 0x22, 0x56, 0x0a, 0x0c, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x46, + 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, + 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x68, 0x61, 0x6e, 0x6e, + 0x65, 0x6c, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0x0a, 0x0a, + 0x08, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x65, 0x73, 0x22, 0x6a, 0x0a, 0x11, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x12, 0x17, + 0x0a, 0x07, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x32, 0x70, 0x5f, 0x61, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x32, + 0x70, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x69, 0x73, 0x5f, 0x6f, + 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x69, 0x73, 0x4f, + 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x22, 0x9e, 0x02, 0x0a, 0x08, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, + 0x66, 0x6f, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, + 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x70, + 0x32, 0x70, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0a, 0x70, 0x32, 0x70, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1b, 0x0a, 0x09, + 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x69, 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x49, 0x70, 0x12, 0x1b, 0x0a, 0x09, 0x69, 0x73, 0x5f, + 0x6f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x69, 0x73, + 0x4f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x12, 0x2a, 0x0a, 0x11, 0x68, 0x65, 0x61, 0x72, 0x5f, 0x62, + 0x65, 0x61, 0x74, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x0f, 0x68, 0x65, 0x61, 0x72, 0x42, 0x65, 0x61, 0x74, 0x43, 0x6f, 0x75, 0x6e, 0x74, + 0x65, 0x72, 0x12, 0x24, 0x0a, 0x0e, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x68, 0x65, 0x61, 0x72, 0x5f, + 0x62, 0x65, 0x61, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x6c, 0x61, 0x73, 0x74, + 0x48, 0x65, 0x61, 0x72, 0x42, 0x65, 0x61, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x75, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x22, 0xc4, 0x01, 0x0a, 0x08, 0x55, 0x73, 0x65, 0x72, 0x49, + 0x6e, 0x66, 0x6f, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x02, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, + 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6e, + 0x6f, 0x64, 0x65, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x69, 0x73, 0x5f, 0x6f, 0x6e, 0x6c, 0x69, + 0x6e, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x69, 0x73, 0x4f, 0x6e, 0x6c, 0x69, + 0x6e, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x69, 0x70, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x49, 0x70, 0x12, + 0x1d, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x1d, + 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x07, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x22, 0x83, 0x01, + 0x0a, 0x11, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, + 0x52, 0x65, 0x71, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, + 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6e, + 0x6f, 0x64, 0x65, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x32, 0x70, 0x5f, 0x61, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x32, 0x70, 0x41, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x69, 0x73, 0x5f, 0x6f, 0x6e, 0x6c, + 0x69, 0x6e, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x69, 0x73, 0x4f, 0x6e, 0x6c, + 0x69, 0x6e, 0x65, 0x22, 0x5e, 0x0a, 0x12, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, + 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x73, 0x52, 0x65, 0x71, 0x12, 0x48, 0x0a, 0x12, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x74, 0x6b, 0x72, 0x70, 0x63, 0x2e, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x52, + 0x12, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, + 0x65, 0x71, 0x73, 0x22, 0x4f, 0x0a, 0x15, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, + 0x6e, 0x6e, 0x65, 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x73, 0x52, 0x65, 0x71, 0x12, 0x36, 0x0a, 0x0c, + 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x74, 0x6b, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x6e, + 0x65, 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0c, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x49, + 0x6e, 0x66, 0x6f, 0x73, 0x22, 0xb3, 0x03, 0x0a, 0x0b, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, + 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x02, 0x69, 0x64, 0x12, 0x20, 0x0a, 0x0c, 0x6f, 0x62, 0x64, 0x5f, 0x6e, 0x6f, 0x64, 0x65, + 0x5f, 0x69, 0x64, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6f, 0x62, 0x64, 0x4e, + 0x6f, 0x64, 0x65, 0x49, 0x64, 0x61, 0x12, 0x20, 0x0a, 0x0c, 0x6f, 0x62, 0x64, 0x5f, 0x6e, 0x6f, + 0x64, 0x65, 0x5f, 0x69, 0x64, 0x62, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6f, 0x62, + 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x62, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x68, 0x61, 0x6e, + 0x6e, 0x65, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x68, + 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x70, 0x65, + 0x72, 0x74, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x70, 0x72, + 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x49, 0x64, 0x12, 0x32, 0x0a, 0x0a, 0x63, 0x75, 0x72, 0x72, + 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x13, 0x2e, 0x74, + 0x6b, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x53, 0x74, 0x61, 0x74, + 0x65, 0x52, 0x09, 0x63, 0x75, 0x72, 0x72, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x19, 0x0a, 0x08, + 0x70, 0x65, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x61, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, + 0x70, 0x65, 0x65, 0x72, 0x49, 0x64, 0x61, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x65, 0x65, 0x72, 0x5f, + 0x69, 0x64, 0x62, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x65, 0x65, 0x72, 0x49, + 0x64, 0x62, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x61, 0x18, 0x09, + 0x20, 0x01, 0x28, 0x01, 0x52, 0x07, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x12, 0x19, 0x0a, + 0x08, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x62, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x01, 0x52, + 0x07, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x12, 0x1d, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x75, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x69, 0x73, 0x5f, 0x61, 0x6c, 0x69, + 0x63, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x69, 0x73, 0x41, 0x6c, 0x69, 0x63, + 0x65, 0x12, 0x17, 0x0a, 0x07, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x0e, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x22, 0x5e, 0x0a, 0x07, 0x4c, 0x69, + 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x12, 0x0a, + 0x04, 0x73, 0x6f, 0x72, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x6f, 0x72, + 0x74, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0x4f, 0x0a, 0x0c, 0x55, 0x73, + 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x73, 0x52, 0x65, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x12, 0x29, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x0f, 0x2e, 0x74, 0x6b, 0x72, 0x70, 0x63, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, + 0x66, 0x6f, 0x52, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x22, 0x4f, 0x0a, 0x0c, 0x4e, + 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x73, 0x52, 0x65, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x12, 0x29, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x74, 0x6b, 0x72, 0x70, 0x63, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x49, + 0x6e, 0x66, 0x6f, 0x52, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x22, 0x55, 0x0a, 0x0f, + 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x73, 0x52, 0x65, 0x73, 0x12, + 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x2c, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, + 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x74, 0x6b, 0x72, 0x70, 0x63, 0x2e, 0x43, + 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x07, 0x72, 0x65, 0x73, 0x75, + 0x6c, 0x74, 0x73, 0x22, 0xd7, 0x01, 0x0a, 0x08, 0x48, 0x74, 0x6c, 0x63, 0x49, 0x6e, 0x66, 0x6f, + 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, + 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x70, 0x61, 0x74, 0x68, 0x12, 0x0c, 0x0a, 0x01, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x01, 0x68, 0x12, 0x0c, 0x0a, 0x01, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x01, 0x72, + 0x12, 0x25, 0x0a, 0x0e, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x66, 0x6c, + 0x61, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x46, 0x6c, 0x61, 0x67, 0x12, 0x26, 0x0a, 0x0f, 0x63, 0x75, 0x72, 0x72, 0x5f, + 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0d, 0x63, 0x75, 0x72, 0x72, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x49, 0x64, 0x12, + 0x1d, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x1d, + 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x08, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x22, 0x8f, 0x01, + 0x0a, 0x0c, 0x4c, 0x6f, 0x63, 0x6b, 0x48, 0x74, 0x6c, 0x63, 0x50, 0x61, 0x74, 0x68, 0x12, 0x0e, + 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, + 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, + 0x74, 0x68, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x75, 0x72, 0x72, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x63, 0x75, 0x72, 0x72, 0x53, 0x74, 0x61, 0x74, + 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, + 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, + 0x12, 0x1d, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x07, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x2a, + 0x92, 0x01, 0x0a, 0x0c, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x65, + 0x12, 0x0b, 0x0a, 0x07, 0x75, 0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x10, 0x00, 0x12, 0x0a, 0x0a, + 0x06, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x10, 0x0a, 0x12, 0x11, 0x0a, 0x0d, 0x57, 0x61, 0x69, + 0x74, 0x46, 0x75, 0x6e, 0x64, 0x41, 0x73, 0x73, 0x65, 0x74, 0x10, 0x0b, 0x12, 0x09, 0x0a, 0x05, + 0x4e, 0x65, 0x77, 0x54, 0x78, 0x10, 0x0c, 0x12, 0x0a, 0x0a, 0x06, 0x43, 0x61, 0x6e, 0x55, 0x73, + 0x65, 0x10, 0x14, 0x12, 0x09, 0x0a, 0x05, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x10, 0x15, 0x12, 0x0a, + 0x0a, 0x06, 0x48, 0x74, 0x6c, 0x63, 0x54, 0x78, 0x10, 0x16, 0x12, 0x11, 0x0a, 0x0d, 0x4c, 0x6f, + 0x63, 0x6b, 0x42, 0x79, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x65, 0x72, 0x10, 0x17, 0x12, 0x15, 0x0a, + 0x11, 0x4f, 0x70, 0x65, 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x52, 0x65, 0x66, 0x75, + 0x73, 0x65, 0x10, 0x1e, 0x32, 0xb9, 0x06, 0x0a, 0x0b, 0x49, 0x6e, 0x66, 0x6f, 0x54, 0x72, 0x61, + 0x63, 0x6b, 0x65, 0x72, 0x12, 0x38, 0x0a, 0x09, 0x48, 0x65, 0x61, 0x72, 0x74, 0x42, 0x65, 0x61, + 0x74, 0x12, 0x18, 0x2e, 0x74, 0x6b, 0x72, 0x70, 0x63, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x1a, 0x0f, 0x2e, 0x74, 0x6b, + 0x72, 0x70, 0x63, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x65, 0x73, 0x28, 0x01, 0x12, 0x3b, + 0x0a, 0x0e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, + 0x12, 0x18, 0x2e, 0x74, 0x6b, 0x72, 0x70, 0x63, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, + 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x1a, 0x0f, 0x2e, 0x74, 0x6b, 0x72, + 0x70, 0x63, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x65, 0x73, 0x12, 0x3b, 0x0a, 0x0e, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x18, 0x2e, + 0x74, 0x6b, 0x72, 0x70, 0x63, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, + 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x1a, 0x0f, 0x2e, 0x74, 0x6b, 0x72, 0x70, 0x63, 0x2e, + 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x65, 0x73, 0x12, 0x3d, 0x0a, 0x0f, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x73, 0x12, 0x19, 0x2e, 0x74, 0x6b, + 0x72, 0x70, 0x63, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, + 0x66, 0x6f, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x0f, 0x2e, 0x74, 0x6b, 0x72, 0x70, 0x63, 0x2e, 0x45, + 0x6d, 0x70, 0x74, 0x79, 0x52, 0x65, 0x73, 0x12, 0x38, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x55, 0x73, + 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x18, 0x2e, 0x74, 0x6b, 0x72, 0x70, 0x63, 0x2e, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, + 0x1a, 0x0f, 0x2e, 0x74, 0x6b, 0x72, 0x70, 0x63, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, + 0x6f, 0x12, 0x33, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, + 0x73, 0x12, 0x0e, 0x2e, 0x74, 0x6b, 0x72, 0x70, 0x63, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, + 0x71, 0x1a, 0x13, 0x2e, 0x74, 0x6b, 0x72, 0x70, 0x63, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, + 0x66, 0x6f, 0x73, 0x52, 0x65, 0x73, 0x12, 0x2f, 0x0a, 0x08, 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x64, + 0x65, 0x73, 0x12, 0x0e, 0x2e, 0x74, 0x6b, 0x72, 0x70, 0x63, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, + 0x65, 0x71, 0x1a, 0x13, 0x2e, 0x74, 0x6b, 0x72, 0x70, 0x63, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x49, + 0x6e, 0x66, 0x6f, 0x73, 0x52, 0x65, 0x73, 0x12, 0x3b, 0x0a, 0x11, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x12, 0x2e, 0x74, + 0x6b, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x49, 0x6e, 0x66, 0x6f, + 0x1a, 0x12, 0x2e, 0x74, 0x6b, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, + 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x43, 0x0a, 0x12, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x68, + 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x73, 0x12, 0x1c, 0x2e, 0x74, 0x6b, 0x72, + 0x70, 0x63, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, + 0x49, 0x6e, 0x66, 0x6f, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x0f, 0x2e, 0x74, 0x6b, 0x72, 0x70, 0x63, + 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x65, 0x73, 0x12, 0x39, 0x0a, 0x0e, 0x47, 0x65, 0x74, + 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x13, 0x2e, 0x74, 0x6b, + 0x72, 0x70, 0x63, 0x2e, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, + 0x1a, 0x12, 0x2e, 0x74, 0x6b, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, + 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x32, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x6e, + 0x65, 0x6c, 0x73, 0x12, 0x0e, 0x2e, 0x74, 0x6b, 0x72, 0x70, 0x63, 0x2e, 0x4c, 0x69, 0x73, 0x74, + 0x52, 0x65, 0x71, 0x1a, 0x13, 0x2e, 0x74, 0x6b, 0x72, 0x70, 0x63, 0x2e, 0x4e, 0x6f, 0x64, 0x65, + 0x49, 0x6e, 0x66, 0x6f, 0x73, 0x52, 0x65, 0x73, 0x12, 0x32, 0x0a, 0x0e, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x48, 0x74, 0x6c, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x0f, 0x2e, 0x74, 0x6b, 0x72, + 0x70, 0x63, 0x2e, 0x48, 0x74, 0x6c, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x1a, 0x0f, 0x2e, 0x74, 0x6b, + 0x72, 0x70, 0x63, 0x2e, 0x48, 0x74, 0x6c, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x3b, 0x0a, 0x0b, + 0x48, 0x74, 0x6c, 0x63, 0x47, 0x65, 0x74, 0x50, 0x61, 0x74, 0x68, 0x12, 0x15, 0x2e, 0x74, 0x6b, + 0x72, 0x70, 0x63, 0x2e, 0x48, 0x74, 0x6c, 0x63, 0x47, 0x65, 0x74, 0x50, 0x61, 0x74, 0x68, 0x52, + 0x65, 0x71, 0x1a, 0x15, 0x2e, 0x74, 0x6b, 0x72, 0x70, 0x63, 0x2e, 0x48, 0x74, 0x6c, 0x63, 0x47, + 0x65, 0x74, 0x50, 0x61, 0x74, 0x68, 0x52, 0x65, 0x73, 0x12, 0x35, 0x0a, 0x0b, 0x47, 0x65, 0x74, + 0x48, 0x74, 0x6c, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x15, 0x2e, 0x74, 0x6b, 0x72, 0x70, 0x63, + 0x2e, 0x47, 0x65, 0x74, 0x48, 0x74, 0x6c, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x1a, + 0x0f, 0x2e, 0x74, 0x6b, 0x72, 0x70, 0x63, 0x2e, 0x48, 0x74, 0x6c, 0x63, 0x49, 0x6e, 0x66, 0x6f, + 0x42, 0x09, 0x5a, 0x07, 0x2e, 0x3b, 0x74, 0x6b, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, +} + +var ( + file_info_tracker_proto_rawDescOnce sync.Once + file_info_tracker_proto_rawDescData = file_info_tracker_proto_rawDesc +) + +func file_info_tracker_proto_rawDescGZIP() []byte { + file_info_tracker_proto_rawDescOnce.Do(func() { + file_info_tracker_proto_rawDescData = protoimpl.X.CompressGZIP(file_info_tracker_proto_rawDescData) + }) + return file_info_tracker_proto_rawDescData +} + +var file_info_tracker_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_info_tracker_proto_msgTypes = make([]protoimpl.MessageInfo, 18) +var file_info_tracker_proto_goTypes = []interface{}{ + (ChannelState)(0), // 0: tkrpc.ChannelState + (*HtlcGetPathReq)(nil), // 1: tkrpc.HtlcGetPathReq + (*HtlcGetPathRes)(nil), // 2: tkrpc.HtlcGetPathRes + (*GetHtlcInfoReq)(nil), // 3: tkrpc.GetHtlcInfoReq + (*SimpleFilter)(nil), // 4: tkrpc.SimpleFilter + (*EmptyRes)(nil), // 5: tkrpc.EmptyRes + (*UpdateNodeInfoReq)(nil), // 6: tkrpc.UpdateNodeInfoReq + (*NodeInfo)(nil), // 7: tkrpc.NodeInfo + (*UserInfo)(nil), // 8: tkrpc.UserInfo + (*UpdateUserInfoReq)(nil), // 9: tkrpc.UpdateUserInfoReq + (*UpdateUserInfosReq)(nil), // 10: tkrpc.UpdateUserInfosReq + (*UpdateChannelInfosReq)(nil), // 11: tkrpc.UpdateChannelInfosReq + (*ChannelInfo)(nil), // 12: tkrpc.ChannelInfo + (*ListReq)(nil), // 13: tkrpc.ListReq + (*UserInfosRes)(nil), // 14: tkrpc.UserInfosRes + (*NodeInfosRes)(nil), // 15: tkrpc.NodeInfosRes + (*ChannelInfosRes)(nil), // 16: tkrpc.ChannelInfosRes + (*HtlcInfo)(nil), // 17: tkrpc.HtlcInfo + (*LockHtlcPath)(nil), // 18: tkrpc.LockHtlcPath +} +var file_info_tracker_proto_depIdxs = []int32{ + 9, // 0: tkrpc.UpdateUserInfosReq.UpdateUserInfoReqs:type_name -> tkrpc.UpdateUserInfoReq + 12, // 1: tkrpc.UpdateChannelInfosReq.ChannelInfos:type_name -> tkrpc.ChannelInfo + 0, // 2: tkrpc.ChannelInfo.curr_state:type_name -> tkrpc.ChannelState + 8, // 3: tkrpc.UserInfosRes.results:type_name -> tkrpc.UserInfo + 7, // 4: tkrpc.NodeInfosRes.results:type_name -> tkrpc.NodeInfo + 12, // 5: tkrpc.ChannelInfosRes.results:type_name -> tkrpc.ChannelInfo + 6, // 6: tkrpc.InfoTracker.HeartBeat:input_type -> tkrpc.UpdateNodeInfoReq + 6, // 7: tkrpc.InfoTracker.UpdateNodeInfo:input_type -> tkrpc.UpdateNodeInfoReq + 9, // 8: tkrpc.InfoTracker.UpdateUserInfo:input_type -> tkrpc.UpdateUserInfoReq + 10, // 9: tkrpc.InfoTracker.UpdateUserInfos:input_type -> tkrpc.UpdateUserInfosReq + 9, // 10: tkrpc.InfoTracker.GetUserInfo:input_type -> tkrpc.UpdateUserInfoReq + 13, // 11: tkrpc.InfoTracker.GetUserInfos:input_type -> tkrpc.ListReq + 13, // 12: tkrpc.InfoTracker.GetNodes:input_type -> tkrpc.ListReq + 12, // 13: tkrpc.InfoTracker.UpdateChannelInfo:input_type -> tkrpc.ChannelInfo + 11, // 14: tkrpc.InfoTracker.UpdateChannelInfos:input_type -> tkrpc.UpdateChannelInfosReq + 4, // 15: tkrpc.InfoTracker.GetChannelInfo:input_type -> tkrpc.SimpleFilter + 13, // 16: tkrpc.InfoTracker.GetChannels:input_type -> tkrpc.ListReq + 17, // 17: tkrpc.InfoTracker.UpdateHtlcInfo:input_type -> tkrpc.HtlcInfo + 1, // 18: tkrpc.InfoTracker.HtlcGetPath:input_type -> tkrpc.HtlcGetPathReq + 3, // 19: tkrpc.InfoTracker.GetHtlcInfo:input_type -> tkrpc.GetHtlcInfoReq + 5, // 20: tkrpc.InfoTracker.HeartBeat:output_type -> tkrpc.EmptyRes + 5, // 21: tkrpc.InfoTracker.UpdateNodeInfo:output_type -> tkrpc.EmptyRes + 5, // 22: tkrpc.InfoTracker.UpdateUserInfo:output_type -> tkrpc.EmptyRes + 5, // 23: tkrpc.InfoTracker.UpdateUserInfos:output_type -> tkrpc.EmptyRes + 8, // 24: tkrpc.InfoTracker.GetUserInfo:output_type -> tkrpc.UserInfo + 14, // 25: tkrpc.InfoTracker.GetUserInfos:output_type -> tkrpc.UserInfosRes + 15, // 26: tkrpc.InfoTracker.GetNodes:output_type -> tkrpc.NodeInfosRes + 12, // 27: tkrpc.InfoTracker.UpdateChannelInfo:output_type -> tkrpc.ChannelInfo + 5, // 28: tkrpc.InfoTracker.UpdateChannelInfos:output_type -> tkrpc.EmptyRes + 12, // 29: tkrpc.InfoTracker.GetChannelInfo:output_type -> tkrpc.ChannelInfo + 15, // 30: tkrpc.InfoTracker.GetChannels:output_type -> tkrpc.NodeInfosRes + 17, // 31: tkrpc.InfoTracker.UpdateHtlcInfo:output_type -> tkrpc.HtlcInfo + 2, // 32: tkrpc.InfoTracker.HtlcGetPath:output_type -> tkrpc.HtlcGetPathRes + 17, // 33: tkrpc.InfoTracker.GetHtlcInfo:output_type -> tkrpc.HtlcInfo + 20, // [20:34] is the sub-list for method output_type + 6, // [6:20] is the sub-list for method input_type + 6, // [6:6] is the sub-list for extension type_name + 6, // [6:6] is the sub-list for extension extendee + 0, // [0:6] is the sub-list for field type_name +} + +func init() { file_info_tracker_proto_init() } +func file_info_tracker_proto_init() { + if File_info_tracker_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_info_tracker_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*HtlcGetPathReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_info_tracker_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*HtlcGetPathRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_info_tracker_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetHtlcInfoReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_info_tracker_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SimpleFilter); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_info_tracker_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EmptyRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_info_tracker_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateNodeInfoReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_info_tracker_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NodeInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_info_tracker_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UserInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_info_tracker_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateUserInfoReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_info_tracker_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateUserInfosReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_info_tracker_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateChannelInfosReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_info_tracker_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChannelInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_info_tracker_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_info_tracker_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UserInfosRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_info_tracker_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NodeInfosRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_info_tracker_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChannelInfosRes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_info_tracker_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*HtlcInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_info_tracker_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LockHtlcPath); 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{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_info_tracker_proto_rawDesc, + NumEnums: 1, + NumMessages: 18, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_info_tracker_proto_goTypes, + DependencyIndexes: file_info_tracker_proto_depIdxs, + EnumInfos: file_info_tracker_proto_enumTypes, + MessageInfos: file_info_tracker_proto_msgTypes, + }.Build() + File_info_tracker_proto = out.File + file_info_tracker_proto_rawDesc = nil + file_info_tracker_proto_goTypes = nil + file_info_tracker_proto_depIdxs = nil +} diff --git a/tracker/tkrpc/info-tracker.pb.gw.go b/tracker/tkrpc/info-tracker.pb.gw.go new file mode 100644 index 000000000..a5c9fa129 --- /dev/null +++ b/tracker/tkrpc/info-tracker.pb.gw.go @@ -0,0 +1,1175 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: info-tracker.proto + +/* +Package tkrpc is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package tkrpc + +import ( + "context" + "io" + "net/http" + + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = metadata.Join + +func request_InfoTracker_HeartBeat_0(ctx context.Context, marshaler runtime.Marshaler, client InfoTrackerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var metadata runtime.ServerMetadata + stream, err := client.HeartBeat(ctx) + if err != nil { + grpclog.Infof("Failed to start streaming: %v", err) + return nil, metadata, err + } + dec := marshaler.NewDecoder(req.Body) + for { + var protoReq UpdateNodeInfoReq + err = dec.Decode(&protoReq) + if err == io.EOF { + break + } + if err != nil { + grpclog.Infof("Failed to decode request: %v", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err = stream.Send(&protoReq); err != nil { + if err == io.EOF { + break + } + grpclog.Infof("Failed to send request: %v", err) + return nil, metadata, err + } + } + + if err := stream.CloseSend(); err != nil { + grpclog.Infof("Failed to terminate client stream: %v", err) + return nil, metadata, err + } + header, err := stream.Header() + if err != nil { + grpclog.Infof("Failed to get header from client: %v", err) + return nil, metadata, err + } + metadata.HeaderMD = header + + msg, err := stream.CloseAndRecv() + metadata.TrailerMD = stream.Trailer() + return msg, metadata, err + +} + +func request_InfoTracker_UpdateNodeInfo_0(ctx context.Context, marshaler runtime.Marshaler, client InfoTrackerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq UpdateNodeInfoReq + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.UpdateNodeInfo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_InfoTracker_UpdateNodeInfo_0(ctx context.Context, marshaler runtime.Marshaler, server InfoTrackerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq UpdateNodeInfoReq + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.UpdateNodeInfo(ctx, &protoReq) + return msg, metadata, err + +} + +func request_InfoTracker_UpdateUserInfo_0(ctx context.Context, marshaler runtime.Marshaler, client InfoTrackerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq UpdateUserInfoReq + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.UpdateUserInfo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_InfoTracker_UpdateUserInfo_0(ctx context.Context, marshaler runtime.Marshaler, server InfoTrackerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq UpdateUserInfoReq + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.UpdateUserInfo(ctx, &protoReq) + return msg, metadata, err + +} + +func request_InfoTracker_UpdateUserInfos_0(ctx context.Context, marshaler runtime.Marshaler, client InfoTrackerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq UpdateUserInfosReq + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.UpdateUserInfos(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_InfoTracker_UpdateUserInfos_0(ctx context.Context, marshaler runtime.Marshaler, server InfoTrackerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq UpdateUserInfosReq + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.UpdateUserInfos(ctx, &protoReq) + return msg, metadata, err + +} + +func request_InfoTracker_GetUserInfo_0(ctx context.Context, marshaler runtime.Marshaler, client InfoTrackerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq UpdateUserInfoReq + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetUserInfo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_InfoTracker_GetUserInfo_0(ctx context.Context, marshaler runtime.Marshaler, server InfoTrackerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq UpdateUserInfoReq + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetUserInfo(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_InfoTracker_GetUserInfos_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_InfoTracker_GetUserInfos_0(ctx context.Context, marshaler runtime.Marshaler, client InfoTrackerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListReq + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_InfoTracker_GetUserInfos_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetUserInfos(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_InfoTracker_GetUserInfos_0(ctx context.Context, marshaler runtime.Marshaler, server InfoTrackerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListReq + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_InfoTracker_GetUserInfos_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetUserInfos(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_InfoTracker_GetNodes_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_InfoTracker_GetNodes_0(ctx context.Context, marshaler runtime.Marshaler, client InfoTrackerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListReq + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_InfoTracker_GetNodes_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetNodes(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_InfoTracker_GetNodes_0(ctx context.Context, marshaler runtime.Marshaler, server InfoTrackerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListReq + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_InfoTracker_GetNodes_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetNodes(ctx, &protoReq) + return msg, metadata, err + +} + +func request_InfoTracker_UpdateChannelInfo_0(ctx context.Context, marshaler runtime.Marshaler, client InfoTrackerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ChannelInfo + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.UpdateChannelInfo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_InfoTracker_UpdateChannelInfo_0(ctx context.Context, marshaler runtime.Marshaler, server InfoTrackerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ChannelInfo + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.UpdateChannelInfo(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_InfoTracker_GetChannelInfo_0 = &utilities.DoubleArray{Encoding: map[string]int{"id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + +func request_InfoTracker_GetChannelInfo_0(ctx context.Context, marshaler runtime.Marshaler, client InfoTrackerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq SimpleFilter + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_InfoTracker_GetChannelInfo_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetChannelInfo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_InfoTracker_GetChannelInfo_0(ctx context.Context, marshaler runtime.Marshaler, server InfoTrackerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq SimpleFilter + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_InfoTracker_GetChannelInfo_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetChannelInfo(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_InfoTracker_GetChannels_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_InfoTracker_GetChannels_0(ctx context.Context, marshaler runtime.Marshaler, client InfoTrackerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListReq + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_InfoTracker_GetChannels_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetChannels(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_InfoTracker_GetChannels_0(ctx context.Context, marshaler runtime.Marshaler, server InfoTrackerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListReq + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_InfoTracker_GetChannels_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetChannels(ctx, &protoReq) + return msg, metadata, err + +} + +func request_InfoTracker_UpdateHtlcInfo_0(ctx context.Context, marshaler runtime.Marshaler, client InfoTrackerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq HtlcInfo + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.UpdateHtlcInfo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_InfoTracker_UpdateHtlcInfo_0(ctx context.Context, marshaler runtime.Marshaler, server InfoTrackerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq HtlcInfo + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.UpdateHtlcInfo(ctx, &protoReq) + return msg, metadata, err + +} + +func request_InfoTracker_HtlcGetPath_0(ctx context.Context, marshaler runtime.Marshaler, client InfoTrackerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq HtlcGetPathReq + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.HtlcGetPath(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_InfoTracker_HtlcGetPath_0(ctx context.Context, marshaler runtime.Marshaler, server InfoTrackerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq HtlcGetPathReq + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.HtlcGetPath(ctx, &protoReq) + return msg, metadata, err + +} + +func request_InfoTracker_GetHtlcInfo_0(ctx context.Context, marshaler runtime.Marshaler, client InfoTrackerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetHtlcInfoReq + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetHtlcInfo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_InfoTracker_GetHtlcInfo_0(ctx context.Context, marshaler runtime.Marshaler, server InfoTrackerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetHtlcInfoReq + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetHtlcInfo(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterInfoTrackerHandlerServer registers the http handlers for service InfoTracker to "mux". +// UnaryRPC :call InfoTrackerServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterInfoTrackerHandlerFromEndpoint instead. +func RegisterInfoTrackerHandlerServer(ctx context.Context, mux *runtime.ServeMux, server InfoTrackerServer) error { + + mux.Handle("POST", pattern_InfoTracker_HeartBeat_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + err := status.Error(codes.Unimplemented, "streaming calls are not yet supported in the in-process transport") + _, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + }) + + mux.Handle("POST", pattern_InfoTracker_UpdateNodeInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/tkrpc.InfoTracker/UpdateNodeInfo", runtime.WithHTTPPathPattern("/gw/UpdateNodeInfo")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_InfoTracker_UpdateNodeInfo_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_InfoTracker_UpdateNodeInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_InfoTracker_UpdateUserInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/tkrpc.InfoTracker/UpdateUserInfo", runtime.WithHTTPPathPattern("/gw/SetUserInfo")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_InfoTracker_UpdateUserInfo_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_InfoTracker_UpdateUserInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_InfoTracker_UpdateUserInfos_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/tkrpc.InfoTracker/UpdateUserInfos", runtime.WithHTTPPathPattern("/gw/SetUserInfos")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_InfoTracker_UpdateUserInfos_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_InfoTracker_UpdateUserInfos_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_InfoTracker_GetUserInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/tkrpc.InfoTracker/GetUserInfo", runtime.WithHTTPPathPattern("/gw/GetUserInfo")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_InfoTracker_GetUserInfo_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_InfoTracker_GetUserInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_InfoTracker_GetUserInfos_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/tkrpc.InfoTracker/GetUserInfos", runtime.WithHTTPPathPattern("/gw/GetUserInfos")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_InfoTracker_GetUserInfos_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_InfoTracker_GetUserInfos_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_InfoTracker_GetNodes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/tkrpc.InfoTracker/GetNodes", runtime.WithHTTPPathPattern("/gw/GetNodes")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_InfoTracker_GetNodes_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_InfoTracker_GetNodes_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_InfoTracker_UpdateChannelInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/tkrpc.InfoTracker/UpdateChannelInfo", runtime.WithHTTPPathPattern("/gw/UpdateChannelInfo")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_InfoTracker_UpdateChannelInfo_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_InfoTracker_UpdateChannelInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_InfoTracker_GetChannelInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/tkrpc.InfoTracker/GetChannelInfo", runtime.WithHTTPPathPattern("/gw/GetChannelInfo/{id}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_InfoTracker_GetChannelInfo_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_InfoTracker_GetChannelInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_InfoTracker_GetChannels_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/tkrpc.InfoTracker/GetChannels", runtime.WithHTTPPathPattern("/gw/GetChannels")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_InfoTracker_GetChannels_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_InfoTracker_GetChannels_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_InfoTracker_UpdateHtlcInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/tkrpc.InfoTracker/UpdateHtlcInfo", runtime.WithHTTPPathPattern("/gw/UpdateHtlcInfo")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_InfoTracker_UpdateHtlcInfo_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_InfoTracker_UpdateHtlcInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_InfoTracker_HtlcGetPath_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/tkrpc.InfoTracker/HtlcGetPath", runtime.WithHTTPPathPattern("/gw/HtlcGetPath")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_InfoTracker_HtlcGetPath_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_InfoTracker_HtlcGetPath_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_InfoTracker_GetHtlcInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/tkrpc.InfoTracker/GetHtlcInfo", runtime.WithHTTPPathPattern("/gw/GetHtlcInfo")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_InfoTracker_GetHtlcInfo_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_InfoTracker_GetHtlcInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterInfoTrackerHandlerFromEndpoint is same as RegisterInfoTrackerHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterInfoTrackerHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterInfoTrackerHandler(ctx, mux, conn) +} + +// RegisterInfoTrackerHandler registers the http handlers for service InfoTracker to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterInfoTrackerHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterInfoTrackerHandlerClient(ctx, mux, NewInfoTrackerClient(conn)) +} + +// RegisterInfoTrackerHandlerClient registers the http handlers for service InfoTracker +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "InfoTrackerClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "InfoTrackerClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "InfoTrackerClient" to call the correct interceptors. +func RegisterInfoTrackerHandlerClient(ctx context.Context, mux *runtime.ServeMux, client InfoTrackerClient) error { + + mux.Handle("POST", pattern_InfoTracker_HeartBeat_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/tkrpc.InfoTracker/HeartBeat", runtime.WithHTTPPathPattern("/gw/HeartBeat")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_InfoTracker_HeartBeat_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_InfoTracker_HeartBeat_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_InfoTracker_UpdateNodeInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/tkrpc.InfoTracker/UpdateNodeInfo", runtime.WithHTTPPathPattern("/gw/UpdateNodeInfo")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_InfoTracker_UpdateNodeInfo_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_InfoTracker_UpdateNodeInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_InfoTracker_UpdateUserInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/tkrpc.InfoTracker/UpdateUserInfo", runtime.WithHTTPPathPattern("/gw/SetUserInfo")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_InfoTracker_UpdateUserInfo_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_InfoTracker_UpdateUserInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_InfoTracker_UpdateUserInfos_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/tkrpc.InfoTracker/UpdateUserInfos", runtime.WithHTTPPathPattern("/gw/SetUserInfos")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_InfoTracker_UpdateUserInfos_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_InfoTracker_UpdateUserInfos_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_InfoTracker_GetUserInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/tkrpc.InfoTracker/GetUserInfo", runtime.WithHTTPPathPattern("/gw/GetUserInfo")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_InfoTracker_GetUserInfo_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_InfoTracker_GetUserInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_InfoTracker_GetUserInfos_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/tkrpc.InfoTracker/GetUserInfos", runtime.WithHTTPPathPattern("/gw/GetUserInfos")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_InfoTracker_GetUserInfos_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_InfoTracker_GetUserInfos_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_InfoTracker_GetNodes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/tkrpc.InfoTracker/GetNodes", runtime.WithHTTPPathPattern("/gw/GetNodes")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_InfoTracker_GetNodes_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_InfoTracker_GetNodes_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_InfoTracker_UpdateChannelInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/tkrpc.InfoTracker/UpdateChannelInfo", runtime.WithHTTPPathPattern("/gw/UpdateChannelInfo")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_InfoTracker_UpdateChannelInfo_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_InfoTracker_UpdateChannelInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_InfoTracker_GetChannelInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/tkrpc.InfoTracker/GetChannelInfo", runtime.WithHTTPPathPattern("/gw/GetChannelInfo/{id}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_InfoTracker_GetChannelInfo_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_InfoTracker_GetChannelInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_InfoTracker_GetChannels_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/tkrpc.InfoTracker/GetChannels", runtime.WithHTTPPathPattern("/gw/GetChannels")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_InfoTracker_GetChannels_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_InfoTracker_GetChannels_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_InfoTracker_UpdateHtlcInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/tkrpc.InfoTracker/UpdateHtlcInfo", runtime.WithHTTPPathPattern("/gw/UpdateHtlcInfo")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_InfoTracker_UpdateHtlcInfo_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_InfoTracker_UpdateHtlcInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_InfoTracker_HtlcGetPath_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/tkrpc.InfoTracker/HtlcGetPath", runtime.WithHTTPPathPattern("/gw/HtlcGetPath")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_InfoTracker_HtlcGetPath_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_InfoTracker_HtlcGetPath_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_InfoTracker_GetHtlcInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/tkrpc.InfoTracker/GetHtlcInfo", runtime.WithHTTPPathPattern("/gw/GetHtlcInfo")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_InfoTracker_GetHtlcInfo_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_InfoTracker_GetHtlcInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_InfoTracker_HeartBeat_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"gw", "HeartBeat"}, "")) + + pattern_InfoTracker_UpdateNodeInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"gw", "UpdateNodeInfo"}, "")) + + pattern_InfoTracker_UpdateUserInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"gw", "SetUserInfo"}, "")) + + pattern_InfoTracker_UpdateUserInfos_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"gw", "SetUserInfos"}, "")) + + pattern_InfoTracker_GetUserInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"gw", "GetUserInfo"}, "")) + + pattern_InfoTracker_GetUserInfos_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"gw", "GetUserInfos"}, "")) + + pattern_InfoTracker_GetNodes_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"gw", "GetNodes"}, "")) + + pattern_InfoTracker_UpdateChannelInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"gw", "UpdateChannelInfo"}, "")) + + pattern_InfoTracker_GetChannelInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"gw", "GetChannelInfo", "id"}, "")) + + pattern_InfoTracker_GetChannels_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"gw", "GetChannels"}, "")) + + pattern_InfoTracker_UpdateHtlcInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"gw", "UpdateHtlcInfo"}, "")) + + pattern_InfoTracker_HtlcGetPath_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"gw", "HtlcGetPath"}, "")) + + pattern_InfoTracker_GetHtlcInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"gw", "GetHtlcInfo"}, "")) +) + +var ( + forward_InfoTracker_HeartBeat_0 = runtime.ForwardResponseMessage + + forward_InfoTracker_UpdateNodeInfo_0 = runtime.ForwardResponseMessage + + forward_InfoTracker_UpdateUserInfo_0 = runtime.ForwardResponseMessage + + forward_InfoTracker_UpdateUserInfos_0 = runtime.ForwardResponseMessage + + forward_InfoTracker_GetUserInfo_0 = runtime.ForwardResponseMessage + + forward_InfoTracker_GetUserInfos_0 = runtime.ForwardResponseMessage + + forward_InfoTracker_GetNodes_0 = runtime.ForwardResponseMessage + + forward_InfoTracker_UpdateChannelInfo_0 = runtime.ForwardResponseMessage + + forward_InfoTracker_GetChannelInfo_0 = runtime.ForwardResponseMessage + + forward_InfoTracker_GetChannels_0 = runtime.ForwardResponseMessage + + forward_InfoTracker_UpdateHtlcInfo_0 = runtime.ForwardResponseMessage + + forward_InfoTracker_HtlcGetPath_0 = runtime.ForwardResponseMessage + + forward_InfoTracker_GetHtlcInfo_0 = runtime.ForwardResponseMessage +) diff --git a/tracker/tkrpc/info-tracker.proto b/tracker/tkrpc/info-tracker.proto new file mode 100644 index 000000000..f99f94551 --- /dev/null +++ b/tracker/tkrpc/info-tracker.proto @@ -0,0 +1,212 @@ +syntax = "proto3"; + +package tkrpc; + +//import "google/protobuf/timestamp.proto"; + +option go_package = ".;tkrpc"; + + +// InfoTracker is a service that is used to record and query on userinfo,channelInfo,nodeInfo +service InfoTracker { + /* + // old service/NodeAccountService api + Login(obdClient *ObdNode, msgData string) (retData interface{}, err error) + Logout(obdClient *ObdNode) (err error) + UserLogin(obdClient *ObdNode, msgData string) (retData interface{}, err error) + UserLogout(obdClient *ObdNode, msgData string) (err error) + UpdateUserInfo(obdP2pNodeId, obdClientId, userId string) (retData interface{}, err error) + UpdateUsers(obdClient *ObdNode, msgData string) (err error) + GetNodeInfoByP2pAddress(context *gin.Context) + GetUserState(context *gin.Context) + GetUserP2pNodeId(context *gin.Context) + GetAllUsers(context *gin.Context) + GetAllObdNodes(context *gin.Context) + + // service/channel api: + func (manager *channelManager) updateChannelInfo(obdP2pNodeId string, msgData string) (err error) + func (manager *channelManager) GetChannelState(context *gin.Context) + func (manager *channelManager) GetChannels(context *gin.Context) + + // service/htlc api: + func (manager *htlcManager) getPath(msgData string) (path interface{}, err error) + func (manager *htlcManager) updateHtlcInfo( msgData string) (err error) + func (manager *htlcManager) GetHtlcCurrState(context *gin.Context) + */ + + //every HeartBeat will set nodeInfo.isonline=true; every HeartBeat disconnect will set nodeInfo.isonline=false; + rpc HeartBeat (stream UpdateNodeInfoReq) returns (EmptyRes); + //map to old func Logout Login + rpc UpdateNodeInfo (UpdateNodeInfoReq) returns (EmptyRes); + //map to old func userLogout userLogin + rpc UpdateUserInfo (UpdateUserInfoReq) returns (EmptyRes); + //map to old func updateUsers + rpc UpdateUserInfos (UpdateUserInfosReq) returns (EmptyRes); + //map to old func: GetUserState , GetUserP2pNodeId + //Request:SetUserInfoReq{user_id,node_Id} + //old GetUserP2pNodeId use request:SetUserInfoReq{user_id} ; may not work when user login on multi node + rpc GetUserInfo (UpdateUserInfoReq) returns (UserInfo); + //Map to old function GetAllUsers + rpc GetUserInfos (ListReq) returns (UserInfosRes); + //map old function GetAllObdNodes + rpc GetNodes (ListReq) returns (NodeInfosRes); + // map to old ChannelService.updateChannelInfo + + rpc UpdateChannelInfo(ChannelInfo)returns(ChannelInfo); + rpc UpdateChannelInfos(UpdateChannelInfosReq)returns(EmptyRes); + //map to old ChannelService.GetChannelState + rpc GetChannelInfo(SimpleFilter)returns(ChannelInfo); + rpc GetChannels(ListReq)returns (NodeInfosRes); + + // map old function updateHtlcInfo + rpc UpdateHtlcInfo(HtlcInfo)returns (HtlcInfo); + //map old function getPath + rpc HtlcGetPath(HtlcGetPathReq)returns (HtlcGetPathRes); + //map old function GetHtlcCurrState + rpc GetHtlcInfo(GetHtlcInfoReq)returns (HtlcInfo); +} +message HtlcGetPathReq{ + string payer_obd_node_id = 1; + string real_payer_peer_id = 2; + string payee_peer_id = 3; + int64 property_id = 4; + string h = 5; + double amount = 6; +} +message HtlcGetPathRes{ + string senderPeerId = 1; + string h = 2; + double amount = 3; + string path = 4; +} +message GetHtlcInfoReq{ + string h = 2; + string path = 4; +} + +message SimpleFilter{ + string id = 1; + string channel_id = 2; + string user_id = 3; +} +//Empty response +message EmptyRes { +} +message UpdateNodeInfoReq { + string node_id = 2; + string p2p_address = 3; + // 1 online 2 offline + int32 is_online = 5; +} +//obd-node info +message NodeInfo { + int32 id = 1; + //node_peer_id + string node_id = 2; + string p2p_address = 3; + string access_ip = 4; + // 1 online 2 offline + int32 is_online = 5; + int32 hear_beat_counter = 6; + int64 last_hear_beat = 7; + //unix timestamp in seconds ; google.protobuf.Timestamp will more better,but sql database not support. + int64 updated_at = 8; + int64 created_at = 9 ; +} +//obd-user-info +message UserInfo { + int32 id = 1; + //user_peer_id + string user_id = 2; + //node_peer_id + string node_id = 3; + // 1 online 2 offline + int32 is_online = 4; + string access_ip = 5; + //unix timestamp in seconds ; google.protobuf.Timestamp will more better,but sql database not support. + int64 updated_at = 6; + int64 created_at = 7; +} +message UpdateUserInfoReq{ + string user_id = 1; + string node_id = 2; + string p2p_address = 3; + // 1 online 2 offline + int32 is_online = 4; +} +message UpdateUserInfosReq { + repeated UpdateUserInfoReq UpdateUserInfoReqs = 1; +} +message UpdateChannelInfosReq { + repeated ChannelInfo ChannelInfos = 1; +} +message ChannelInfo{ + int32 id = 1; + string obd_node_ida = 2; + string obd_node_idb = 3; + string channel_id = 4; + int64 property_id = 5; + ChannelState curr_state = 6; + string peer_ida = 7; + string peer_idb = 8; + double amount_a = 9; + double amount_b = 10; + int64 updated_at = 11; + int64 created_at = 12; + //database will not store it + bool is_alice=13; + //database will not store it + string node_id=14; +} + +message ListReq { + //page number + int32 page = 1; + //page size + int32 size = 2; + //sort set the sql order-by sort=[-]field_name . example sort=-updated_at will sort by:"desc id";sort=updated_at sort by:"asc id" + string sort = 3; + string user_id = 4; +} +message UserInfosRes { + int64 count = 1; + repeated UserInfo results = 2; +} +message NodeInfosRes { + int64 count = 1; + repeated NodeInfo results = 2; +} +message ChannelInfosRes { + int64 count = 1; + repeated ChannelInfo results = 2; +} + +enum ChannelState{ + unknown = 0; + Create = 10 ; + WaitFundAsset = 11 ; + NewTx = 12 ; + CanUse = 20 ; + Close = 21 ; + HtlcTx = 22 ; + LockByTracker = 23 ; + OpenChannelRefuse = 30 ; +} +message HtlcInfo{ + int32 id = 1; + string path = 2; + string h = 3; + string r = 4; + int32 direction_flag = 5; + string curr_channel_id = 6; + int64 updated_at = 7; + int64 created_at = 8; +} +message LockHtlcPath{ + int32 id = 1; + string path = 2; + // 0 创建,1,标记作废,2 标记通知完成 + int32 curr_state = 3; + int64 created_at = 8; + int64 updated_at = 7; +} \ No newline at end of file diff --git a/tracker/tkrpc/info-tracker.yaml b/tracker/tkrpc/info-tracker.yaml new file mode 100644 index 000000000..a1fb302c4 --- /dev/null +++ b/tracker/tkrpc/info-tracker.yaml @@ -0,0 +1,48 @@ +type: google.api.Service +config_version: 3 + +http: + rules: + - selector: tkrpc.InfoTracker.HeartBeat + post: "/gw/HeartBeat" + body: "*" + - selector: tkrpc.InfoTracker.UpdateNodeInfo + post: "/gw/UpdateNodeInfo" + body: "*" + - selector: tkrpc.InfoTracker.UpdateUserInfo + post: "/gw/SetUserInfo" + body: "*" + - selector: tkrpc.InfoTracker.UpdateUserInfos + post: "/gw/SetUserInfos" + body: "*" + + - selector: tkrpc.InfoTracker.GetUserInfo + post: "/gw/GetUserInfo" + body: "*" + + - selector: tkrpc.InfoTracker.GetUserInfos + get: "/gw/GetUserInfos" + + + - selector: tkrpc.InfoTracker.GetNodes + post: "/gw/GetNodes" + + - selector: tkrpc.InfoTracker.UpdateChannelInfo + post: "/gw/UpdateChannelInfo" + body: "*" + + - selector: tkrpc.InfoTracker.GetChannelInfo + get: "/gw/GetChannelInfo/{id}" + + - selector: tkrpc.InfoTracker.GetChannels + get: "/gw/GetChannels" + + - selector: tkrpc.InfoTracker.UpdateHtlcInfo + post: "/gw/UpdateHtlcInfo" + body: "*" + - selector: tkrpc.InfoTracker.HtlcGetPath + post: "/gw/HtlcGetPath" + body: "*" + - selector: tkrpc.InfoTracker.GetHtlcInfo + post: "/gw/GetHtlcInfo" + body: "*" \ No newline at end of file diff --git a/tracker/tkrpc/info-tracker_grpc.pb.go b/tracker/tkrpc/info-tracker_grpc.pb.go new file mode 100644 index 000000000..0f362c568 --- /dev/null +++ b/tracker/tkrpc/info-tracker_grpc.pb.go @@ -0,0 +1,634 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc v3.6.1 +// source: info-tracker.proto + +package tkrpc + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// InfoTrackerClient is the client API for InfoTracker service. +// +// 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 InfoTrackerClient interface { + //every HeartBeat will set nodeInfo.isonline=true; every HeartBeat disconnect will set nodeInfo.isonline=false; + HeartBeat(ctx context.Context, opts ...grpc.CallOption) (InfoTracker_HeartBeatClient, error) + //map to old func Logout Login + UpdateNodeInfo(ctx context.Context, in *UpdateNodeInfoReq, opts ...grpc.CallOption) (*EmptyRes, error) + //map to old func userLogout userLogin + UpdateUserInfo(ctx context.Context, in *UpdateUserInfoReq, opts ...grpc.CallOption) (*EmptyRes, error) + //map to old func updateUsers + UpdateUserInfos(ctx context.Context, in *UpdateUserInfosReq, opts ...grpc.CallOption) (*EmptyRes, error) + //map to old func: GetUserState , GetUserP2pNodeId + //Request:SetUserInfoReq{user_id,node_Id} + //old GetUserP2pNodeId use request:SetUserInfoReq{user_id} ; may not work when user login on multi node + GetUserInfo(ctx context.Context, in *UpdateUserInfoReq, opts ...grpc.CallOption) (*UserInfo, error) + //Map to old function GetAllUsers + GetUserInfos(ctx context.Context, in *ListReq, opts ...grpc.CallOption) (*UserInfosRes, error) + //map old function GetAllObdNodes + GetNodes(ctx context.Context, in *ListReq, opts ...grpc.CallOption) (*NodeInfosRes, error) + UpdateChannelInfo(ctx context.Context, in *ChannelInfo, opts ...grpc.CallOption) (*ChannelInfo, error) + UpdateChannelInfos(ctx context.Context, in *UpdateChannelInfosReq, opts ...grpc.CallOption) (*EmptyRes, error) + //map to old ChannelService.GetChannelState + GetChannelInfo(ctx context.Context, in *SimpleFilter, opts ...grpc.CallOption) (*ChannelInfo, error) + GetChannels(ctx context.Context, in *ListReq, opts ...grpc.CallOption) (*NodeInfosRes, error) + // map old function updateHtlcInfo + UpdateHtlcInfo(ctx context.Context, in *HtlcInfo, opts ...grpc.CallOption) (*HtlcInfo, error) + //map old function getPath + HtlcGetPath(ctx context.Context, in *HtlcGetPathReq, opts ...grpc.CallOption) (*HtlcGetPathRes, error) + //map old function GetHtlcCurrState + GetHtlcInfo(ctx context.Context, in *GetHtlcInfoReq, opts ...grpc.CallOption) (*HtlcInfo, error) +} + +type infoTrackerClient struct { + cc grpc.ClientConnInterface +} + +func NewInfoTrackerClient(cc grpc.ClientConnInterface) InfoTrackerClient { + return &infoTrackerClient{cc} +} + +func (c *infoTrackerClient) HeartBeat(ctx context.Context, opts ...grpc.CallOption) (InfoTracker_HeartBeatClient, error) { + stream, err := c.cc.NewStream(ctx, &InfoTracker_ServiceDesc.Streams[0], "/tkrpc.InfoTracker/HeartBeat", opts...) + if err != nil { + return nil, err + } + x := &infoTrackerHeartBeatClient{stream} + return x, nil +} + +type InfoTracker_HeartBeatClient interface { + Send(*UpdateNodeInfoReq) error + CloseAndRecv() (*EmptyRes, error) + grpc.ClientStream +} + +type infoTrackerHeartBeatClient struct { + grpc.ClientStream +} + +func (x *infoTrackerHeartBeatClient) Send(m *UpdateNodeInfoReq) error { + return x.ClientStream.SendMsg(m) +} + +func (x *infoTrackerHeartBeatClient) CloseAndRecv() (*EmptyRes, error) { + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + m := new(EmptyRes) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *infoTrackerClient) UpdateNodeInfo(ctx context.Context, in *UpdateNodeInfoReq, opts ...grpc.CallOption) (*EmptyRes, error) { + out := new(EmptyRes) + err := c.cc.Invoke(ctx, "/tkrpc.InfoTracker/UpdateNodeInfo", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *infoTrackerClient) UpdateUserInfo(ctx context.Context, in *UpdateUserInfoReq, opts ...grpc.CallOption) (*EmptyRes, error) { + out := new(EmptyRes) + err := c.cc.Invoke(ctx, "/tkrpc.InfoTracker/UpdateUserInfo", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *infoTrackerClient) UpdateUserInfos(ctx context.Context, in *UpdateUserInfosReq, opts ...grpc.CallOption) (*EmptyRes, error) { + out := new(EmptyRes) + err := c.cc.Invoke(ctx, "/tkrpc.InfoTracker/UpdateUserInfos", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *infoTrackerClient) GetUserInfo(ctx context.Context, in *UpdateUserInfoReq, opts ...grpc.CallOption) (*UserInfo, error) { + out := new(UserInfo) + err := c.cc.Invoke(ctx, "/tkrpc.InfoTracker/GetUserInfo", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *infoTrackerClient) GetUserInfos(ctx context.Context, in *ListReq, opts ...grpc.CallOption) (*UserInfosRes, error) { + out := new(UserInfosRes) + err := c.cc.Invoke(ctx, "/tkrpc.InfoTracker/GetUserInfos", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *infoTrackerClient) GetNodes(ctx context.Context, in *ListReq, opts ...grpc.CallOption) (*NodeInfosRes, error) { + out := new(NodeInfosRes) + err := c.cc.Invoke(ctx, "/tkrpc.InfoTracker/GetNodes", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *infoTrackerClient) UpdateChannelInfo(ctx context.Context, in *ChannelInfo, opts ...grpc.CallOption) (*ChannelInfo, error) { + out := new(ChannelInfo) + err := c.cc.Invoke(ctx, "/tkrpc.InfoTracker/UpdateChannelInfo", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *infoTrackerClient) UpdateChannelInfos(ctx context.Context, in *UpdateChannelInfosReq, opts ...grpc.CallOption) (*EmptyRes, error) { + out := new(EmptyRes) + err := c.cc.Invoke(ctx, "/tkrpc.InfoTracker/UpdateChannelInfos", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *infoTrackerClient) GetChannelInfo(ctx context.Context, in *SimpleFilter, opts ...grpc.CallOption) (*ChannelInfo, error) { + out := new(ChannelInfo) + err := c.cc.Invoke(ctx, "/tkrpc.InfoTracker/GetChannelInfo", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *infoTrackerClient) GetChannels(ctx context.Context, in *ListReq, opts ...grpc.CallOption) (*NodeInfosRes, error) { + out := new(NodeInfosRes) + err := c.cc.Invoke(ctx, "/tkrpc.InfoTracker/GetChannels", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *infoTrackerClient) UpdateHtlcInfo(ctx context.Context, in *HtlcInfo, opts ...grpc.CallOption) (*HtlcInfo, error) { + out := new(HtlcInfo) + err := c.cc.Invoke(ctx, "/tkrpc.InfoTracker/UpdateHtlcInfo", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *infoTrackerClient) HtlcGetPath(ctx context.Context, in *HtlcGetPathReq, opts ...grpc.CallOption) (*HtlcGetPathRes, error) { + out := new(HtlcGetPathRes) + err := c.cc.Invoke(ctx, "/tkrpc.InfoTracker/HtlcGetPath", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *infoTrackerClient) GetHtlcInfo(ctx context.Context, in *GetHtlcInfoReq, opts ...grpc.CallOption) (*HtlcInfo, error) { + out := new(HtlcInfo) + err := c.cc.Invoke(ctx, "/tkrpc.InfoTracker/GetHtlcInfo", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// InfoTrackerServer is the server API for InfoTracker service. +// All implementations must embed UnimplementedInfoTrackerServer +// for forward compatibility +type InfoTrackerServer interface { + //every HeartBeat will set nodeInfo.isonline=true; every HeartBeat disconnect will set nodeInfo.isonline=false; + HeartBeat(InfoTracker_HeartBeatServer) error + //map to old func Logout Login + UpdateNodeInfo(context.Context, *UpdateNodeInfoReq) (*EmptyRes, error) + //map to old func userLogout userLogin + UpdateUserInfo(context.Context, *UpdateUserInfoReq) (*EmptyRes, error) + //map to old func updateUsers + UpdateUserInfos(context.Context, *UpdateUserInfosReq) (*EmptyRes, error) + //map to old func: GetUserState , GetUserP2pNodeId + //Request:SetUserInfoReq{user_id,node_Id} + //old GetUserP2pNodeId use request:SetUserInfoReq{user_id} ; may not work when user login on multi node + GetUserInfo(context.Context, *UpdateUserInfoReq) (*UserInfo, error) + //Map to old function GetAllUsers + GetUserInfos(context.Context, *ListReq) (*UserInfosRes, error) + //map old function GetAllObdNodes + GetNodes(context.Context, *ListReq) (*NodeInfosRes, error) + UpdateChannelInfo(context.Context, *ChannelInfo) (*ChannelInfo, error) + UpdateChannelInfos(context.Context, *UpdateChannelInfosReq) (*EmptyRes, error) + //map to old ChannelService.GetChannelState + GetChannelInfo(context.Context, *SimpleFilter) (*ChannelInfo, error) + GetChannels(context.Context, *ListReq) (*NodeInfosRes, error) + // map old function updateHtlcInfo + UpdateHtlcInfo(context.Context, *HtlcInfo) (*HtlcInfo, error) + //map old function getPath + HtlcGetPath(context.Context, *HtlcGetPathReq) (*HtlcGetPathRes, error) + //map old function GetHtlcCurrState + GetHtlcInfo(context.Context, *GetHtlcInfoReq) (*HtlcInfo, error) + mustEmbedUnimplementedInfoTrackerServer() +} + +// UnimplementedInfoTrackerServer must be embedded to have forward compatible implementations. +type UnimplementedInfoTrackerServer struct { +} + +func (UnimplementedInfoTrackerServer) HeartBeat(InfoTracker_HeartBeatServer) error { + return status.Errorf(codes.Unimplemented, "method HeartBeat not implemented") +} +func (UnimplementedInfoTrackerServer) UpdateNodeInfo(context.Context, *UpdateNodeInfoReq) (*EmptyRes, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateNodeInfo not implemented") +} +func (UnimplementedInfoTrackerServer) UpdateUserInfo(context.Context, *UpdateUserInfoReq) (*EmptyRes, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateUserInfo not implemented") +} +func (UnimplementedInfoTrackerServer) UpdateUserInfos(context.Context, *UpdateUserInfosReq) (*EmptyRes, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateUserInfos not implemented") +} +func (UnimplementedInfoTrackerServer) GetUserInfo(context.Context, *UpdateUserInfoReq) (*UserInfo, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetUserInfo not implemented") +} +func (UnimplementedInfoTrackerServer) GetUserInfos(context.Context, *ListReq) (*UserInfosRes, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetUserInfos not implemented") +} +func (UnimplementedInfoTrackerServer) GetNodes(context.Context, *ListReq) (*NodeInfosRes, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetNodes not implemented") +} +func (UnimplementedInfoTrackerServer) UpdateChannelInfo(context.Context, *ChannelInfo) (*ChannelInfo, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateChannelInfo not implemented") +} +func (UnimplementedInfoTrackerServer) UpdateChannelInfos(context.Context, *UpdateChannelInfosReq) (*EmptyRes, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateChannelInfos not implemented") +} +func (UnimplementedInfoTrackerServer) GetChannelInfo(context.Context, *SimpleFilter) (*ChannelInfo, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetChannelInfo not implemented") +} +func (UnimplementedInfoTrackerServer) GetChannels(context.Context, *ListReq) (*NodeInfosRes, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetChannels not implemented") +} +func (UnimplementedInfoTrackerServer) UpdateHtlcInfo(context.Context, *HtlcInfo) (*HtlcInfo, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateHtlcInfo not implemented") +} +func (UnimplementedInfoTrackerServer) HtlcGetPath(context.Context, *HtlcGetPathReq) (*HtlcGetPathRes, error) { + return nil, status.Errorf(codes.Unimplemented, "method HtlcGetPath not implemented") +} +func (UnimplementedInfoTrackerServer) GetHtlcInfo(context.Context, *GetHtlcInfoReq) (*HtlcInfo, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetHtlcInfo not implemented") +} +func (UnimplementedInfoTrackerServer) mustEmbedUnimplementedInfoTrackerServer() {} + +// UnsafeInfoTrackerServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to InfoTrackerServer will +// result in compilation errors. +type UnsafeInfoTrackerServer interface { + mustEmbedUnimplementedInfoTrackerServer() +} + +func RegisterInfoTrackerServer(s grpc.ServiceRegistrar, srv InfoTrackerServer) { + s.RegisterService(&InfoTracker_ServiceDesc, srv) +} + +func _InfoTracker_HeartBeat_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(InfoTrackerServer).HeartBeat(&infoTrackerHeartBeatServer{stream}) +} + +type InfoTracker_HeartBeatServer interface { + SendAndClose(*EmptyRes) error + Recv() (*UpdateNodeInfoReq, error) + grpc.ServerStream +} + +type infoTrackerHeartBeatServer struct { + grpc.ServerStream +} + +func (x *infoTrackerHeartBeatServer) SendAndClose(m *EmptyRes) error { + return x.ServerStream.SendMsg(m) +} + +func (x *infoTrackerHeartBeatServer) Recv() (*UpdateNodeInfoReq, error) { + m := new(UpdateNodeInfoReq) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func _InfoTracker_UpdateNodeInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateNodeInfoReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(InfoTrackerServer).UpdateNodeInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/tkrpc.InfoTracker/UpdateNodeInfo", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InfoTrackerServer).UpdateNodeInfo(ctx, req.(*UpdateNodeInfoReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _InfoTracker_UpdateUserInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateUserInfoReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(InfoTrackerServer).UpdateUserInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/tkrpc.InfoTracker/UpdateUserInfo", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InfoTrackerServer).UpdateUserInfo(ctx, req.(*UpdateUserInfoReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _InfoTracker_UpdateUserInfos_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateUserInfosReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(InfoTrackerServer).UpdateUserInfos(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/tkrpc.InfoTracker/UpdateUserInfos", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InfoTrackerServer).UpdateUserInfos(ctx, req.(*UpdateUserInfosReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _InfoTracker_GetUserInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateUserInfoReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(InfoTrackerServer).GetUserInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/tkrpc.InfoTracker/GetUserInfo", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InfoTrackerServer).GetUserInfo(ctx, req.(*UpdateUserInfoReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _InfoTracker_GetUserInfos_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(InfoTrackerServer).GetUserInfos(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/tkrpc.InfoTracker/GetUserInfos", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InfoTrackerServer).GetUserInfos(ctx, req.(*ListReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _InfoTracker_GetNodes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(InfoTrackerServer).GetNodes(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/tkrpc.InfoTracker/GetNodes", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InfoTrackerServer).GetNodes(ctx, req.(*ListReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _InfoTracker_UpdateChannelInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ChannelInfo) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(InfoTrackerServer).UpdateChannelInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/tkrpc.InfoTracker/UpdateChannelInfo", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InfoTrackerServer).UpdateChannelInfo(ctx, req.(*ChannelInfo)) + } + return interceptor(ctx, in, info, handler) +} + +func _InfoTracker_UpdateChannelInfos_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateChannelInfosReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(InfoTrackerServer).UpdateChannelInfos(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/tkrpc.InfoTracker/UpdateChannelInfos", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InfoTrackerServer).UpdateChannelInfos(ctx, req.(*UpdateChannelInfosReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _InfoTracker_GetChannelInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SimpleFilter) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(InfoTrackerServer).GetChannelInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/tkrpc.InfoTracker/GetChannelInfo", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InfoTrackerServer).GetChannelInfo(ctx, req.(*SimpleFilter)) + } + return interceptor(ctx, in, info, handler) +} + +func _InfoTracker_GetChannels_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(InfoTrackerServer).GetChannels(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/tkrpc.InfoTracker/GetChannels", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InfoTrackerServer).GetChannels(ctx, req.(*ListReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _InfoTracker_UpdateHtlcInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(HtlcInfo) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(InfoTrackerServer).UpdateHtlcInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/tkrpc.InfoTracker/UpdateHtlcInfo", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InfoTrackerServer).UpdateHtlcInfo(ctx, req.(*HtlcInfo)) + } + return interceptor(ctx, in, info, handler) +} + +func _InfoTracker_HtlcGetPath_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(HtlcGetPathReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(InfoTrackerServer).HtlcGetPath(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/tkrpc.InfoTracker/HtlcGetPath", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InfoTrackerServer).HtlcGetPath(ctx, req.(*HtlcGetPathReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _InfoTracker_GetHtlcInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetHtlcInfoReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(InfoTrackerServer).GetHtlcInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/tkrpc.InfoTracker/GetHtlcInfo", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InfoTrackerServer).GetHtlcInfo(ctx, req.(*GetHtlcInfoReq)) + } + return interceptor(ctx, in, info, handler) +} + +// InfoTracker_ServiceDesc is the grpc.ServiceDesc for InfoTracker service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var InfoTracker_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "tkrpc.InfoTracker", + HandlerType: (*InfoTrackerServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "UpdateNodeInfo", + Handler: _InfoTracker_UpdateNodeInfo_Handler, + }, + { + MethodName: "UpdateUserInfo", + Handler: _InfoTracker_UpdateUserInfo_Handler, + }, + { + MethodName: "UpdateUserInfos", + Handler: _InfoTracker_UpdateUserInfos_Handler, + }, + { + MethodName: "GetUserInfo", + Handler: _InfoTracker_GetUserInfo_Handler, + }, + { + MethodName: "GetUserInfos", + Handler: _InfoTracker_GetUserInfos_Handler, + }, + { + MethodName: "GetNodes", + Handler: _InfoTracker_GetNodes_Handler, + }, + { + MethodName: "UpdateChannelInfo", + Handler: _InfoTracker_UpdateChannelInfo_Handler, + }, + { + MethodName: "UpdateChannelInfos", + Handler: _InfoTracker_UpdateChannelInfos_Handler, + }, + { + MethodName: "GetChannelInfo", + Handler: _InfoTracker_GetChannelInfo_Handler, + }, + { + MethodName: "GetChannels", + Handler: _InfoTracker_GetChannels_Handler, + }, + { + MethodName: "UpdateHtlcInfo", + Handler: _InfoTracker_UpdateHtlcInfo_Handler, + }, + { + MethodName: "HtlcGetPath", + Handler: _InfoTracker_HtlcGetPath_Handler, + }, + { + MethodName: "GetHtlcInfo", + Handler: _InfoTracker_GetHtlcInfo_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "HeartBeat", + Handler: _InfoTracker_HeartBeat_Handler, + ClientStreams: true, + }, + }, + Metadata: "info-tracker.proto", +} diff --git a/tracker/tkrpc/inforpc/htlc.go b/tracker/tkrpc/inforpc/htlc.go new file mode 100644 index 000000000..81b982795 --- /dev/null +++ b/tracker/tkrpc/inforpc/htlc.go @@ -0,0 +1,211 @@ +package inforpc + +import ( + "errors" + "github.com/omnilaboratory/obd/tool" + "github.com/omnilaboratory/obd/tracker/config" + "github.com/omnilaboratory/obd/tracker/service" + "github.com/omnilaboratory/obd/tracker/tkrpc" + "github.com/shopspring/decimal" + "log" + "strings" + "sync" +) + +type graphEdge struct { + ParentNodeIndex int + PathPeerIds string + ChannelIds string + PathIndexArr []int + ChannelId string + Level uint16 + CurrNodePeerId string + IsRoot bool + IsTarget bool +} + +type htlcManager struct { + mu sync.Mutex + openList []*graphEdge +} + +var HtlcService htlcManager + +func (manager *htlcManager) getPath( msgData string,pathRequest *tkrpc.HtlcGetPathReq ) (*tkrpc.HtlcGetPathRes ,error) { + manager.mu.Lock() + defer manager.mu.Unlock() + log.Println("getPath", msgData) + if tool.CheckIsString(&pathRequest.RealPayerPeerId) == false { + return nil, errors.New("wrong realPayerPeerId") + } + if tool.CheckIsString(&pathRequest.PayeePeerId) == false { + return nil, errors.New("wrong SendeePeerId") + } + if pathRequest.Amount < tool.GetOmniDustBtc() { + return nil, errors.New("wrong amount") + } + manager.createChannelNetwork(pathRequest.RealPayerPeerId, pathRequest.PayeePeerId, pathRequest.PropertyId, pathRequest.Amount, nil, true) + resultIndex := manager.getPathIndex() + + res:=new(tkrpc.HtlcGetPathRes) + res.SenderPeerId = pathRequest.RealPayerPeerId + res.H = pathRequest.H + res.Amount = pathRequest.Amount + if resultIndex != -1 { + splitArr := strings.Split(manager.openList[resultIndex].ChannelIds, ",") + path := "" + for i := len(splitArr) - 1; i > -1; i-- { + path += splitArr[i] + "," + } + path = strings.TrimSuffix(path, ",") + res.Path = path + } + log.Println("return path info", res) + return res, nil +} + +func (manager *htlcManager) getPathIndex() int { + resultIndex := -1 + minLength := 99 + for index, node := range manager.openList { + if node.IsTarget { + log.Println(node.ChannelIds) + tempLength := len(strings.Split(node.ChannelIds, ",")) + if tempLength < minLength { + resultIndex = index + minLength = tempLength + } + } + } + if resultIndex != -1 { + channelIdArr := strings.Split(manager.openList[resultIndex].ChannelIds, ",") + lockResult := true + for _, item := range channelIdArr { + channelInfo:=new(tkrpc.ChannelInfo) + err:=Orm.First(channelInfo,tkrpc.ChannelInfo{ChannelId: item,CurrState: tkrpc.ChannelState_CanUse}).Error + if err == nil { + if len(channelInfo.ObdNodeIda) > 0 && service.SendChannelLockInfoToObd(channelInfo.ChannelId, channelInfo.PeerIda, channelInfo.ObdNodeIda,false) == false { + lockResult = false + break + } + + if len(channelInfo.ObdNodeIdb) > 0 && service.SendChannelLockInfoToObd(channelInfo.ChannelId, channelInfo.PeerIdb, channelInfo.ObdNodeIdb,false) == false { + lockResult = false + break + } + } + } + if lockResult == false { + manager.openList = append(manager.openList[:resultIndex], manager.openList[resultIndex+1:]...) + return manager.getPathIndex() + } else { + for _, item := range channelIdArr { + channelInfo:=new(tkrpc.ChannelInfo) + err:=Orm.First(channelInfo,tkrpc.ChannelInfo{ChannelId: item,CurrState: tkrpc.ChannelState_CanUse}).Error + if err == nil { + channelInfo.CurrState =tkrpc.ChannelState_LockByTracker + Orm.Save(channelInfo) + } + } + htlcPath := tkrpc.LockHtlcPath{Path: strings.Join(channelIdArr,","), CurrState: 0} + Orm.Save(&htlcPath) + } + } + return resultIndex +} + +func (manager *htlcManager) createChannelNetwork(realPayerPeerId, currPayeePeerId string, propertyId int64, amount float64, currNode *graphEdge, isBegin bool) { + if isBegin { + manager.openList = make([]*graphEdge, 0) + realPayeeEdge := &graphEdge{ + ParentNodeIndex: -1, + CurrNodePeerId: currPayeePeerId, + PathPeerIds: "", + ChannelIds: "", + PathIndexArr: make([]int, 0), + Level: 0, + IsRoot: true, + IsTarget: false, + } + manager.openList = append(manager.openList, realPayeeEdge) + } + + if currNode == nil { + currNode = manager.openList[0] + } + //如果当前用户已经在备选的用户列表中出现了,就return + if strings.Contains(currNode.PathPeerIds, currNode.CurrNodePeerId) { + return + } + + if currNode.Level > 0 { + amount, _ = decimal.NewFromFloat(amount).Mul(decimal.NewFromFloat(1 + cfg.HtlcFeeRate*float64(currNode.Level))).Round(8).Float64() + } + + currNodeIndex := 0 + for index, tempNode := range manager.openList { + if tempNode == currNode { + currNodeIndex = index + break + } + } + pathPeerIds := currNode.PathPeerIds + "," + currNode.CurrNodePeerId + pathIndexArr := currNode.PathIndexArr + if currNode.PathPeerIds == "" { + pathPeerIds = currNode.CurrNodePeerId + pathIndexArr = make([]int, 0) + } + pathIndexArr = append(pathIndexArr, currNodeIndex) + + var nodes []tkrpc.ChannelInfo + err:=Orm.Where(tkrpc.ChannelInfo{PropertyId:propertyId,CurrState: tkrpc.ChannelState_CanUse}).Or(tkrpc.ChannelInfo{PeerIdb:currPayeePeerId,PeerIda: currPayeePeerId}).Find(&nodes).Order("id desc") + if err == nil { + for _, item := range nodes { + + // check userOnline + if getUserState( item.PeerIda) == false { + continue + } + if getUserState( item.PeerIdb) == false { + continue + } + + interSender := item.PeerIda + leftAmount := item.AmountA + if item.PeerIda == currPayeePeerId { + interSender = item.PeerIdb + leftAmount = item.AmountB + } + + if leftAmount >= amount { + channelIds := item.ChannelId + if tool.CheckIsString(&currNode.ChannelIds) { + channelIds = currNode.ChannelIds + "," + item.ChannelId + } + + newEdge := graphEdge{ + ParentNodeIndex: currNodeIndex, + PathPeerIds: pathPeerIds, + PathIndexArr: pathIndexArr, + Level: currNode.Level + 1, + IsRoot: false, + IsTarget: false, + CurrNodePeerId: interSender, + ChannelId: item.ChannelId, + ChannelIds: channelIds, + } + manager.openList = append(manager.openList, &newEdge) + + if interSender == realPayerPeerId { + newEdge.IsTarget = true + newEdge.PathPeerIds += "," + newEdge.CurrNodePeerId + } else { + if newEdge.Level < 6 { + manager.createChannelNetwork(realPayerPeerId, interSender, propertyId, amount, &newEdge, false) + } + } + } + } + } +} + diff --git a/tracker/tkrpc/inforpc/info.go b/tracker/tkrpc/inforpc/info.go new file mode 100644 index 000000000..570f9792f --- /dev/null +++ b/tracker/tkrpc/inforpc/info.go @@ -0,0 +1,200 @@ +package inforpc + +import ( + "context" + "github.com/omnilaboratory/obd/tool" + cfg "github.com/omnilaboratory/obd/tracker/config" + "github.com/omnilaboratory/obd/tracker/tkrpc" + "time" +) + +var Orm=cfg.Orm +type ImpInfoServer struct { + tkrpc.UnimplementedInfoTrackerServer +} +func (s *ImpInfoServer) HeartBeat(heartBeatServer tkrpc.InfoTracker_HeartBeatServer) error { + var ninfo *tkrpc.NodeInfo + defer func() { + if ninfo != nil { + ninfo.IsOnline = 2 + Orm.Save(ninfo) + } + }() + for { + req, err := heartBeatServer.Recv() + if err != nil { + break + } + if ninfo == nil { + err = Orm.FirstOrCreate(ninfo, tkrpc.NodeInfo{NodeId: req.NodeId, P2PAddress: req.P2PAddress}).Error + if err != nil { + break + } + } + ninfo.HearBeatCounter += 1 + ninfo.LastHearBeat = time.Now().Unix() + ninfo.IsOnline = 1 + Orm.Save(ninfo) + } + return nil +} + +func (s *ImpInfoServer) UpdateNodeInfo(ctx context.Context, req *tkrpc.UpdateNodeInfoReq) (*tkrpc.EmptyRes, error) { + panic("implement me") +} + +func (s *ImpInfoServer) UpdateUserInfo(ctx context.Context, req *tkrpc.UpdateUserInfoReq) (*tkrpc.EmptyRes, error) { + uinfo := new(tkrpc.UserInfo) + err := Orm.FirstOrCreate(uinfo, tkrpc.UserInfo{UserId: req.UserId, NodeId: req.NodeId}).Assign(tkrpc.UserInfo{IsOnline: req.IsOnline}).Error + return &tkrpc.EmptyRes{}, err +} + +func (s *ImpInfoServer) UpdateUserInfos(ctx context.Context, req *tkrpc.UpdateUserInfosReq) (*tkrpc.EmptyRes, error) { + var err error + for _, uinfo := range req.UpdateUserInfoReqs { + err = Orm.FirstOrCreate(uinfo, tkrpc.UserInfo{UserId: uinfo.UserId, NodeId: uinfo.NodeId}).Assign(tkrpc.UserInfo{IsOnline: uinfo.IsOnline}).Error + if err != nil { + break + } + } + return &tkrpc.EmptyRes{}, err +} + +func (s *ImpInfoServer) GetUserInfo(ctx context.Context, req *tkrpc.UpdateUserInfoReq) (uinfo *tkrpc.UserInfo, err error) { + err=Orm.First(uinfo,tkrpc.UserInfo{UserId: req.UserId,NodeId: req.NodeId}).Error + return +} + +func (s *ImpInfoServer) GetUserInfos(ctx context.Context, req *tkrpc.ListReq) (list *tkrpc.UserInfosRes, err error) { + list=new(tkrpc.UserInfosRes) + Orm.Model(tkrpc.UserInfo{}).Count(&list.Count) + err=Orm.Limit(req.Limit()).Offset(req.Offset()).Order(req.SortStr()).Find(&list.Results).Error + return +} + +func (s *ImpInfoServer) GetNodes(ctx context.Context, req *tkrpc.ListReq) (list *tkrpc.NodeInfosRes, err error) { + list=new(tkrpc.NodeInfosRes) + Orm.Model(tkrpc.NodeInfo{}).Count(&list.Count) + err=Orm.Limit(req.Limit()).Offset(req.Offset()).Order(req.SortStr()).Find(&list.Results).Error + return +} + +func (s *ImpInfoServer) UpdateChannelInfo(ctx context.Context, info *tkrpc.ChannelInfo) (*tkrpc.ChannelInfo, error) { + panic("implement me") +} + +func (s *ImpInfoServer) UpdateChannelInfos(ctx context.Context, info *tkrpc.UpdateChannelInfosReq) (*tkrpc.EmptyRes, error) { + for _, item := range info.ChannelInfos { + err:=item.ValidteClientData() + if err != nil { + return nil,err + } + channelInfo:=new(tkrpc.ChannelInfo) + Orm.First(channelInfo,tkrpc.ChannelInfo{ChannelId: item.ChannelId}) + if channelInfo.Id==0{ + channelInfo.ChannelId = item.ChannelId + channelInfo.PropertyId = item.PropertyId + channelInfo.CurrState = item.CurrState + channelInfo.PeerIda = item.PeerIda + channelInfo.PeerIdb = item.PeerIdb + channelInfo.AmountA = item.AmountA + channelInfo.AmountB = item.AmountB + }else{ + channelInfo.PropertyId = item.PropertyId + if channelInfo.CurrState != tkrpc.ChannelState_Close { + channelInfo.CurrState = item.CurrState + channelInfo.PeerIda = item.PeerIda + channelInfo.PeerIdb = item.PeerIdb + channelInfo.AmountA = item.AmountA + channelInfo.AmountB = item.AmountB + } + } + if item.IsAlice { + channelInfo.ObdNodeIda = item.NodeId + } else { + channelInfo.ObdNodeIdb = item.NodeId + } + err=Orm.Save(channelInfo).Error + if err != nil { + return &tkrpc.EmptyRes{}, err + } + } + return &tkrpc.EmptyRes{},nil +} + +func (s *ImpInfoServer) GetChannelInfo(ctx context.Context, filter *tkrpc.SimpleFilter) ( info *tkrpc.ChannelInfo, err error) { + err=Orm.First(info,tkrpc.ChannelInfo{ChannelId: filter.ChannelId}).Error + return +} + +func (s *ImpInfoServer) GetChannels(ctx context.Context, req *tkrpc.ListReq) (res *tkrpc.NodeInfosRes, err error) { + res=new(tkrpc.NodeInfosRes) + Orm.Count(&res.Count) + err=Orm.Offset(req.Offset()).Limit(req.Limit()).Find(&res.Results).Error + return +} + +func (s *ImpInfoServer) UpdateHtlcInfo(ctx context.Context, req *tkrpc.HtlcInfo) (*tkrpc.HtlcInfo, error) { + err := req.ValidteClientData() + if err != nil { + return nil, err + } + info := new(tkrpc.HtlcInfo) + err = Orm.FirstOrCreate(info, tkrpc.HtlcInfo{Path: req.Path, H: req.H}).Error + if err == nil { + if tool.CheckIsString(&req.R) == false && tool.CheckIsString(&req.R) { + info.R = req.R + } + info.DirectionFlag = req.DirectionFlag + info.CurrChannelId = req.CurrChannelId + err = Orm.Save(info).Error + } + return info, err +} + +func (s *ImpInfoServer) HtlcGetPath(ctx context.Context, req *tkrpc.HtlcGetPathReq) (*tkrpc.HtlcGetPathRes, error) { + panic("implement me") +} +func (s *ImpInfoServer) GetHtlcInfo(ctx context.Context, req *tkrpc.GetHtlcInfoReq) (res *tkrpc.HtlcInfo, err error) { + err = Orm.First(res, req).Error + return +} + +//func (s *ImpInfoServer) mustEmbedUnimplementedInfoTrackerServer() { +// panic("implement me") +//} + +/* +//every HeartBeat will set nodeInfo.isonline=true; every HeartBeat disconnect will set nodeInfo.isonline=false; + HeartBeat(ctx context.Context, opts ...grpc.CallOption) (InfoTracker_HeartBeatClient, error) + //map to old func Logout Login + UpdateNodeInfo(ctx context.Context, in *UpdateNodeInfoReq, opts ...grpc.CallOption) (*EmptyRes, error) + //map to old func userLogout userLogin + UpdateUserInfo(ctx context.Context, in *UpdateUserInfoReq, opts ...grpc.CallOption) (*EmptyRes, error) + //map to old func updateUsers + UpdateUserInfos(ctx context.Context, in *UpdateUserInfosReq, opts ...grpc.CallOption) (*EmptyRes, error) + //map to old func: GetUserState , GetUserP2pNodeId + //Request:SetUserInfoReq{user_id,node_Id} + //old GetUserP2pNodeId use request:SetUserInfoReq{user_id} ; may not work when user login on multi node + GetUserInfo(ctx context.Context, in *UpdateUserInfoReq, opts ...grpc.CallOption) (*UserInfo, error) + //Map to old function GetAllUsers + GetUserInfos(ctx context.Context, in *ListReq, opts ...grpc.CallOption) (*UserInfosRes, error) + //map old function GetAllObdNodes + GetNodes(ctx context.Context, in *ListReq, opts ...grpc.CallOption) (*NodeInfosRes, error) + UpdateChannelInfo(ctx context.Context, in *ChannelInfo, opts ...grpc.CallOption) (*ChannelInfo, error) + //map to old ChannelService.GetChannelState + GetChannelInfo(ctx context.Context, in *SimpleFilter, opts ...grpc.CallOption) (*ChannelInfo, error) + GetChannels(ctx context.Context, in *ListReq, opts ...grpc.CallOption) (*NodeInfosRes, error) + // map old function updateHtlcInfo + UpdateHtlcInfo(ctx context.Context, in *HtlcInfo, opts ...grpc.CallOption) (*HtlcInfo, error) + //map old function getPath + HtlcGetPath(ctx context.Context, in *HtlcGetPathReq, opts ...grpc.CallOption) (*HtlcGetPathRes, error) + //map old function GetHtlcCurrState + GetHtlcInfo(ctx context.Context, in *GetHtlcInfoReq, opts ...grpc.CallOption) (*HtlcInfo, error) +*/ + +func getUserState(userId string) bool { + uinfo:=new(tkrpc.UserInfo) + Orm.First(uinfo,tkrpc.UserInfo{UserId: userId}) + return uinfo.IsOnline==1 +} \ No newline at end of file diff --git a/tracker/tkrpc/swagger/info-tracker.swagger.json b/tracker/tkrpc/swagger/info-tracker.swagger.json new file mode 100644 index 000000000..3c3710a6b --- /dev/null +++ b/tracker/tkrpc/swagger/info-tracker.swagger.json @@ -0,0 +1,864 @@ +{ + "swagger": "2.0", + "info": { + "title": "info-tracker.proto", + "version": "version not set" + }, + "tags": [ + { + "name": "InfoTracker" + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": { + "/gw/GetChannelInfo/{id}": { + "get": { + "summary": "map to old ChannelService.GetChannelState", + "operationId": "InfoTracker_GetChannelInfo", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/tkrpcChannelInfo" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "channel_id", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "user_id", + "in": "query", + "required": false, + "type": "string" + } + ], + "tags": [ + "InfoTracker" + ] + } + }, + "/gw/GetChannels": { + "get": { + "operationId": "InfoTracker_GetChannels", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/tkrpcNodeInfosRes" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "page", + "description": "page number.", + "in": "query", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "size", + "description": "page size.", + "in": "query", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "sort", + "description": "sort set the sql order-by sort=[-]field_name . example sort=-updated_at will sort by:\"desc id\";sort=updated_at sort by:\"asc id\".", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "user_id", + "in": "query", + "required": false, + "type": "string" + } + ], + "tags": [ + "InfoTracker" + ] + } + }, + "/gw/GetHtlcInfo": { + "post": { + "summary": "map old function GetHtlcCurrState", + "operationId": "InfoTracker_GetHtlcInfo", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/tkrpcHtlcInfo" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/tkrpcGetHtlcInfoReq" + } + } + ], + "tags": [ + "InfoTracker" + ] + } + }, + "/gw/GetNodes": { + "post": { + "summary": "map old function GetAllObdNodes", + "operationId": "InfoTracker_GetNodes", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/tkrpcNodeInfosRes" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "page", + "description": "page number.", + "in": "query", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "size", + "description": "page size.", + "in": "query", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "sort", + "description": "sort set the sql order-by sort=[-]field_name . example sort=-updated_at will sort by:\"desc id\";sort=updated_at sort by:\"asc id\".", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "user_id", + "in": "query", + "required": false, + "type": "string" + } + ], + "tags": [ + "InfoTracker" + ] + } + }, + "/gw/GetUserInfo": { + "post": { + "summary": "map to old func: GetUserState , GetUserP2pNodeId\nRequest:SetUserInfoReq{user_id,node_Id}\nold GetUserP2pNodeId use request:SetUserInfoReq{user_id} ; may not work when user login on multi node", + "operationId": "InfoTracker_GetUserInfo", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/tkrpcUserInfo" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/tkrpcUpdateUserInfoReq" + } + } + ], + "tags": [ + "InfoTracker" + ] + } + }, + "/gw/GetUserInfos": { + "get": { + "summary": "Map to old function GetAllUsers", + "operationId": "InfoTracker_GetUserInfos", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/tkrpcUserInfosRes" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "page", + "description": "page number.", + "in": "query", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "size", + "description": "page size.", + "in": "query", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "sort", + "description": "sort set the sql order-by sort=[-]field_name . example sort=-updated_at will sort by:\"desc id\";sort=updated_at sort by:\"asc id\".", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "user_id", + "in": "query", + "required": false, + "type": "string" + } + ], + "tags": [ + "InfoTracker" + ] + } + }, + "/gw/HeartBeat": { + "post": { + "summary": "every HeartBeat will set nodeInfo.isonline=true; every HeartBeat disconnect will set nodeInfo.isonline=false;", + "operationId": "InfoTracker_HeartBeat", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/tkrpcEmptyRes" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "description": " (streaming inputs)", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/tkrpcUpdateNodeInfoReq" + } + } + ], + "tags": [ + "InfoTracker" + ] + } + }, + "/gw/HtlcGetPath": { + "post": { + "summary": "map old function getPath", + "operationId": "InfoTracker_HtlcGetPath", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/tkrpcHtlcGetPathRes" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/tkrpcHtlcGetPathReq" + } + } + ], + "tags": [ + "InfoTracker" + ] + } + }, + "/gw/SetUserInfo": { + "post": { + "summary": "map to old func userLogout userLogin", + "operationId": "InfoTracker_UpdateUserInfo", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/tkrpcEmptyRes" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/tkrpcUpdateUserInfoReq" + } + } + ], + "tags": [ + "InfoTracker" + ] + } + }, + "/gw/SetUserInfos": { + "post": { + "summary": "map to old func updateUsers", + "operationId": "InfoTracker_UpdateUserInfos", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/tkrpcEmptyRes" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/tkrpcUpdateUserInfosReq" + } + } + ], + "tags": [ + "InfoTracker" + ] + } + }, + "/gw/UpdateChannelInfo": { + "post": { + "operationId": "InfoTracker_UpdateChannelInfo", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/tkrpcChannelInfo" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/tkrpcChannelInfo" + } + } + ], + "tags": [ + "InfoTracker" + ] + } + }, + "/gw/UpdateHtlcInfo": { + "post": { + "summary": "map old function updateHtlcInfo", + "operationId": "InfoTracker_UpdateHtlcInfo", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/tkrpcHtlcInfo" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/tkrpcHtlcInfo" + } + } + ], + "tags": [ + "InfoTracker" + ] + } + }, + "/gw/UpdateNodeInfo": { + "post": { + "summary": "map to old func Logout Login", + "operationId": "InfoTracker_UpdateNodeInfo", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/tkrpcEmptyRes" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/tkrpcUpdateNodeInfoReq" + } + } + ], + "tags": [ + "InfoTracker" + ] + } + } + }, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "$ref": "#/definitions/protobufAny" + } + } + } + }, + "tkrpcChannelInfo": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int32" + }, + "obd_node_ida": { + "type": "string" + }, + "obd_node_idb": { + "type": "string" + }, + "channel_id": { + "type": "string" + }, + "property_id": { + "type": "string", + "format": "int64" + }, + "curr_state": { + "$ref": "#/definitions/tkrpcChannelState" + }, + "peer_ida": { + "type": "string" + }, + "peer_idb": { + "type": "string" + }, + "amount_a": { + "type": "number", + "format": "double" + }, + "amount_b": { + "type": "number", + "format": "double" + }, + "updated_at": { + "type": "string", + "format": "int64" + }, + "created_at": { + "type": "string", + "format": "int64" + }, + "is_alice": { + "type": "boolean", + "title": "database will not store it" + }, + "node_id": { + "type": "string", + "title": "database will not store it" + } + } + }, + "tkrpcChannelState": { + "type": "integer", + "format": "int32", + "enum": [ + "0", + "10", + "11", + "12", + "20", + "21", + "22", + "23", + "30" + ], + "default": "0" + }, + "tkrpcEmptyRes": { + "type": "object", + "title": "Empty response" + }, + "tkrpcGetHtlcInfoReq": { + "type": "object", + "properties": { + "h": { + "type": "string" + }, + "path": { + "type": "string" + } + } + }, + "tkrpcHtlcGetPathReq": { + "type": "object", + "properties": { + "payer_obd_node_id": { + "type": "string" + }, + "real_payer_peer_id": { + "type": "string" + }, + "payee_peer_id": { + "type": "string" + }, + "property_id": { + "type": "string", + "format": "int64" + }, + "h": { + "type": "string" + }, + "amount": { + "type": "number", + "format": "double" + } + } + }, + "tkrpcHtlcGetPathRes": { + "type": "object", + "properties": { + "senderPeerId": { + "type": "string" + }, + "h": { + "type": "string" + }, + "amount": { + "type": "number", + "format": "double" + }, + "path": { + "type": "string" + } + } + }, + "tkrpcHtlcInfo": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int32" + }, + "path": { + "type": "string" + }, + "h": { + "type": "string" + }, + "r": { + "type": "string" + }, + "direction_flag": { + "type": "integer", + "format": "int32" + }, + "curr_channel_id": { + "type": "string" + }, + "updated_at": { + "type": "string", + "format": "int64" + }, + "created_at": { + "type": "string", + "format": "int64" + } + } + }, + "tkrpcNodeInfo": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int32" + }, + "node_id": { + "type": "string", + "title": "node_peer_id" + }, + "p2p_address": { + "type": "string" + }, + "access_ip": { + "type": "string" + }, + "is_online": { + "type": "integer", + "format": "int32", + "title": "1 online 2 offline" + }, + "hear_beat_counter": { + "type": "integer", + "format": "int32" + }, + "last_hear_beat": { + "type": "string", + "format": "int64" + }, + "updated_at": { + "type": "string", + "format": "int64", + "description": "unix timestamp in seconds ; google.protobuf.Timestamp will more better,but sql database not support." + }, + "created_at": { + "type": "string", + "format": "int64" + } + }, + "title": "obd-node info" + }, + "tkrpcNodeInfosRes": { + "type": "object", + "properties": { + "count": { + "type": "string", + "format": "int64" + }, + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/tkrpcNodeInfo" + } + } + } + }, + "tkrpcUpdateNodeInfoReq": { + "type": "object", + "properties": { + "node_id": { + "type": "string" + }, + "p2p_address": { + "type": "string" + }, + "is_online": { + "type": "integer", + "format": "int32", + "title": "1 online 2 offline" + } + } + }, + "tkrpcUpdateUserInfoReq": { + "type": "object", + "properties": { + "user_id": { + "type": "string" + }, + "node_id": { + "type": "string" + }, + "p2p_address": { + "type": "string" + }, + "is_online": { + "type": "integer", + "format": "int32", + "title": "1 online 2 offline" + } + } + }, + "tkrpcUpdateUserInfosReq": { + "type": "object", + "properties": { + "UpdateUserInfoReqs": { + "type": "array", + "items": { + "$ref": "#/definitions/tkrpcUpdateUserInfoReq" + } + } + } + }, + "tkrpcUserInfo": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int32" + }, + "user_id": { + "type": "string", + "title": "user_peer_id" + }, + "node_id": { + "type": "string", + "title": "node_peer_id" + }, + "is_online": { + "type": "integer", + "format": "int32", + "title": "1 online 2 offline" + }, + "access_ip": { + "type": "string" + }, + "updated_at": { + "type": "string", + "format": "int64" + }, + "created_at": { + "type": "string", + "format": "int64" + } + }, + "title": "obd-user-info" + }, + "tkrpcUserInfosRes": { + "type": "object", + "properties": { + "count": { + "type": "string", + "format": "int64" + }, + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/tkrpcUserInfo" + } + } + } + } + } +} diff --git a/tracker/tracker_server.go b/tracker/tracker_server.go index 5c9dbd93f..49dfaf7df 100644 --- a/tracker/tracker_server.go +++ b/tracker/tracker_server.go @@ -7,8 +7,12 @@ import ( "github.com/omnilaboratory/obd/tracker/router" "github.com/omnilaboratory/obd/tracker/rpc" "github.com/omnilaboratory/obd/tracker/service" + "github.com/omnilaboratory/obd/tracker/tkrpc" + "github.com/omnilaboratory/obd/tracker/tkrpc/inforpc" + "google.golang.org/grpc" "io" "log" + "net" "net/http" "os" "strconv" @@ -49,7 +53,8 @@ func main() { } service.Start(cfg.ChainNode_Type) - service.StartP2PNode() + go service.StartP2PNode() + go StartGrpc() routersInit := router.InitRouter() if routersInit == nil { @@ -68,3 +73,16 @@ func main() { log.Println("tracker " + service.GetTrackerNodeId() + " start at port: " + strconv.Itoa(cfg.TrackerServerPort) + " in " + cfg.ChainNode_Type) log.Fatal(server.ListenAndServe()) } +func StartGrpc(){ + log.Println("StartGrpc") + lis, err := net.Listen("tcp", "0.0.0.0:"+cfg.TrackerServerGrpcPort) + if err != nil { + log.Fatalf("无法绑定grpc地址: %v", err) + } + log.Println("grpc server start at: 0.0.0.0:"+cfg.TrackerServerGrpcPort) + s := grpc.NewServer() + //reflection.Register(s) + tkrpc.RegisterInfoTrackerServer(s,&inforpc.ImpInfoServer{}) + s.Serve(lis) + +}