2019-07-21 05:41:30 +00:00
|
|
|
package permissions
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/ethereum/go-ethereum/p2p"
|
|
|
|
"github.com/ethereum/go-ethereum/rpc"
|
|
|
|
)
|
|
|
|
|
|
|
|
// NewService initializes service instance.
|
2019-07-25 05:35:09 +00:00
|
|
|
func NewService(db *Database) *Service {
|
|
|
|
return &Service{db: db}
|
2019-07-21 05:41:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type Service struct {
|
|
|
|
db *Database
|
|
|
|
}
|
|
|
|
|
|
|
|
// Start a service.
|
2021-06-30 11:40:54 +00:00
|
|
|
func (s *Service) Start() error {
|
2019-07-21 05:41:30 +00:00
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// Stop a service.
|
|
|
|
func (s *Service) Stop() error {
|
2019-07-25 05:35:09 +00:00
|
|
|
return nil
|
2019-07-21 05:41:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// APIs returns list of available RPC APIs.
|
|
|
|
func (s *Service) APIs() []rpc.API {
|
|
|
|
return []rpc.API{
|
|
|
|
{
|
|
|
|
Namespace: "permissions",
|
|
|
|
Version: "0.1.0",
|
2019-07-25 05:35:09 +00:00
|
|
|
Service: NewAPI(s.db),
|
2019-07-21 05:41:30 +00:00
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Protocols returns list of p2p protocols.
|
|
|
|
func (s *Service) Protocols() []p2p.Protocol {
|
|
|
|
return nil
|
|
|
|
}
|