swarm: Lightnode mode: disable sync, retrieve, subscription (#17899)
* swarm: Lightnode mode: disable sync, retrieve, subscription * swarm/network/stream: assign error and check in one line * swarm: restructured RegistryOption initializing * swarm: empty commit to retrigger CI build * swarm/network/stream: Added comments explaining RegistryOptions
This commit is contained in:
committed by
Viktor Trón
parent
4e693ad5a6
commit
cdf5982cfc
@ -175,13 +175,19 @@ func NewSwarm(config *api.Config, mockStore *mock.NodeStore) (self *Swarm, err e
|
||||
if err := nodeID.UnmarshalText([]byte(config.NodeID)); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
self.streamer = stream.NewRegistry(nodeID, delivery, self.netStore, stateStore, &stream.RegistryOptions{
|
||||
registryOptions := &stream.RegistryOptions{
|
||||
SkipCheck: config.DeliverySkipCheck,
|
||||
DoSync: config.SyncEnabled,
|
||||
DoRetrieve: true,
|
||||
DoServeRetrieve: true,
|
||||
SyncUpdateDelay: config.SyncUpdateDelay,
|
||||
MaxPeerServers: config.MaxStreamPeerServers,
|
||||
})
|
||||
}
|
||||
if config.LightNodeEnabled {
|
||||
registryOptions.DoSync = false
|
||||
registryOptions.DoRetrieve = false
|
||||
}
|
||||
self.streamer = stream.NewRegistry(nodeID, delivery, self.netStore, stateStore, registryOptions)
|
||||
|
||||
// Swarm Hash Merklised Chunking for Arbitrary-length Document/File storage
|
||||
self.fileStore = storage.NewFileStore(self.netStore, self.config.FileStoreParams)
|
||||
|
Reference in New Issue
Block a user