Skip to content

Commit

Permalink
disable rate limiting for local network
Browse files Browse the repository at this point in the history
  • Loading branch information
zkokelj committed Jul 31, 2024
1 parent c3ad0a4 commit 6ad92ae
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
1 change: 1 addition & 0 deletions testnet/launcher/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ func (t *Testnet) Start() error {
gateway.WithTenNodeHTTPPort(13010),
gateway.WithTenNodeWSPort(13011),
gateway.WithTenNodeHost("validator-host"),
gateway.WithRateLimitUserComputeTime(0), // disable rate limiting for local network
gateway.WithDockerImage("testnetobscuronet.azurecr.io/obscuronet/obscuro_gateway:latest"),
),
)
Expand Down
21 changes: 15 additions & 6 deletions testnet/launcher/gateway/config.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
package gateway

import "time"

// Option is a function that applies configs to a Config Object
type Option = func(c *Config)

// Config holds the properties that configure the package
type Config struct {
tenNodeHost string
tenNodeHTTPPort int
tenNodeWSPort int
gatewayHTTPPort int
gatewayWSPort int
dockerImage string
tenNodeHost string
tenNodeHTTPPort int
tenNodeWSPort int
gatewayHTTPPort int
gatewayWSPort int
rateLimitUserComputeTime time.Duration
dockerImage string
}

func NewGatewayConfig(opts ...Option) *Config {
Expand Down Expand Up @@ -58,3 +61,9 @@ func WithGatewayWSPort(i int) Option {
c.gatewayWSPort = i
}
}

func WithRateLimitUserComputeTime(d time.Duration) Option {
return func(c *Config) {
c.rateLimitUserComputeTime = d
}
}

0 comments on commit 6ad92ae

Please sign in to comment.