mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-18 18:02:24 +00:00
swarm: create intervals store for stream registry in NewSwarm
This commit is contained in:
parent
51db1b2c8a
commit
52818ed5f9
1 changed files with 8 additions and 1 deletions
|
|
@ -23,6 +23,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"math/big"
|
"math/big"
|
||||||
"net"
|
"net"
|
||||||
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
"unicode"
|
"unicode"
|
||||||
|
|
@ -46,6 +47,7 @@ import (
|
||||||
"github.com/ethereum/go-ethereum/swarm/fuse"
|
"github.com/ethereum/go-ethereum/swarm/fuse"
|
||||||
"github.com/ethereum/go-ethereum/swarm/network"
|
"github.com/ethereum/go-ethereum/swarm/network"
|
||||||
"github.com/ethereum/go-ethereum/swarm/network/stream"
|
"github.com/ethereum/go-ethereum/swarm/network/stream"
|
||||||
|
"github.com/ethereum/go-ethereum/swarm/network/stream/intervals"
|
||||||
"github.com/ethereum/go-ethereum/swarm/pss"
|
"github.com/ethereum/go-ethereum/swarm/pss"
|
||||||
"github.com/ethereum/go-ethereum/swarm/storage"
|
"github.com/ethereum/go-ethereum/swarm/storage"
|
||||||
"github.com/ethereum/go-ethereum/swarm/storage/mock"
|
"github.com/ethereum/go-ethereum/swarm/storage/mock"
|
||||||
|
|
@ -146,7 +148,12 @@ func NewSwarm(ctx *node.ServiceContext, backend chequebook.Backend, config *api.
|
||||||
|
|
||||||
db := storage.NewDBAPI(self.lstore)
|
db := storage.NewDBAPI(self.lstore)
|
||||||
delivery := stream.NewDelivery(to, db)
|
delivery := stream.NewDelivery(to, db)
|
||||||
self.streamer = stream.NewRegistry(addr, delivery, self.lstore, false)
|
// TODO: decide on intervals store file location
|
||||||
|
intervalsStore, err := intervals.NewDBStore(filepath.Join(config.Path, "stream-intervals.db"))
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
self.streamer = stream.NewRegistry(addr, delivery, self.lstore, intervalsStore, false)
|
||||||
stream.RegisterSwarmSyncerServer(self.streamer, db)
|
stream.RegisterSwarmSyncerServer(self.streamer, db)
|
||||||
stream.RegisterSwarmSyncerClient(self.streamer, db)
|
stream.RegisterSwarmSyncerClient(self.streamer, db)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue