Skip to content

Commit

Permalink
add backfill storage (#106)
Browse files Browse the repository at this point in the history
  • Loading branch information
linhnt3400 authored Dec 9, 2024
1 parent b8564ad commit b3f5e6c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
18 changes: 18 additions & 0 deletions v2/cmd/backfill/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)

Expand Down
2 changes: 2 additions & 0 deletions v2/cmd/migrations/00011_update_backfilled_block.up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- backfill 1inchV6 from current block
update backfill set backfilled_block = 0 where exchange = '1inchV6';

0 comments on commit b3f5e6c

Please sign in to comment.