Skip to content

Commit

Permalink
[rpc] enable publicDebugAPI with config flag
Browse files Browse the repository at this point in the history
  • Loading branch information
sophoah authored and Leo Chen committed Mar 11, 2022
1 parent c698ee4 commit 4e290d0
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions rpc/rpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 4e290d0

Please sign in to comment.