Files
api/docs/METHODS_RPC.md
T
2018-11-08 09:14:33 +00:00

3.5 KiB

JSON-RPC

The following sections contain RPC methods that are Remote Calls available by default and allow you to interact with the actual node, query, and submit. The RPCs are provided by Substrate itself. The RPCs are never exposed by the runtime.


Back To Top

author

Authoring of network items

▸ pendingExtrinsics(): PendingExtrinsics

  • summary: Returns all pending extrinsics, potentially grouped by sender

▸ submitAndWatchExtrinsic(extrinsic: Extrinsic).subscribe(CALLBACK): ExtrinsicStatus

  • summary: Subscribe and watch an extrinsic until unsubscribed

▸ submitExtrinsic(extrinsic: Extrinsic): Hash

  • summary: Submit a fully formatted extrinsic for block inclusion

Back To Top

chain

Retrieval of chain data

▸ getBlock(hash?: Hash): SignedBlock

  • summary: Get header and body of a relay chain block

▸ getBlockHash(blockNumber?: BlockNumber): Hash

  • summary: Get the block hash for a specific block

▸ getHead(): Hash

  • summary: Retrieves the best headerHash

▸ getHeader(hash?: Hash): Header

  • summary: Retrieves the header for a specific block

▸ getRuntimeVersion(hash?: Hash): RuntimeVersion

  • summary: Get the runtime version

▸ subscribeNewHead().subscribe(CALLBACK): Header

  • summary: Retrieves the best header via subscription

Back To Top

state

Query of state

▸ call(method: Text, data: Bytes): Bytes

  • summary: Perform a call to a builtin on the chain

▸ callAt(method: Text, data: Bytes, block: Hash): Bytes

  • summary: Perform a call to a builtin on the chain (At block)

▸ getMetadata(block?: Hash): Metadata

  • summary: Returns the runtime metadata

▸ getStorage(key: StorageKey): StorageData

  • summary: Retrieves the storage for a key

▸ getStorageAt(key: Bytes, block: Hash): Bytes

  • summary: Retrieves the storage for a key at a specific block

▸ getStorageHash(key: Bytes): Hash

  • summary: Retrieves the storage hash

▸ getStorageHashAt(key: Bytes, block: Hash): Hash

  • summary: Retrieves the storage hash at a specific block

▸ getStorageSize(key: Bytes): u64

  • summary: Retrieves the storage size

▸ getStorageSizeAt(key: Bytes, block: Hash): u64

  • summary: Retrieves the storage size at a specific block

▸ queryStorage(keys: Vec<StorageKey>, startBlock: Hash, block?: Hash): Vec<StorageChangeSet>

  • summary: Query historical storage entries (by key) starting from a start block

▸ subscribeStorage(keys: Vec<StorageKey>).subscribe(CALLBACK): StorageChangeSet

  • summary: Subscribes to storage changes for the provided keys

Back To Top

system

Methods to retrieve system info

▸ chain(): Text

  • summary: Retrieves the chain

▸ name(): Text

  • summary: Retrieves the node name

▸ version(): Text

  • summary: Retrieves the version of the node