-
Notifications
You must be signed in to change notification settings - Fork 3
/
main.go
37 lines (26 loc) · 875 Bytes
/
main.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
package main
import (
"github.com/blockpilabs/solana-drpc/chains/solana"
"github.com/blockpilabs/solana-drpc/dashboard"
"github.com/blockpilabs/solana-drpc/log"
"github.com/blockpilabs/solana-drpc/plugins/statistic"
"github.com/blockpilabs/solana-drpc/providers"
"github.com/blockpilabs/solana-drpc/proxy"
)
var(
logger = log.GetLogger("main")
)
func main() {
solana.InitNodeRedisPools("SOLANA_NODE_", "127.0.0.1:6379","", 0)
statistic.InitStatisticRedisPool("SOLANA_STATISTIC_", "127.0.0.1:6379","", 1)
solana.UpdateClusterNodes()
solana.StartCheckQueue()
solana.UpdateBestRPCNodes()
provider := providers.NewHttpJsonRpcProvider(":9191", "/", &providers.HttpJsonRpcProviderOptions{
TimeoutSeconds: 30,
})
server := proxy.NewProxyServer(provider)
solana.SetProxyServer(server)
go server.Start()
dashboard.ListenAndServ(dashboard.NewRouter())
}