Test using MetaMask
In this article, we will show how to test smartBCH single-testing-node using MetaMask. We use Chrome browser as example but Firefox browser should work the same way.
Please note in the following example we assume you are using a local single-node testnet. Instead, if you want to use a remote node to provide JSON-RPC, just replace "localhost" with the node's IP address.
Start smartBCH single-testing-node
Please flow this doc to start smartBCH single testing node. When the testing node is started with default options, it will serve JSON-RPC on localhost:8485. You can use the following cmd to check that the node works well and to see the testing accounts:
The output looks like this:
Config MetaMask networks
Install MetaMask into your browser, create or import a wallet, and than add a network configuration:
If you started smartBCH testing node on localhost:8545 for JSON-RPC, it happens that MetaMask has a preconfigured Network that matched this RPC URL:
But the chain ID may not match, in that case, you can replace 1337 with your smartBCH chain ID (for example, for the smartBCH-T1 testnet, it's 0x2711). And it's better that you change Currency Symbol to BCH. You can also add a new Network configuration like this:
Create a new account
Create a new account in MetaMask, and let's name it smartBCH_user1. This newly created account have no BCH (the native token of smartBCH) of cause:
We can transfer 1 BCH to this account using cmd like this:
The from
address comes from output of eth_accounts
RPC. The to
address is copied from MetaMask by clicking the account name. The value
is amount of BCH to send in HEX, and is amplified by 1018. Just like ETH, 1 BCH on smartBCH chain can be divided into 1018 units. The output looks like this:
Wait a second, and you can check that your account has received 1 BCH:
Transfer BCH using MetaMask
Let's create another new account and name it smartBCH_user2:
We can transfer/send to smartBCH_user2 some BCH from smartBCH_user1:
A few seconds later, the balance of smartBCH_user1 and smartBCH_user2 should be updated:
Congratulations! You just started smartBCH single-testing node and tested it with the most popular browser wallet MetaMask. If you are new to MetaMask, you can read it's help docs here.
Last updated