From b3f5e6cf41ccd6b1df1aafe4dcb7c7e324ec0b23 Mon Sep 17 00:00:00 2001 From: Nguyen Thuy Linh Date: Mon, 9 Dec 2024 17:47:10 +0700 Subject: [PATCH] add backfill storage (#106) --- v2/cmd/backfill/main.go | 18 ++++++++++++++++++ .../00011_update_backfilled_block.up.sql | 2 ++ 2 files changed, 20 insertions(+) create mode 100644 v2/cmd/migrations/00011_update_backfilled_block.up.sql diff --git a/v2/cmd/backfill/main.go b/v2/cmd/backfill/main.go index f0aac68..b711034 100644 --- a/v2/cmd/backfill/main.go +++ b/v2/cmd/backfill/main.go @@ -30,8 +30,17 @@ import ( promoteeTypes "github.com/KyberNetwork/tradelogs/v2/pkg/storage/promotees" "github.com/KyberNetwork/tradelogs/v2/pkg/storage/state" "github.com/KyberNetwork/tradelogs/v2/pkg/storage/tradelogs" + bebopStorage "github.com/KyberNetwork/tradelogs/v2/pkg/storage/tradelogs/bebop" + hashflowv3Storage "github.com/KyberNetwork/tradelogs/v2/pkg/storage/tradelogs/hashflow_v3" + kyberswapStorage "github.com/KyberNetwork/tradelogs/v2/pkg/storage/tradelogs/kyberswap" + kyberswaprfqStorage "github.com/KyberNetwork/tradelogs/v2/pkg/storage/tradelogs/kyberswap_rfq" + oneinchv6Storage "github.com/KyberNetwork/tradelogs/v2/pkg/storage/tradelogs/oneinch_v6" + pancakeswapStorage "github.com/KyberNetwork/tradelogs/v2/pkg/storage/tradelogs/pancakeswap" + paraswapStorage "github.com/KyberNetwork/tradelogs/v2/pkg/storage/tradelogs/paraswap" storageTypes "github.com/KyberNetwork/tradelogs/v2/pkg/storage/tradelogs/types" + uniswapxStorage "github.com/KyberNetwork/tradelogs/v2/pkg/storage/tradelogs/uniswapx" zxotcStorage "github.com/KyberNetwork/tradelogs/v2/pkg/storage/tradelogs/zxotc" + zxrfqv3Storage "github.com/KyberNetwork/tradelogs/v2/pkg/storage/tradelogs/zxrfqv3" "github.com/KyberNetwork/tradelogs/v2/pkg/storage/zerox_deployment" "github.com/KyberNetwork/tradinglib/pkg/dbutil" "github.com/ethereum/go-ethereum/common" @@ -76,7 +85,16 @@ func run(c *cli.Context) error { // trade log manager storages := []storageTypes.Storage{ + kyberswapStorage.New(l, db), zxotcStorage.New(l, db), + paraswapStorage.New(l, db), + kyberswaprfqStorage.New(l, db), + hashflowv3Storage.New(l, db), + oneinchv6Storage.New(l, db), + uniswapxStorage.New(l, db), + bebopStorage.New(l, db), + zxrfqv3Storage.New(l, db), + pancakeswapStorage.New(l, db), } manager := tradelogs.NewManager(l, storages) diff --git a/v2/cmd/migrations/00011_update_backfilled_block.up.sql b/v2/cmd/migrations/00011_update_backfilled_block.up.sql new file mode 100644 index 0000000..9a9731c --- /dev/null +++ b/v2/cmd/migrations/00011_update_backfilled_block.up.sql @@ -0,0 +1,2 @@ +-- backfill 1inchV6 from current block +update backfill set backfilled_block = 0 where exchange = '1inchV6'; \ No newline at end of file