mirror of
https://github.com/pezkuwichain/pezkuwi-runtime-templates.git
synced 2026-04-22 02:07:55 +00:00
RPC Differences Documentation and RPC Testing Toolkit (#241)
* Added RPC testing toolkit with docs * Add documentation * fix comments --------- Co-authored-by: Amar Singh <asinghchrony@protonmail.com>
This commit is contained in:
committed by
Gustavo Gonzalez
parent
29c6332022
commit
cdba7fea87
@@ -4,6 +4,7 @@
|
|||||||
* EVM Template Guides
|
* EVM Template Guides
|
||||||
** xref:guides/contract_migration.adoc[Contract Migration]
|
** xref:guides/contract_migration.adoc[Contract Migration]
|
||||||
** xref:guides/predeployed_contracts.adoc[Predeployed Contracts]
|
** xref:guides/predeployed_contracts.adoc[Predeployed Contracts]
|
||||||
|
** xref:guides/rpc_differences.adoc[RPC Differences]
|
||||||
* Runtimes
|
* Runtimes
|
||||||
** xref:runtimes/generic.adoc[Generic Runtime]
|
** xref:runtimes/generic.adoc[Generic Runtime]
|
||||||
* Runtime Descriptions
|
* Runtime Descriptions
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
:source-highlighter: highlight.js
|
||||||
|
:highlightjs-languages: rust
|
||||||
|
:github-icon: pass:[<svg class="icon"><use href="#github-icon"/></svg>]
|
||||||
|
|
||||||
|
= RPC Differences
|
||||||
|
|
||||||
|
The EVM in a Substrate node has almost the same RPC calls common to all nodes. But some of them are not applicable for Frontier.
|
||||||
|
|
||||||
|
These are the calls that behave differently than would be expected by regular Ethereum nodes:
|
||||||
|
|
||||||
|
* `eth_sign` / `eth_signTransaction` -- these methods do not exist in the Frontier and this template because it, unlike Ethereum nodes, does not hold any keys.
|
||||||
|
* `eth_syncing` -- it can have additional fields `warp_chunks_amount` and `warp_chunks_processed` that describe warp syncing process.
|
||||||
|
|
||||||
|
Other calls comply to the same scheme as Ethereum nodes provide.
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,19 @@
|
|||||||
|
## RPC Testing Toolkit
|
||||||
|
|
||||||
|
This is a Postman collection to test your the RPC deployment of you smart contract. To use it you should prepare your environment and test toolkit for testing:
|
||||||
|
|
||||||
|
* Open the collection in Postman, and open the variables in it.
|
||||||
|
* Fill the `url` with HTTP RPC url and `chain_id` with your chain's chain id.
|
||||||
|
* Obtain three funded accounts. You may provide them through the chainspec.
|
||||||
|
* Put first address to the `alice_addr` variable and their balance to the `alice_balance`.
|
||||||
|
* Make a transfer transaction from the second address to any address.
|
||||||
|
* Put its hash to the `tx_hash` variable
|
||||||
|
* Put the block number of this transaction to `tx_block_number` and `block_number`. Put the number of transactions in this block (highly likely it will be 1) to the `block_tx_count`.
|
||||||
|
* Put the hash of the block with this transaction to `tx_block_hash` and `block_hash`.
|
||||||
|
* Put the index of the transaction in the block to `tx_index`. Highly likely it will be 0.
|
||||||
|
* Put the address you have sent the transaction from to `tx_from` variable.
|
||||||
|
* Take a third address and deploy the smart contract `TestContract.sol` from it.
|
||||||
|
* Put the address of the deployed contract to the `test_contract` variable.
|
||||||
|
* Put the code from the compiled contract to the `contract_code` variable. It can be found in a resulting JSON file under `deployedBytecode` key.
|
||||||
|
|
||||||
|
When you complete these preparation steps, run the requests from the collection. If some of them are not passing, run them as a single request and see what the request have returned to debug it.
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
contract Storage {
|
||||||
|
uint pos0;
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
pos0 = 1234;
|
||||||
|
}
|
||||||
|
|
||||||
|
// You can read from a state variable without sending a transaction.
|
||||||
|
function get() public view returns (uint) {
|
||||||
|
return pos0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Reference in New Issue
Block a user