I’m trying to figure out differences between system pallets and modules. It’s not quite clear to me whether a system pallets can define a RPC interface or not. I’ve looked at https://github.com/pontem-network/pontem/tree/91f3b122e0d7b14ef1520f281c1e86d959c721d0/pallets/sp-mvm and indeed there is a ‘rpc’ directory but it’s not referenced from sp-mvm sources. On the other hand, I found this https://stackoverflow.com/questions/71734501/error-adding-custom-rpcs-for-custom-pallet-substrate and this https://hackmd.io/@d9WGfolYQmSRBmnxyOQmAg/BkEANECJs so it seems like defining RPC interface is definitely possible.
1 Answer
Pallets can have their own custom RPCs. You have referenced the correct resource:
And here:
There are several examples throughout Substrate pallets where a runtime api is defined for a pallet which can be exposed via RPC. Here is one:
You can find system RPC methods here: