[rpc] enable publicDebugAPI with config flag

pull/3924/head v4.3.7
Nita Neou 3 years ago committed by Leo Chen
parent c698ee4c5d
commit 4e290d026f
  1. 11
      rpc/rpc.go

@ -161,21 +161,26 @@ func getAPIs(hmy *hmy.Harmony, debugEnable bool, rateLimiterEnable bool, ratelim
NewPublicPoolAPI(hmy, Eth),
NewPublicStakingAPI(hmy, V1),
NewPublicStakingAPI(hmy, V2),
NewPublicDebugAPI(hmy, V1),
NewPublicDebugAPI(hmy, V2),
// Legacy methods (subject to removal)
v1.NewPublicLegacyAPI(hmy, "hmy"),
eth.NewPublicEthService(hmy, "eth"),
v2.NewPublicLegacyAPI(hmy, "hmyv2"),
}
publicDebugAPIs := []rpc.API{
//Public debug API
NewPublicDebugAPI(hmy, V1),
NewPublicDebugAPI(hmy, V2),
}
privateAPIs := []rpc.API{
NewPrivateDebugAPI(hmy, V1),
NewPrivateDebugAPI(hmy, V2),
}
if debugEnable {
return append(publicAPIs, privateAPIs...)
apis := append(publicAPIs, publicDebugAPIs...)
return append(apis, privateAPIs...)
}
return publicAPIs
}

Loading…
Cancel
Save