Skip to content

Commit

Permalink
feat(worker/rainbow): add rainbow worker (#565)
Browse files Browse the repository at this point in the history
  • Loading branch information
pseudoyu committed Oct 14, 2024
1 parent f9b6f81 commit 39bcbc7
Show file tree
Hide file tree
Showing 11 changed files with 2,915 additions and 52 deletions.
447 changes: 447 additions & 0 deletions internal/engine/worker/decentralized/contract/rainbow/worker.go

Large diffs are not rendered by default.

687 changes: 687 additions & 0 deletions internal/engine/worker/decentralized/contract/rainbow/worker_test.go

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions internal/engine/worker/decentralized/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import (
"github.com/rss3-network/node/internal/engine/worker/decentralized/contract/paragraph"
"github.com/rss3-network/node/internal/engine/worker/decentralized/contract/paraswap"
"github.com/rss3-network/node/internal/engine/worker/decentralized/contract/polymarket"
"github.com/rss3-network/node/internal/engine/worker/decentralized/contract/rainbow"
"github.com/rss3-network/node/internal/engine/worker/decentralized/contract/rss3"
"github.com/rss3-network/node/internal/engine/worker/decentralized/contract/savm"
"github.com/rss3-network/node/internal/engine/worker/decentralized/contract/stargate"
Expand Down Expand Up @@ -121,6 +122,8 @@ func newNonCoreWorker(config *config.Module, databaseClient database.Client, red
return linear.NewWorker(config)
case decentralized.Zerion:
return zerion.NewWorker(config)
case decentralized.Rainbow:
return rainbow.NewWorker(config)
default:
return nil, fmt.Errorf("unsupported worker %s", config.Worker)
}
Expand Down
9 changes: 9 additions & 0 deletions internal/node/component/info/network_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,7 @@ var NetworkToWorkersMap = map[network.Network][]worker.Worker{
decentralized.Core,
decentralized.Curve,
decentralized.Highlight,
decentralized.Rainbow,
decentralized.Stargate,
decentralized.Zerion,
},
Expand All @@ -332,17 +333,20 @@ var NetworkToWorkersMap = map[network.Network][]worker.Worker{
decentralized.Aave,
decentralized.Core,
decentralized.Curve,
decentralized.Rainbow,
decentralized.Stargate,
decentralized.Zerion,
},
network.Base: {
decentralized.Aave,
decentralized.Core,
decentralized.Rainbow,
decentralized.Stargate,
decentralized.Zerion,
},
network.BinanceSmartChain: {
decentralized.Core,
decentralized.Rainbow,
decentralized.Stargate,
decentralized.Zerion,
},
Expand All @@ -367,6 +371,7 @@ var NetworkToWorkersMap = map[network.Network][]worker.Worker{
decentralized.OpenSea,
decentralized.Optimism,
decentralized.Paraswap,
decentralized.Rainbow,
decentralized.RSS3,
decentralized.Stargate,
decentralized.Uniswap,
Expand All @@ -382,6 +387,7 @@ var NetworkToWorkersMap = map[network.Network][]worker.Worker{
},
network.Linea: {
decentralized.Core,
decentralized.Rainbow,
decentralized.Stargate,
decentralized.Uniswap,
decentralized.Zerion,
Expand All @@ -401,6 +407,7 @@ var NetworkToWorkersMap = map[network.Network][]worker.Worker{
decentralized.KiwiStand,
decentralized.Matters,
decentralized.Optimism,
decentralized.Rainbow,
decentralized.Stargate,
decentralized.Zerion,
},
Expand All @@ -413,6 +420,7 @@ var NetworkToWorkersMap = map[network.Network][]worker.Worker{
decentralized.IQWiki,
decentralized.Lens,
decentralized.Polymarket,
decentralized.Rainbow,
decentralized.Stargate,
decentralized.Zerion,
},
Expand Down Expand Up @@ -477,6 +485,7 @@ var WorkerToConfigMap = map[network.Source]map[worker.Worker]workerConfig{
decentralized.Optimism: defaultWorkerConfig(decentralized.Optimism, network.EthereumSource, nil),
decentralized.Paraswap: defaultWorkerConfig(decentralized.Paraswap, network.EthereumSource, nil),
decentralized.Polymarket: defaultWorkerConfig(decentralized.Polymarket, network.EthereumSource, nil),
decentralized.Rainbow: defaultWorkerConfig(decentralized.Rainbow, network.EthereumSource, nil),
decentralized.RSS3: defaultWorkerConfig(decentralized.RSS3, network.EthereumSource, nil),
decentralized.SAVM: defaultWorkerConfig(decentralized.SAVM, network.EthereumSource, nil),
decentralized.Stargate: defaultWorkerConfig(decentralized.Stargate, network.EthereumSource, nil),
Expand Down
Loading

0 comments on commit 39bcbc7

Please sign in to comment.