Testnets
You can test your DApp using a local single-node testnet if you want to set one up. In most cases, though, you might not need to set up a testnet yourself. Instead, you can using an existing testnet. Here are the running testnets you can utilize.
You can run tests with metamask, truffle, or remix.

The Amber Testnet

This is a testnet for smartBCH with votes from a BCHN testnet, which has a bitcoincashnode client which mines with CPU.The chain ID is 0x2711. You can use the following JSON-RPC nodes:
  1. 1.
    http://35.220.203.194:8545
  2. 2.
    https://moeing.tech:9545
Test coin faucet can be found at http://54.169.31.93:8080/faucet
We sincerely thank Allen Day for donating several cloud servers to bring up this testnet.
In this testnet, the gas price can be as low as 0.2Gwei.
To join this testnet as a non-validator node, follow the steps below:
First, build the latest binary by running the step 0, 1, 2, 3 of this document.
Second, clone & build smartbch:
1
cd ~/smart_bch
2
git clone -b v0.4.2 --depth 1 https://github.com/smartbch/smartbch
3
cd smartbch
4
go build -tags "params_amber cppbtree" github.com/smartbch/smartbch/cmd/smartbchd
Copied!
Third, prepare the working directory:
1
cp ~/smart_bch/smartbch/smartbchd ~/build/smartbchd
2
cd ~
3
rm -rf .smartbchd
4
~/build/smartbchd init mynode --chain-id 0x2711
5
wget https://github.com/smartbch/artifacts/releases/download/v0.0.5/dot.smartbchd.tgz
6
tar zxvf dot.smartbchd.tgz
7
cp -rf dot.smartbchd/* .smartbchd/
Copied!
Last, start smartbchd.
1
~/build/smartbchd start --mainnet-genesis-height=602983
Copied!
Then you can join the testnet as a non-validator. If want to become a validator, please follow this guide.
If you want to join the underlying BCH testnet, here is the configuration file for bitcoincashnode:
1
regtest=1
2
​
3
[regtest]
4
​
5
bind=0.0.0.0
6
port=8331
7
rpcbind=0.0.0.0
8
rpcport=8332
9
​
10
zmqpubhashtx=tcp://0.0.0.0:8333
11
zmqpubhashblock=tcp://0.0.0.0:8333
12
​
13
rpcuser=test
14
rpcpassword=test
15
rpcthreads=4
16
​
17
rpcallowip=0.0.0.0/0
18
​
19
whitelistrelay=0
20
​
21
addnode=47.115.171.70:28331
Copied!

Docker

You can also run your smartBCH testnet node using Docker. First, clone smartBCH and build Docker image for testnet (or pull prebuilt images from DockerHub):
1
git clone https://github.com/smartbch/smartbch.git
2
cd smartbch
3
docker image build -f Dockerfile.optimized \
4
--build-arg SMARTBCH_BUILD_TAGS='cppbtree,params_amber' \
5
--build-arg SMARTBCH_VERSION=v0.4.2 \
6
--build-arg CONFIG_VERSION=v0.0.4 \
7
--build-arg CHAIN_ID=0x2711 \
8
-t smartbchd-amber:latest .
Copied!
Second, prepare smartBCH testnet home directory:
1
cd somewhere
2
mkdir smartbchd_home
3
docker run \
4
-v path/to/smartbchd_home:/root/.smartbchd \
5
smartbchd:latest init mynode --chain-id 0x2711
6
​
7
wget https://github.com/smartbch/artifacts/releases/download/v0.0.4/dot.smartbchd.tgz
8
tar xvf dot.smartbchd.tgz
9
cp -rfv dot.smartbchd/* smartbchd_home/
Copied!
Last, start smartbchd using Docker like this:
1
docker run \
2
-v path/to/smartbchd_home:/root/.smartbchd \
3
-p 0.0.0.0:18545:8545 \
4
-p 0.0.0.0:18546:8546 \
5
--ulimit nofile=65535:65535 \
6
-d smartbchd-amber:latest start --mainnet-genesis-height=602983
Copied!
Copy link