The goal of this project is to provide an Ethereum JSON-RPC API server for the upcoming RISC-V contracts runtime pallet. (forked off from pallet-contracts).
This serves the following purposes:
- Users can interact with RISC-V contracts using an Ethereum compatible wallet.
- Developers can use existing Ethereum tooling to interact with pallet-revive.and deploy contracts wherever the new RISC-V runtime pallet is deployed (e.g AssetHub).
-
./rpc
An Ethereum JSON-RPC server, based on jsonrpsee. The API is generated from the official Ethereum JSON-RPC specification. It uses subxt to interact with the Substrate node hosting the RISC-V contracts runtime pallet. -
./chain
A Node bootstrapped from the minimal template The node is configured with pallet-contracts and an evm adapter pallet. -
./demo
A barebone html page to interact with the node using MetaMask and Ether.js.
This command starts the node in --dev
mode.
make node
This command starts the Ethereum JSON-RPC server, by default it runs on localhost:9090
make rpc
Once both the node and the rpc server are started, you can send transaction to the node through the Ethereum JSON-RPC API.
You can use your browser and a wallet such as MetaMask as explained in the following section, or run the examples scripts under ./rpc/examples
(see the Makefile for more info on how to run them).
make demo
This will serve a barebone HTML page at http://localhost:3000
, that let you interact with the node through MetaMask using Ether.js.
You can use the following instructions to setup MetaMask with the local chain.
Note: When you interact with MetaMask and restart the chain, you need to clear the activity tab (Settings > Advanced > Clear activity tab data) See here for more info on how to reset the account activity.
To interact with the local chain, you need to add a new network in MetaMask. See here for more info on how to add a custom network.
Make sure the node and the rpc server are started, and use the following settings to configure the network (MetaMask > Networks > Add a network manually):
- Network name: Revive demo
- RPC URL: http://localhost:9090
- Chain ID: 596
- Currency Symbol:
DEV
You will need to import the following account that is endowed with some balance at genesis to interact with the chain. See here for more info on how to import an account.
- Account:
0x75E480dB528101a381Ce68544611C169Ad7EB342
- Private Key:
a872f6cbd25a0e04a08b1e21098017a9e6194d101d75e13111f71410c59cd57f
- Refereunda 885 - Should we allow EVM compatible contracts on Asset Hub?
- Forum post - Hybrid system chains make Polkadot perimisionless
- Forum post - Contracts update: Solidity on PolkaVM