The docs state that the RPC comes with a few defaultRPCs
and then links to polkadotJS documentation on the available API calls. This doesn't help me if I want to call a method using curl
.
Does anyone know how to call contractInfoOf
using curl
?
I've tried storage_contract_info_of
, storage_contractInfoOf
, and various other combinations using contracts
as the prefix.
e.g.
curl -H "Content-Type: application/json" -d '{"id":1, "jsonrpc":"2.0", "method": "contracts_contractInfoOf", ["5CYKEXWU3L4zWregopd2bTjoZLH9yHBpfXaqkFaTfxacaSA1"]}' http://substrate-node:9933/
However, none of these seem valid. I've used grep
to look for a list of rpc calls in substrate and I got the following:
> grep -rPo '#\[rpc\(name\s=\s"([A-Za-z_]*)' | sort | uniq | awk -F '"' '{print $2}'
babe_epochAuthorship
engine_createBlock
engine_finalizeBlock
grandpa_proveFinality
grandpa_roundState
author_hasKey
author_hasSessionKeys
author_insertKey
author_pendingExtrinsics
author_removeExtrinsic
author_rotateKeys
author_submitExtrinsic
chain_getBlock
chain_getBlockHash
chain_getFinalizedHead
chain_getHeader
childstate_getKeys
childstate_getKeysPaged
childstate_getStorage
childstate_getStorageEntries
childstate_getStorageHash
childstate_getStorageSize
state_getChildReadProof
offchain_localStorageGet
offchain_localStorageSet
state_call
state_getKeys
state_getKeysPaged
state_getMetadata
state_getPairs
state_getReadProof
state_getRuntimeVersion
state_getStorage
state_getStorageHash
state_getStorageSize
state_queryStorage
state_queryStorageAt
state_traceBlock
system_addLogFilter
system_addReservedPeer
system_chain
system_chainType
system_health
system_localListenAddresses
system_localPeerId
system_name
system_nodeRoles
system_peers
system_properties
system_removeReservedPeer
system_reservedPeers
system_resetLogFilter
system_syncState
system_unstable_networkState
system_version
sync_state_genSyncSpec
contracts_call
contracts_getStorage
contracts_instantiate
contracts_upload_code
mmr_generateProof
payment_queryFeeDetails
payment_queryInfo
system_accountNextIndex
system_dryRun
No mention of contractInfoOf
. Where is it located and how do I call it?
rpc_methods
will show you all calls exposed by the node.contractInfoOf
is a state call, e.g. the correct storage key tostage_getStorage
u8aToHex(decodeAddress("5CYKEXWU3L4zWregopd2bTjoZLH9yHBpfXaqkFaTfxacaSA1"))