1

I have a function in say schelling_game pallet:

pub fn create_tree(key: SumTreeName, k: u64) -> DispatchResult {}

Now I am accessing the function in template pallet using tight coupling:

schelling_game::Pallet::<T>::create_tree(key, 2);

But the problem is create_tree is exposed in rpc, anyone can call create_tree as it is public. I want only to call it under template pallet or some other pallet without exposing it to rpc. Making it private doesn't work as I can't access it in template pallet.

Amiya Behera
  • 2,210
  • 19
  • 32
  • I think there's a way to enlist the allowed origin that can pass the Rpc though rpc proxy. In case of http rpc, this might be of a help: https://paritytech.github.io/jsonrpc/jsonrpc_http_server/enum.AccessControlAllowOrigin.html – Sudip Ghimire Feb 17 '22 at 09:04

0 Answers0