2024-06-24 14:29:40 +00:00
|
|
|
package connector
|
|
|
|
|
|
|
|
import (
|
2024-07-18 15:30:10 +00:00
|
|
|
"database/sql"
|
|
|
|
|
2024-06-24 14:29:40 +00:00
|
|
|
"github.com/ethereum/go-ethereum/p2p"
|
|
|
|
|
|
|
|
gethrpc "github.com/ethereum/go-ethereum/rpc"
|
2024-07-18 15:30:10 +00:00
|
|
|
"github.com/status-im/status-go/services/connector/commands"
|
2024-06-24 14:29:40 +00:00
|
|
|
)
|
|
|
|
|
2024-07-18 15:30:10 +00:00
|
|
|
func NewService(db *sql.DB, rpc commands.RPCClientInterface, nm commands.NetworkManagerInterface) *Service {
|
2024-06-24 14:29:40 +00:00
|
|
|
return &Service{
|
2024-07-18 15:30:10 +00:00
|
|
|
db: db,
|
|
|
|
rpc: rpc,
|
|
|
|
nm: nm,
|
2024-06-24 14:29:40 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
type Service struct {
|
2024-07-18 15:30:10 +00:00
|
|
|
db *sql.DB
|
|
|
|
rpc commands.RPCClientInterface
|
|
|
|
nm commands.NetworkManagerInterface
|
2024-06-24 14:29:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (s *Service) Start() error {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *Service) Stop() error {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *Service) APIs() []gethrpc.API {
|
|
|
|
return []gethrpc.API{
|
|
|
|
{
|
|
|
|
Namespace: "connector",
|
|
|
|
Version: "0.1.0",
|
|
|
|
Service: NewAPI(s),
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *Service) Protocols() []p2p.Protocol {
|
|
|
|
return nil
|
|
|
|
}
|