added ulc config params (#1255)
* added ulc config params * fmt * fix lint
This commit is contained in:
parent
29b55bd445
commit
bdbceba6eb
|
@ -218,6 +218,10 @@ func activateLightEthService(stack *node.Node, config *params.NodeConfig) error
|
||||||
ethConf.SyncMode = downloader.LightSync
|
ethConf.SyncMode = downloader.LightSync
|
||||||
ethConf.NetworkId = config.NetworkID
|
ethConf.NetworkId = config.NetworkID
|
||||||
ethConf.DatabaseCache = config.LightEthConfig.DatabaseCache
|
ethConf.DatabaseCache = config.LightEthConfig.DatabaseCache
|
||||||
|
ethConf.ULC = ð.ULCConfig{
|
||||||
|
TrustedServers: config.LightEthConfig.TrustedNodes,
|
||||||
|
MinTrustedFraction: config.LightEthConfig.MinTrustedFraction,
|
||||||
|
}
|
||||||
return stack.Register(func(ctx *node.ServiceContext) (node.Service, error) {
|
return stack.Register(func(ctx *node.ServiceContext) (node.Service, error) {
|
||||||
return les.New(ctx, ðConf)
|
return les.New(ctx, ðConf)
|
||||||
})
|
})
|
||||||
|
|
|
@ -31,6 +31,12 @@ type LightEthConfig struct {
|
||||||
|
|
||||||
// DatabaseCache is memory (in MBs) allocated to internal caching (min 16MB / database forced)
|
// DatabaseCache is memory (in MBs) allocated to internal caching (min 16MB / database forced)
|
||||||
DatabaseCache int
|
DatabaseCache int
|
||||||
|
|
||||||
|
// TrustedNodes is a list of trusted servers
|
||||||
|
TrustedNodes []string
|
||||||
|
|
||||||
|
//MinTrustedFraction is minimum percentage of connected trusted servers to validate header(1-100)
|
||||||
|
MinTrustedFraction int
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------
|
// ----------
|
||||||
|
|
|
@ -48,9 +48,9 @@ func NewPublicAPI(s *Service) *PublicAPI {
|
||||||
filters: make(map[rpc.ID]filter),
|
filters: make(map[rpc.ID]filter),
|
||||||
latestBlockChangedEvent: s.latestBlockChangedEvent,
|
latestBlockChangedEvent: s.latestBlockChangedEvent,
|
||||||
transactionSentToUpstreamEvent: s.transactionSentToUpstreamEvent,
|
transactionSentToUpstreamEvent: s.transactionSentToUpstreamEvent,
|
||||||
client: func() ContextCaller { return s.rpc.RPCClient() },
|
client: func() ContextCaller { return s.rpc.RPCClient() },
|
||||||
filterLivenessLoop: defaultFilterLivenessPeriod,
|
filterLivenessLoop: defaultFilterLivenessPeriod,
|
||||||
filterLivenessPeriod: defaultFilterLivenessPeriod + 10*time.Second,
|
filterLivenessPeriod: defaultFilterLivenessPeriod + 10*time.Second,
|
||||||
}
|
}
|
||||||
go api.timeoutLoop(s.quit)
|
go api.timeoutLoop(s.quit)
|
||||||
return api
|
return api
|
||||||
|
|
|
@ -27,7 +27,7 @@ func New(rpc rpcProvider) *Service {
|
||||||
return &Service{
|
return &Service{
|
||||||
latestBlockChangedEvent: latestBlockChangedEvent,
|
latestBlockChangedEvent: latestBlockChangedEvent,
|
||||||
transactionSentToUpstreamEvent: transactionSentToUpstreamEvent,
|
transactionSentToUpstreamEvent: transactionSentToUpstreamEvent,
|
||||||
rpc: rpc,
|
rpc: rpc,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue