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

Commit

Permalink
Merge pull request #35 from primevprotocol/rpc.0
Browse files Browse the repository at this point in the history
feat: add RPC api for searchers and initialize preconf
  • Loading branch information
ckartik authored Oct 3, 2023
2 parents eb2120d + 72a1db0 commit b128ffc
Show file tree
Hide file tree
Showing 13 changed files with 695 additions and 99 deletions.
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

0 comments on commit b128ffc

Please sign in to comment.