Skip to content

Commit

Permalink
Minor config updates
Browse files Browse the repository at this point in the history
  • Loading branch information
galt-tr authored and icellan committed Apr 20, 2022
1 parent 22387a1 commit 482329c
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 14 deletions.
17 changes: 10 additions & 7 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,16 @@ type (

// MonitorOptions is the configuration for blockchain monitoring
MonitorOptions struct {
Enabled bool `json:"enabled" mapstructure:"enabled"` // true/false
CentrifugeServer string `json:"centrifuge_server" mapstructure:"centrifuge_server"` // The server url address
Token string `json:"token" mapstructure:"token"` // Token to connect to the server with
MonitorDays int `json:"monitor_days" mapstructure:"monitor_days"` // how many days in the past should we monitor an address (default: 7)
FalsePositiveRate float64 `json:"false_positive_rate" mapstructure:"false_positive_rate"` // how many false positives do we except (default: 0.01)
MaxNumberOfDestinations int `json:"max_number_of_destinations" mapstructure:"max_number_of_destinations"` // how many destinations can the filter hold (default: 100,000)
ProcessMempoolOnConnect bool `json:"process_mempool_on_connect" mapstructure:"process_mempool_on_connect"` // Whether to process all transactions in the mempool when connecting to centrifuge server
Enabled bool `json:"enabled" mapstructure:"enabled"` // true/false
CentrifugeServer string `json:"centrifuge_server" mapstructure:"centrifuge_server"` // The server url address
Token string `json:"token" mapstructure:"token"` // Token to connect to the server with
MonitorDays int `json:"monitor_days" mapstructure:"monitor_days"` // how many days in the past should we monitor an address (default: 7)
FalsePositiveRate float64 `json:"false_positive_rate" mapstructure:"false_positive_rate"` // how many false positives do we except (default: 0.01)
SaveTransactionDestinations bool `json:"save_transaction_destinations" mapstructure:"save_transaction_destinations"` // Whether to save destinations on monitored transactions
ProcessorType string `json:"processor_type" mapstructure:"processor_type"` // Type of processor to start monitor with. Default: bloom
LoadMonitoredDestinations bool `json:"load_monitored_destinations" mapstructure:"load_monitored_destinations" // Whehter to load monitored destinations`
MaxNumberOfDestinations int `json:"max_number_of_destinations" mapstructure:"max_number_of_destinations"` // how many destinations can the filter hold (default: 100,000)
ProcessMempoolOnConnect bool `json:"process_mempool_on_connect" mapstructure:"process_mempool_on_connect"` // Whether to process all transactions in the mempool when connecting to centrifuge server
}

// NewRelicConfig is the configuration for New Relic
Expand Down
4 changes: 3 additions & 1 deletion config/envs/development.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@
"enabled": true,
"centrifuge_server": "ws://localhost:8000/websocket",
"token": "",
"processMempoolOnConnect": true
"processMempoolOnConnect": true,
"load_monitored_destinations": false,
"save_destinations": true
},
"new_relic": {
"domain_name": "domain.com",
Expand Down
14 changes: 8 additions & 6 deletions config/services.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,12 +210,14 @@ func (s *AppServices) loadBux(ctx context.Context, appConfig *AppConfig) (err er
return
}
options = append(options, bux.WithMonitoring(ctx, &chainstate.MonitorOptions{
CentrifugeServer: appConfig.Monitor.CentrifugeServer,
MonitorDays: appConfig.Monitor.MonitorDays,
Token: appConfig.Monitor.Token,
FalsePositiveRate: appConfig.Monitor.FalsePositiveRate,
MaxNumberOfDestinations: appConfig.Monitor.MaxNumberOfDestinations,
ProcessMempoolOnConnect: appConfig.Monitor.ProcessMempoolOnConnect,
CentrifugeServer: appConfig.Monitor.CentrifugeServer,
MonitorDays: appConfig.Monitor.MonitorDays,
Token: appConfig.Monitor.Token,
FalsePositiveRate: appConfig.Monitor.FalsePositiveRate,
MaxNumberOfDestinations: appConfig.Monitor.MaxNumberOfDestinations,
SaveTransactionDestinations: appConfig.Monitor.SaveTransactionDestinations,
LoadMonitoredDestinations: appConfig.Monitor.LoadMonitoredDestinations,
ProcessMempoolOnConnect: appConfig.Monitor.ProcessMempoolOnConnect,
}))
}

Expand Down

0 comments on commit 482329c

Please sign in to comment.