Commit d8bbb8bc authored by Petar Radovic's avatar Petar Radovic

initial hive protocol skeleton

parent 236c3fd5
......@@ -3,3 +3,48 @@
// license that can be found in the LICENSE file.
package hive
import (
"github.com/ethersphere/bee/pkg/logging"
"github.com/ethersphere/bee/pkg/p2p"
)
const (
protocolName = "hive"
streamName = "hive"
streamVersion = "1.0.0"
)
type Service struct {
streamer p2p.Streamer
logger logging.Logger
}
type Options struct {
Streamer p2p.Streamer
Logger logging.Logger
}
func New(o Options) *Service {
return &Service{
streamer: o.Streamer,
logger: o.Logger,
}
}
func (s *Service) Protocol() p2p.ProtocolSpec {
return p2p.ProtocolSpec{
Name: protocolName,
StreamSpecs: []p2p.StreamSpec{
{
Name: streamName,
Version: streamVersion,
Handler: s.Handler,
},
},
}
}
func (s *Service) Handler(peer p2p.Peer, stream p2p.Stream) error {
return nil
}
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