When running a substrate node, the CLI accepts a parameter called
rpc_methods which accepts
How can developers declare an RPC call Unsafe and how can one get the list of
Stack Exchange network consists of 181 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.Visit Stack Exchange
Substrate and Polkadot Stack Exchange is a question and answer site for developers building blockchains with the Substrate SDK. It only takes a minute to sign up.Sign up to join this community
Declaring a RPC unsafe is completely up to the developer. You need to pass the
DenyUnsafe type to your RPC implementation. (you get the deny unsafe passed to the
rpc_extensions_builder). Then you need to call in your RPC
self.deny_unsafe.check_if_safe()?. That's it.
how can one get the list of RpcMethods::Unsafe methods
That is currently not supported!
author.insert_keyor expensive rpc like
state.storage_pairsshould be marked as unsafe. You can just search substrate code base with
deny_unsafe.check_if_safe()to find all unsafe methods as mentioned above