fix moonbeam ratelimit (#269)

This commit is contained in:
walker-16 2023-04-27 11:17:31 -03:00 committed by GitHub
parent 45af329b56
commit c0ec64c749
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 19 additions and 16 deletions

View File

@ -127,11 +127,12 @@ type watchersConfig struct {
}
type rateLimitConfig struct {
evm int
solana int
terra int
aptos int
oasis int
evm int
solana int
terra int
aptos int
oasis int
moonbeam int
}
func newWatchers(config *config.Configuration, repo *storage.Repository, logger *zap.Logger) []watcher.ContractWatcher {
@ -207,7 +208,7 @@ func newWatchers(config *config.Configuration, repo *storage.Repository, logger
// add moonbeam watcher
if watchers.moonbeam != nil {
moonbeamLimiter := ratelimit.New(watchers.rateLimit.oasis, ratelimit.Per(time.Second))
moonbeamLimiter := ratelimit.New(watchers.rateLimit.moonbeam, ratelimit.Per(time.Second))
moonbeamClient := evm.NewEvmSDK(config.MoonbeamUrl, moonbeamLimiter)
params := watcher.EVMParams{
ChainID: watchers.moonbeam.chainID,
@ -237,11 +238,12 @@ func newEVMWatchersForMainnet() *watchersConfig {
oasis: &OASIS_MAINNET,
moonbeam: &MOONBEAM_MAINNET,
rateLimit: rateLimitConfig{
evm: 1000,
solana: 3,
terra: 10,
aptos: 3,
oasis: 3,
evm: 1000,
solana: 3,
terra: 10,
aptos: 3,
oasis: 3,
moonbeam: 5,
},
}
}
@ -260,11 +262,12 @@ func newEVMWatchersForTestnet() *watchersConfig {
oasis: &OASIS_TESTNET,
moonbeam: &MOONBEAM_TESTNET,
rateLimit: rateLimitConfig{
evm: 10,
solana: 2,
terra: 5,
aptos: 1,
oasis: 1,
evm: 10,
solana: 2,
terra: 5,
aptos: 1,
oasis: 1,
moonbeam: 2,
},
}
}