MCPcopy Create free account
hub / github.com/DeAI-Artist/Linkis / ConfigureRPC

Method ConfigureRPC

test/maverick/node/node.go:1067–1096  ·  view source on GitHub ↗

ConfigureRPC makes sure RPC has all the objects it needs to operate.

()

Source from the content-addressed store, hash-verified

1065
1066// ConfigureRPC makes sure RPC has all the objects it needs to operate.
1067func (n *Node) ConfigureRPC() error {
1068 pubKey, err := n.privValidator.GetPubKey()
1069 if err != nil {
1070 return fmt.Errorf("can't get pubkey: %w", err)
1071 }
1072 rpccore.SetEnvironment(&rpccore.Environment{
1073 ProxyAppQuery: n.proxyApp.Query(),
1074 ProxyAppMempool: n.proxyApp.Mempool(),
1075
1076 StateStore: n.stateStore,
1077 BlockStore: n.blockStore,
1078 EvidencePool: n.evidencePool,
1079 ConsensusState: n.consensusState,
1080 P2PPeers: n.sw,
1081 P2PTransport: n,
1082
1083 PubKey: pubKey,
1084 GenDoc: n.genesisDoc,
1085 TxIndexer: n.txIndexer,
1086 BlockIndexer: n.blockIndexer,
1087 ConsensusReactor: &consensus.Reactor{},
1088 EventBus: n.eventBus,
1089 Mempool: n.mempool,
1090
1091 Logger: n.Logger.With("module", "rpc"),
1092
1093 Config: *n.config.RPC,
1094 })
1095 return nil
1096}
1097
1098func (n *Node) startRPC() ([]net.Listener, error) {
1099 err := n.ConfigureRPC()

Callers 1

startRPCMethod · 0.95

Calls 4

GetPubKeyMethod · 0.65
QueryMethod · 0.65
MempoolMethod · 0.65
WithMethod · 0.65

Tested by

no test coverage detected