Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

feat: add RPC api for searchers and initialize preconf #35

Merged
merged 3 commits into from
Oct 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions buf.gen.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: v1
plugins:
- plugin: buf.build/protocolbuffers/go:v1.31.0
out: gen/go
opt: paths=source_relative
- plugin: buf.build/grpc/go
out: gen/go
opt: paths=source_relative
7 changes: 7 additions & 0 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
const (
defaultP2PPort = 13522
defaultHTTPPort = 13523
defaultRPCPort = 13524
)

var (
Expand Down Expand Up @@ -88,6 +89,7 @@ type config struct {
PeerType string `yaml:"peer_type" json:"peer_type"`
P2PPort int `yaml:"p2p_port" json:"p2p_port"`
HTTPPort int `yaml:"http_port" json:"http_port"`
RPCPort int `yaml:"rpc_port" json:"rpc_port"`
LogFmt string `yaml:"log_fmt" json:"log_fmt"`
LogLevel string `yaml:"log_level" json:"log_level"`
Bootnodes []string `yaml:"bootnodes" json:"bootnodes"`
Expand All @@ -114,6 +116,10 @@ func checkConfig(cfg *config) error {
cfg.HTTPPort = defaultHTTPPort
}

if cfg.RPCPort == 0 {
cfg.RPCPort = defaultRPCPort
}

if cfg.LogFmt == "" {
cfg.LogFmt = "text"
}
Expand Down Expand Up @@ -159,6 +165,7 @@ func start(c *cli.Context) error {
PeerType: cfg.PeerType,
P2PPort: cfg.P2PPort,
HTTPPort: cfg.HTTPPort,
RPCPort: cfg.RPCPort,
Logger: logger,
Bootnodes: cfg.Bootnodes,
})
Expand Down
279 changes: 279 additions & 0 deletions gen/go/rpc/searcherapi/v1/searcherapi.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading