status-go/services/nodebridge/node_service.go

46 lines
1.0 KiB
Go
Raw Normal View History

package nodebridge
2019-10-28 13:50:33 +00:00
import (
"github.com/ethereum/go-ethereum/node"
"github.com/ethereum/go-ethereum/p2p"
"github.com/ethereum/go-ethereum/rpc"
"github.com/status-im/status-go/eth-node/types"
2019-10-28 13:50:33 +00:00
)
// Make sure that NodeService implements node.Service interface.
var _ node.Service = (*NodeService)(nil)
2019-10-28 13:50:33 +00:00
type NodeService struct {
Node types.Node
2019-10-28 13:50:33 +00:00
}
// Protocols returns a new protocols list. In this case, there are none.
func (w *NodeService) Protocols() []p2p.Protocol {
2019-10-28 13:50:33 +00:00
return []p2p.Protocol{}
}
// APIs returns a list of new APIs.
func (w *NodeService) APIs() []rpc.API {
2019-10-28 13:50:33 +00:00
return []rpc.API{
{
Namespace: "status",
Version: "1.0",
Service: w.Node,
2019-10-28 13:50:33 +00:00
Public: false,
},
}
}
// Start is run when a service is started.
// It does nothing in this case but is required by `node.Service` interface.
func (w *NodeService) Start(server *p2p.Server) error {
2019-10-28 13:50:33 +00:00
return nil
}
// Stop is run when a service is stopped.
// It does nothing in this case but is required by `node.Service` interface.
func (w *NodeService) Stop() error {
2019-10-28 13:50:33 +00:00
return nil
}