{"modulePath":"github.com/ethersphere/bee","version":"v1.18.2","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package pushsync\n\nPackage pushsync provides the pushsync protocol implementation.\n\n## Variables\n\n```go\nvar (\n\tErrNoPush            = errors.New(\"could not push chunk\")\n\tErrOutOfDepthStoring = errors.New(\"storing outside of the neighborhood\")\n\tErrWarmup            = errors.New(\"node warmup time not complete\")\n)\n```\n\n## Types\n\n```go\ntype PushSync struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc New(\n\taddress swarm.Address,\n\tnonce []byte,\n\tstreamer p2p.StreamerDisconnecter,\n\tstore Storer,\n\ttopology topology.Driver,\n\tfullNode bool,\n\tunwrap func(swarm.Chunk),\n\tvalidStamp postage.ValidStampFn,\n\tlogger log.Logger,\n\taccounting accounting.Interface,\n\tpricer pricer.Interface,\n\tsigner crypto.Signer,\n\ttracer *tracing.Tracer,\n\twarmupTime time.Duration,\n) *PushSync\n```\n\n```go\nfunc (s *PushSync) Close() error\n```\n\n```go\nfunc (s *PushSync) Metrics() []prometheus.Collector\n```\n\n```go\nfunc (s *PushSync) Protocol() p2p.ProtocolSpec\n```\n\n```go\nfunc (ps *PushSync) PushChunkToClosest(ctx context.Context, ch swarm.Chunk) (*Receipt, error)\n```\nPushChunkToClosest sends chunk to the closest peer by opening a stream. It then waits for a receipt from that peer and returns error or nil based on the receiving and the validity of the receipt.\n\n```go\ntype PushSyncer interface {\n\tPushChunkToClosest(ctx context.Context, ch swarm.Chunk) (*Receipt, error)\n}\n```\n\n```go\ntype Receipt struct {\n\tAddress   swarm.Address\n\tSignature []byte\n\tNonce     []byte\n}\n```\n\n```go\ntype Storer interface {\n\tstorage.PushReporter\n\tReservePutter() storage.Putter\n\tIsWithinStorageRadius(swarm.Address) bool\n\tStorageRadius() uint8\n}\n```\n\n","path":"github.com/ethersphere/bee/pkg/pushsync","name":"pushsync","synopsis":"Package pushsync provides the pushsync protocol implementation.","isRedistributable":true}
