-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEthereumRPCShell.go
More file actions
28 lines (23 loc) · 986 Bytes
/
EthereumRPCShell.go
File metadata and controls
28 lines (23 loc) · 986 Bytes
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
package EthereumRPCShell
import (
"github.com/AKACoder/EthereumRPCShell/common/rpcLog"
. "github.com/AKACoder/EthereumRPCShell/ethRPCShellConfig"
. "github.com/AKACoder/EthereumRPCShell/ethereumRPC"
"github.com/AKACoder/EthereumRPCShell/ethereumRPC/ethRPCHandler"
"github.com/AKACoder/EthereumRPCShell/ethereumRPC/ethRPCHandler/ethRPCExecShells"
"github.com/AKACoder/EthereumRPCShell/ethereumRPC/middleware"
. "github.com/AKACoder/EthereumRPCShell/ethereumRPCProvider"
"github.com/AKACoder/EthereumRPCShell/network/http"
"github.com/AKACoder/EthereumRPCShell/shellErrors"
"sync"
)
func StartRPCShell(provider IEthereumRPCProvider, cfg Config) (*sync.WaitGroup, error) {
rpcLog.SetUpLogger(cfg.LOG)
shellErrors.Load()
ethRPCExecShells.RegisterProvider(provider)
ethRPCHandler.LoadShells()
middleware.RegisterServiceMiddleWare()
server := http.Server{Config: &cfg.HTTP}
server.Config.RouteRegisters = []http.RouteRegister{RoutesRegister}
return server.Start(nil)
}