Commit 6187edf0 authored by Janoš Guljaš's avatar Janoš Guljaš Committed by GitHub

use netstore in retrieval protocol (#277)

Co-authored-by: default avatarsvetomir <svetomirsmiljkovic@gmail.com>
parent 4062b5c2
...@@ -51,4 +51,6 @@ jobs: ...@@ -51,4 +51,6 @@ jobs:
- name: Test pushsync (bzz API) - name: Test pushsync (bzz API)
run: ./beekeeper check pushsync --api-scheme http --debug-api-scheme http --disable-namespace --debug-api-domain localhost --api-domain localhost --node-count "${REPLICA}" --upload-node-count "${REPLICA}" --chunks-per-node 3 run: ./beekeeper check pushsync --api-scheme http --debug-api-scheme http --disable-namespace --debug-api-domain localhost --api-domain localhost --node-count "${REPLICA}" --upload-node-count "${REPLICA}" --chunks-per-node 3
- name: Test pushsync (bzz-chunk API) - name: Test pushsync (bzz-chunk API)
run: ./beekeeper check pushsync --bzz-chunk --api-scheme http --debug-api-scheme http --disable-namespace --debug-api-domain localhost --api-domain localhost --node-count "${REPLICA}" --upload-node-count "${REPLICA}" --chunks-per-node 3 run: ./beekeeper check pushsync --api-scheme http --debug-api-scheme http --disable-namespace --debug-api-domain localhost --api-domain localhost --node-count "${REPLICA}" --upload-node-count "${REPLICA}" --chunks-per-node 3 --bzz-chunk
- name: Test retrieval
run: ./beekeeper check retrieval --api-scheme http --debug-api-scheme http --disable-namespace --debug-api-domain localhost --api-domain localhost --node-count "${REPLICA}" --upload-node-count "${REPLICA}" --chunks-per-node 3
...@@ -205,7 +205,6 @@ func NewBee(o Options) (*Bee, error) { ...@@ -205,7 +205,6 @@ func NewBee(o Options) (*Bee, error) {
retrieve := retrieval.New(retrieval.Options{ retrieve := retrieval.New(retrieval.Options{
Streamer: p2ps, Streamer: p2ps,
ChunkPeerer: topologyDriver, ChunkPeerer: topologyDriver,
Storer: storer,
Logger: logger, Logger: logger,
}) })
tag := tags.NewTags() tag := tags.NewTags()
...@@ -216,6 +215,8 @@ func NewBee(o Options) (*Bee, error) { ...@@ -216,6 +215,8 @@ func NewBee(o Options) (*Bee, error) {
ns := netstore.New(storer, retrieve, validator.NewContentAddressValidator()) ns := netstore.New(storer, retrieve, validator.NewContentAddressValidator())
retrieve.SetStorer(ns)
pushSyncProtocol := pushsync.New(pushsync.Options{ pushSyncProtocol := pushsync.New(pushsync.Options{
Streamer: p2ps, Streamer: p2ps,
Storer: storer, Storer: storer,
......
...@@ -113,3 +113,8 @@ func (s *Service) handler(ctx context.Context, p p2p.Peer, stream p2p.Stream) er ...@@ -113,3 +113,8 @@ func (s *Service) handler(ctx context.Context, p p2p.Peer, stream p2p.Stream) er
return nil return nil
} }
// SetStorer sets the storer. This call is not goroutine safe.
func (s *Service) SetStorer(storer storage.Storer) {
s.storer = storer
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment