From 8d73aa09e0b9940b96b03b75689918a3d1f6cdad Mon Sep 17 00:00:00 2001 From: UlyanaAndrukhiv Date: Thu, 28 Mar 2024 11:34:09 +0200 Subject: [PATCH 1/3] Added new subscribe events endpoints --- go.mod | 6 ++++++ go.sum | 8 ++++---- server/access/streamBackend.go | 12 ++++++++++++ 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index e13923b5..761a9ffc 100644 --- a/go.mod +++ b/go.mod @@ -208,3 +208,9 @@ require ( nhooyr.io/websocket v1.8.7 // indirect rsc.io/tmplfunc v0.0.3 // indirect ) + +// TODO: Remove when it will be merged +replace github.com/onflow/flow/protobuf/go/flow v0.3.7-0.20240305102946-3efec6679252 => github.com/The-K-R-O-K/flow/protobuf/go/flow v0.0.0-20240325091550-e992f45aaa3e + +// TODO: Remove when it will be merged +replace github.com/onflow/flow-go v0.33.2-0.20240321224153-02cdb601e0b0 => github.com/The-K-R-O-K/flow-go v0.0.0-20240327190034-0048cab3d3ca diff --git a/go.sum b/go.sum index a40580c9..9f5ea754 100644 --- a/go.sum +++ b/go.sum @@ -85,6 +85,10 @@ github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMx github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= github.com/StackExchange/wmi v1.2.1 h1:VIkavFPXSjcnS+O8yTq7NI32k0R5Aj+v39y29VYDOSA= github.com/StackExchange/wmi v1.2.1/go.mod h1:rcmrprowKIVzvc+NUiLncP2uuArMWLCbu9SBzvHz7e8= +github.com/The-K-R-O-K/flow-go v0.0.0-20240327190034-0048cab3d3ca h1:OwPJRhfTM5JQc0LoqCQWOgphTsk/kmxNBxL8RI4IcQ8= +github.com/The-K-R-O-K/flow-go v0.0.0-20240327190034-0048cab3d3ca/go.mod h1:v3wUUv5ma76KNJRJMwIhz5QdG5n7BR+z0Xh7m9jbavI= +github.com/The-K-R-O-K/flow/protobuf/go/flow v0.0.0-20240325091550-e992f45aaa3e h1:6CCZCTEWUkUEAJ2FMzbGwolbr+sFbnjHg6tmhOverhY= +github.com/The-K-R-O-K/flow/protobuf/go/flow v0.0.0-20240325091550-e992f45aaa3e/go.mod h1:NA2pX2nw8zuaxfKphhKsk00kWLwfd+tv8mS23YXO4Sk= github.com/VictoriaMetrics/fastcache v1.5.3/go.mod h1:+jv9Ckb+za/P1ZRg/sulP5Ni1v49daAVERr0H3CuscE= github.com/VictoriaMetrics/fastcache v1.12.1 h1:i0mICQuojGDL3KblA7wUNlY5lOK6a4bwt3uRKnkZU40= github.com/VictoriaMetrics/fastcache v1.12.1/go.mod h1:tX04vaqcNoQeGLD+ra5pU5sWkuxnzWhEzLwhP9w653o= @@ -826,8 +830,6 @@ github.com/onflow/flow-core-contracts/lib/go/templates v0.15.1 h1:EjWjbyVEA+bMxX github.com/onflow/flow-core-contracts/lib/go/templates v0.15.1/go.mod h1:c09d6sNyF/j5/pAynK7sNPb1XKqJqk1rxZPEqEL+dUo= github.com/onflow/flow-ft/lib/go/contracts v0.7.1-0.20230711213910-baad011d2b13 h1:B4ll7e3j+MqTJv2122Enq3RtDNzmIGRu9xjV7fo7un0= github.com/onflow/flow-ft/lib/go/contracts v0.7.1-0.20230711213910-baad011d2b13/go.mod h1:kTMFIySzEJJeupk+7EmXs0EJ6CBWY/MV9fv9iYQk+RU= -github.com/onflow/flow-go v0.33.2-0.20240321224153-02cdb601e0b0 h1:tP2jUYxz3fo5YIviIo63GluJD0N7o/CWrhYMhXdg49w= -github.com/onflow/flow-go v0.33.2-0.20240321224153-02cdb601e0b0/go.mod h1:X/VSv6vwzzolze1zDXAGdVFv0BXVQ+xYV7QOKP12AUo= github.com/onflow/flow-go-sdk v0.24.0/go.mod h1:IoptMLPyFXWvyd9yYA6/4EmSeeozl6nJoIv4FaEMg74= github.com/onflow/flow-go-sdk v0.46.0 h1:mrIQziCDe6Oi5HH/aPFvYluh1XUwO6lYpoXLWrBZc2s= github.com/onflow/flow-go-sdk v0.46.0/go.mod h1:azVWF0yHI8wT1erF0vuYGqQZybl6Frbc+0Zu3rIPeHc= @@ -835,8 +837,6 @@ github.com/onflow/flow-go/crypto v0.21.3/go.mod h1:vI6V4CY3R6c4JKBxdcRiR/AnjBfL8 github.com/onflow/flow-nft/lib/go/contracts v1.1.0 h1:rhUDeD27jhLwOqQKI/23008CYfnqXErrJvc4EFRP2a0= github.com/onflow/flow-nft/lib/go/contracts v1.1.0/go.mod h1:YsvzYng4htDgRB9sa9jxdwoTuuhjK8WYWXTyLkIigZY= github.com/onflow/flow/protobuf/go/flow v0.2.2/go.mod h1:gQxYqCfkI8lpnKsmIjwtN2mV/N2PIwc1I+RUK4HPIc8= -github.com/onflow/flow/protobuf/go/flow v0.3.7-0.20240305102946-3efec6679252 h1:W0xm80Qc5RkFJw7yQIj7OiMacCZw3et/tx/5N9rN2qk= -github.com/onflow/flow/protobuf/go/flow v0.3.7-0.20240305102946-3efec6679252/go.mod h1:NA2pX2nw8zuaxfKphhKsk00kWLwfd+tv8mS23YXO4Sk= github.com/onflow/go-ethereum v1.13.4 h1:iNO86fm8RbBbhZ87ZulblInqCdHnAQVY8okBrNsTevc= github.com/onflow/go-ethereum v1.13.4/go.mod h1:cE/gEUkAffhwbVmMJYz+t1dAfVNHNwZCgc3BWtZxBGY= github.com/onflow/nft-storefront/lib/go/contracts v0.0.0-20221222181731-14b90207cead h1:2j1Unqs76Z1b95Gu4C3Y28hzNUHBix7wL490e61SMSw= diff --git a/server/access/streamBackend.go b/server/access/streamBackend.go index 5b3893b4..6161812b 100644 --- a/server/access/streamBackend.go +++ b/server/access/streamBackend.go @@ -225,6 +225,18 @@ func (b StateStreamBackend) SubscribeEvents(ctx context.Context, startBlockID fl return sub } +func (b StateStreamBackend) SubscribeEventsFromStartBlockID(ctx context.Context, startBlockID flow.Identifier, filter state_stream.EventFilter) subscription.Subscription { + return nil +} + +func (b StateStreamBackend) SubscribeEventsFromStartHeight(ctx context.Context, startHeight uint64, filter state_stream.EventFilter) subscription.Subscription { + return nil +} + +func (b StateStreamBackend) SubscribeEventsFromLatest(context.Context, state_stream.EventFilter) subscription.Subscription { + return nil +} + func (b StateStreamBackend) getResponseFactory(filter state_stream.EventFilter) subscription.GetDataByHeightFunc { return func(ctx context.Context, height uint64) (interface{}, error) { executionData, err := b.getExecutionData(ctx, height) From ef4dc6f855400679e7e50fdfcab244e2ca4ae28e Mon Sep 17 00:00:00 2001 From: UlyanaAndrukhiv Date: Thu, 4 Apr 2024 12:39:36 +0300 Subject: [PATCH 2/3] Updated protobuf, flow-go version, added SubscribeAccountStatuses endpoints to streamBackend --- go.mod | 8 ++++---- go.sum | 12 ++++++------ server/access/streamBackend.go | 12 ++++++++++++ 3 files changed, 22 insertions(+), 10 deletions(-) diff --git a/go.mod b/go.mod index 761a9ffc..f0dece19 100644 --- a/go.mod +++ b/go.mod @@ -17,7 +17,7 @@ require ( github.com/onflow/flow-go v0.33.2-0.20240321224153-02cdb601e0b0 github.com/onflow/flow-go-sdk v0.46.0 github.com/onflow/flow-nft/lib/go/contracts v1.1.0 - github.com/onflow/flow/protobuf/go/flow v0.3.7-0.20240305102946-3efec6679252 + github.com/onflow/flow/protobuf/go/flow v0.3.7-0.20240329135840-9f04832ba3a1 github.com/onflow/nft-storefront/lib/go/contracts v0.0.0-20221222181731-14b90207cead github.com/prometheus/client_golang v1.18.0 github.com/psiemens/graceland v1.0.0 @@ -133,7 +133,7 @@ require ( github.com/multiformats/go-varint v0.0.7 // indirect github.com/olekukonko/tablewriter v0.0.5 // indirect github.com/onflow/atree v0.6.0 // indirect - github.com/onflow/crypto v0.25.0 // indirect + github.com/onflow/crypto v0.25.1 // indirect github.com/onflow/flow-core-contracts/lib/go/contracts v0.15.1 // indirect github.com/onflow/flow-ft/lib/go/contracts v0.7.1-0.20230711213910-baad011d2b13 // indirect github.com/onflow/go-ethereum v1.13.4 // indirect @@ -210,7 +210,7 @@ require ( ) // TODO: Remove when it will be merged -replace github.com/onflow/flow/protobuf/go/flow v0.3.7-0.20240305102946-3efec6679252 => github.com/The-K-R-O-K/flow/protobuf/go/flow v0.0.0-20240325091550-e992f45aaa3e +replace github.com/onflow/flow/protobuf/go/flow v0.3.7-0.20240329135840-9f04832ba3a1 => github.com/The-K-R-O-K/flow/protobuf/go/flow v0.0.0-20240403101026-bc18dca2e2f7 // TODO: Remove when it will be merged -replace github.com/onflow/flow-go v0.33.2-0.20240321224153-02cdb601e0b0 => github.com/The-K-R-O-K/flow-go v0.0.0-20240327190034-0048cab3d3ca +replace github.com/onflow/flow-go v0.33.2-0.20240321224153-02cdb601e0b0 => github.com/The-K-R-O-K/flow-go v0.0.0-20240404085611-7041efe85b40 diff --git a/go.sum b/go.sum index 9f5ea754..43130a1f 100644 --- a/go.sum +++ b/go.sum @@ -85,10 +85,10 @@ github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMx github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= github.com/StackExchange/wmi v1.2.1 h1:VIkavFPXSjcnS+O8yTq7NI32k0R5Aj+v39y29VYDOSA= github.com/StackExchange/wmi v1.2.1/go.mod h1:rcmrprowKIVzvc+NUiLncP2uuArMWLCbu9SBzvHz7e8= -github.com/The-K-R-O-K/flow-go v0.0.0-20240327190034-0048cab3d3ca h1:OwPJRhfTM5JQc0LoqCQWOgphTsk/kmxNBxL8RI4IcQ8= -github.com/The-K-R-O-K/flow-go v0.0.0-20240327190034-0048cab3d3ca/go.mod h1:v3wUUv5ma76KNJRJMwIhz5QdG5n7BR+z0Xh7m9jbavI= -github.com/The-K-R-O-K/flow/protobuf/go/flow v0.0.0-20240325091550-e992f45aaa3e h1:6CCZCTEWUkUEAJ2FMzbGwolbr+sFbnjHg6tmhOverhY= -github.com/The-K-R-O-K/flow/protobuf/go/flow v0.0.0-20240325091550-e992f45aaa3e/go.mod h1:NA2pX2nw8zuaxfKphhKsk00kWLwfd+tv8mS23YXO4Sk= +github.com/The-K-R-O-K/flow-go v0.0.0-20240404085611-7041efe85b40 h1:0JoFCEV9eX3KpKyhoqS80gRwC4tFJyDthczgHS6mMZA= +github.com/The-K-R-O-K/flow-go v0.0.0-20240404085611-7041efe85b40/go.mod h1:p+w5qUXdbqmgFaXvJC85gaVvHFvIiCMV4zjsG8tsf78= +github.com/The-K-R-O-K/flow/protobuf/go/flow v0.0.0-20240403101026-bc18dca2e2f7 h1:MIDF2Jctk++1uukoq+kJexkxtXsL/31dgZa3PuMs6u4= +github.com/The-K-R-O-K/flow/protobuf/go/flow v0.0.0-20240403101026-bc18dca2e2f7/go.mod h1:NA2pX2nw8zuaxfKphhKsk00kWLwfd+tv8mS23YXO4Sk= github.com/VictoriaMetrics/fastcache v1.5.3/go.mod h1:+jv9Ckb+za/P1ZRg/sulP5Ni1v49daAVERr0H3CuscE= github.com/VictoriaMetrics/fastcache v1.12.1 h1:i0mICQuojGDL3KblA7wUNlY5lOK6a4bwt3uRKnkZU40= github.com/VictoriaMetrics/fastcache v1.12.1/go.mod h1:tX04vaqcNoQeGLD+ra5pU5sWkuxnzWhEzLwhP9w653o= @@ -822,8 +822,8 @@ github.com/onflow/atree v0.6.0/go.mod h1:gBHU0M05qCbv9NN0kijLWMgC47gHVNBIp4KmsVF github.com/onflow/cadence v0.20.1/go.mod h1:7mzUvPZUIJztIbr9eTvs+fQjWWHTF8veC+yk4ihcNIA= github.com/onflow/cadence v0.42.9 h1:EX+eak/Jjy9PyKcAEmOViGOHMyP/nCOwJO+deodZlJE= github.com/onflow/cadence v0.42.9/go.mod h1:1wFd+LiNiN6qoZXof3MBdpM6d8BsxbVIxOA77LbIYmE= -github.com/onflow/crypto v0.25.0 h1:BeWbLsh3ZD13Ej+Uky6kg1PL1ZIVBDVX+2MVBNwqddg= -github.com/onflow/crypto v0.25.0/go.mod h1:C8FbaX0x8y+FxWjbkHy0Q4EASCDR9bSPWZqlpCLYyVI= +github.com/onflow/crypto v0.25.1 h1:0txy2PKPMM873JbpxQNbJmuOJtD56bfs48RQfm0ts5A= +github.com/onflow/crypto v0.25.1/go.mod h1:C8FbaX0x8y+FxWjbkHy0Q4EASCDR9bSPWZqlpCLYyVI= github.com/onflow/flow-core-contracts/lib/go/contracts v0.15.1 h1:xF5wHug6H8vKfz7p1LYy9jck6eD9K1HLjTdi6o4kg1k= github.com/onflow/flow-core-contracts/lib/go/contracts v0.15.1/go.mod h1:WHp24VkUQfcfZi0XjI1uRVRt5alM5SHVkwOil1U2Tpc= github.com/onflow/flow-core-contracts/lib/go/templates v0.15.1 h1:EjWjbyVEA+bMxXbM44dE6MsYeqOu5a9q/EwSWa4ma2M= diff --git a/server/access/streamBackend.go b/server/access/streamBackend.go index 6161812b..d9df8f23 100644 --- a/server/access/streamBackend.go +++ b/server/access/streamBackend.go @@ -225,6 +225,18 @@ func (b StateStreamBackend) SubscribeEvents(ctx context.Context, startBlockID fl return sub } +func (b StateStreamBackend) SubscribeAccountStatusesFromStartBlockID(ctx context.Context, startBlockID flow.Identifier, filter state_stream.AccountStatusFilter) subscription.Subscription { + return nil +} + +func (b StateStreamBackend) SubscribeAccountStatusesFromStartHeight(ctx context.Context, startHeight uint64, filter state_stream.AccountStatusFilter) subscription.Subscription { + return nil +} + +func (b StateStreamBackend) SubscribeAccountStatusesFromLatestBlock(context.Context, state_stream.AccountStatusFilter) subscription.Subscription { + return nil +} + func (b StateStreamBackend) SubscribeEventsFromStartBlockID(ctx context.Context, startBlockID flow.Identifier, filter state_stream.EventFilter) subscription.Subscription { return nil } From 60c31ec4e8f0f1a2305d2baefc714c87e0d22e6b Mon Sep 17 00:00:00 2001 From: UlyanaAndrukhiv Date: Thu, 4 Apr 2024 21:20:27 +0300 Subject: [PATCH 3/3] Updated flow-go version and protobuf version --- go.mod | 10 ++-------- go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/go.mod b/go.mod index f0dece19..5e2537dd 100644 --- a/go.mod +++ b/go.mod @@ -14,10 +14,10 @@ require ( github.com/logrusorgru/aurora v2.0.3+incompatible github.com/onflow/cadence v0.42.9 github.com/onflow/flow-core-contracts/lib/go/templates v0.15.1 - github.com/onflow/flow-go v0.33.2-0.20240321224153-02cdb601e0b0 + github.com/onflow/flow-go v0.33.2-0.20240404171354-0b0592cc5bba github.com/onflow/flow-go-sdk v0.46.0 github.com/onflow/flow-nft/lib/go/contracts v1.1.0 - github.com/onflow/flow/protobuf/go/flow v0.3.7-0.20240329135840-9f04832ba3a1 + github.com/onflow/flow/protobuf/go/flow v0.3.7-0.20240404170900-c321c1475f1e github.com/onflow/nft-storefront/lib/go/contracts v0.0.0-20221222181731-14b90207cead github.com/prometheus/client_golang v1.18.0 github.com/psiemens/graceland v1.0.0 @@ -208,9 +208,3 @@ require ( nhooyr.io/websocket v1.8.7 // indirect rsc.io/tmplfunc v0.0.3 // indirect ) - -// TODO: Remove when it will be merged -replace github.com/onflow/flow/protobuf/go/flow v0.3.7-0.20240329135840-9f04832ba3a1 => github.com/The-K-R-O-K/flow/protobuf/go/flow v0.0.0-20240403101026-bc18dca2e2f7 - -// TODO: Remove when it will be merged -replace github.com/onflow/flow-go v0.33.2-0.20240321224153-02cdb601e0b0 => github.com/The-K-R-O-K/flow-go v0.0.0-20240404085611-7041efe85b40 diff --git a/go.sum b/go.sum index 43130a1f..c267a7ed 100644 --- a/go.sum +++ b/go.sum @@ -85,10 +85,6 @@ github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMx github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= github.com/StackExchange/wmi v1.2.1 h1:VIkavFPXSjcnS+O8yTq7NI32k0R5Aj+v39y29VYDOSA= github.com/StackExchange/wmi v1.2.1/go.mod h1:rcmrprowKIVzvc+NUiLncP2uuArMWLCbu9SBzvHz7e8= -github.com/The-K-R-O-K/flow-go v0.0.0-20240404085611-7041efe85b40 h1:0JoFCEV9eX3KpKyhoqS80gRwC4tFJyDthczgHS6mMZA= -github.com/The-K-R-O-K/flow-go v0.0.0-20240404085611-7041efe85b40/go.mod h1:p+w5qUXdbqmgFaXvJC85gaVvHFvIiCMV4zjsG8tsf78= -github.com/The-K-R-O-K/flow/protobuf/go/flow v0.0.0-20240403101026-bc18dca2e2f7 h1:MIDF2Jctk++1uukoq+kJexkxtXsL/31dgZa3PuMs6u4= -github.com/The-K-R-O-K/flow/protobuf/go/flow v0.0.0-20240403101026-bc18dca2e2f7/go.mod h1:NA2pX2nw8zuaxfKphhKsk00kWLwfd+tv8mS23YXO4Sk= github.com/VictoriaMetrics/fastcache v1.5.3/go.mod h1:+jv9Ckb+za/P1ZRg/sulP5Ni1v49daAVERr0H3CuscE= github.com/VictoriaMetrics/fastcache v1.12.1 h1:i0mICQuojGDL3KblA7wUNlY5lOK6a4bwt3uRKnkZU40= github.com/VictoriaMetrics/fastcache v1.12.1/go.mod h1:tX04vaqcNoQeGLD+ra5pU5sWkuxnzWhEzLwhP9w653o= @@ -830,6 +826,8 @@ github.com/onflow/flow-core-contracts/lib/go/templates v0.15.1 h1:EjWjbyVEA+bMxX github.com/onflow/flow-core-contracts/lib/go/templates v0.15.1/go.mod h1:c09d6sNyF/j5/pAynK7sNPb1XKqJqk1rxZPEqEL+dUo= github.com/onflow/flow-ft/lib/go/contracts v0.7.1-0.20230711213910-baad011d2b13 h1:B4ll7e3j+MqTJv2122Enq3RtDNzmIGRu9xjV7fo7un0= github.com/onflow/flow-ft/lib/go/contracts v0.7.1-0.20230711213910-baad011d2b13/go.mod h1:kTMFIySzEJJeupk+7EmXs0EJ6CBWY/MV9fv9iYQk+RU= +github.com/onflow/flow-go v0.33.2-0.20240404171354-0b0592cc5bba h1:RstNHKVpYJhza081Lsy4RQ8T+NbnOat/E9pKlC7/igk= +github.com/onflow/flow-go v0.33.2-0.20240404171354-0b0592cc5bba/go.mod h1:p+w5qUXdbqmgFaXvJC85gaVvHFvIiCMV4zjsG8tsf78= github.com/onflow/flow-go-sdk v0.24.0/go.mod h1:IoptMLPyFXWvyd9yYA6/4EmSeeozl6nJoIv4FaEMg74= github.com/onflow/flow-go-sdk v0.46.0 h1:mrIQziCDe6Oi5HH/aPFvYluh1XUwO6lYpoXLWrBZc2s= github.com/onflow/flow-go-sdk v0.46.0/go.mod h1:azVWF0yHI8wT1erF0vuYGqQZybl6Frbc+0Zu3rIPeHc= @@ -837,6 +835,8 @@ github.com/onflow/flow-go/crypto v0.21.3/go.mod h1:vI6V4CY3R6c4JKBxdcRiR/AnjBfL8 github.com/onflow/flow-nft/lib/go/contracts v1.1.0 h1:rhUDeD27jhLwOqQKI/23008CYfnqXErrJvc4EFRP2a0= github.com/onflow/flow-nft/lib/go/contracts v1.1.0/go.mod h1:YsvzYng4htDgRB9sa9jxdwoTuuhjK8WYWXTyLkIigZY= github.com/onflow/flow/protobuf/go/flow v0.2.2/go.mod h1:gQxYqCfkI8lpnKsmIjwtN2mV/N2PIwc1I+RUK4HPIc8= +github.com/onflow/flow/protobuf/go/flow v0.3.7-0.20240404170900-c321c1475f1e h1:r4+gVDDMOOc04Y1qjCZULAdgoaxSMsqSdE1EyviG76U= +github.com/onflow/flow/protobuf/go/flow v0.3.7-0.20240404170900-c321c1475f1e/go.mod h1:NA2pX2nw8zuaxfKphhKsk00kWLwfd+tv8mS23YXO4Sk= github.com/onflow/go-ethereum v1.13.4 h1:iNO86fm8RbBbhZ87ZulblInqCdHnAQVY8okBrNsTevc= github.com/onflow/go-ethereum v1.13.4/go.mod h1:cE/gEUkAffhwbVmMJYz+t1dAfVNHNwZCgc3BWtZxBGY= github.com/onflow/nft-storefront/lib/go/contracts v0.0.0-20221222181731-14b90207cead h1:2j1Unqs76Z1b95Gu4C3Y28hzNUHBix7wL490e61SMSw=