-
Notifications
You must be signed in to change notification settings - Fork 248
/
service.go
62 lines (51 loc) · 1.52 KB
/
service.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
package web3provider
import (
"database/sql"
"github.com/ethereum/go-ethereum/p2p"
gethrpc "github.com/ethereum/go-ethereum/rpc"
"github.com/status-im/status-go/account"
"github.com/status-im/status-go/transactions"
"github.com/status-im/status-go/multiaccounts/accounts"
"github.com/status-im/status-go/params"
"github.com/status-im/status-go/rpc"
"github.com/status-im/status-go/services/permissions"
"github.com/status-im/status-go/services/rpcfilters"
)
func NewService(appDB *sql.DB, accountsDB *accounts.Database, rpcClient *rpc.Client, config *params.NodeConfig, accountsManager *account.GethManager, rpcFiltersSrvc *rpcfilters.Service, transactor *transactions.Transactor) *Service {
return &Service{
permissionsDB: permissions.NewDB(appDB),
accountsDB: accountsDB,
rpcClient: rpcClient,
rpcFiltersSrvc: rpcFiltersSrvc,
config: config,
accountsManager: accountsManager,
transactor: transactor,
}
}
type Service struct {
permissionsDB *permissions.Database
accountsDB *accounts.Database
rpcClient *rpc.Client
rpcFiltersSrvc *rpcfilters.Service
accountsManager *account.GethManager
config *params.NodeConfig
transactor *transactions.Transactor
}
func (s *Service) Start() error {
return nil
}
func (s *Service) Stop() error {
return nil
}
func (s *Service) APIs() []gethrpc.API {
return []gethrpc.API{
{
Namespace: "provider",
Version: "0.1.0",
Service: NewAPI(s),
},
}
}
func (s *Service) Protocols() []p2p.Protocol {
return nil
}