Setup the ETH RPC Adaptor for the Script Testnet

This page provides the instructions to setup the ETH RPC Adaptor for the Script Testnet on a virtual machine. The adaptor is a middleware which translates the Script RPC interface to the Ethereum RPC interface. To enable the Script ETH RPC API service, you’d need to run
  1. 1.
    the Script Node, and
  2. 2.
    the Script/ETH RPC adaptor on the same VM.
Below is the recommended VM spec:
OS: Ubuntu (18.04.4 LTS or higher version)
CPU: 4 cores or more
Memory: 32 GB or more
Hardrive: 1 TB+ SSD drive
(I) Install and Launch the Script Testnet Node (
(II) Install and Launch the ETH RPC adaptor
Install the adaptor
You'd need to compile the adaptor from the source code. First, install Go 1.14.2 and set environment variables GOPATH , GOBIN, and PATH. Next, clone the Script blockchain repo and install Script following the steps below:
mkdir -p $GOPATH/src/
cd $GOPATH/src/
git clone $GOPATH/src/
cd script
git checkout release
export GO111MODULE=on
make install
Next, clone the script-eth-rpc-adaptor repo:
cd $GOPATH/src/
git clone
Following the steps below to build the script-eth-rpc-adaptor binary and copy it into your $GOPATH/bin.
export GO111MODULE=on
make install
Start the Adaptor
Now, create the config folder for the RPC adaptor
mkdir -p ../scriptnet/eth-rpc-adaptor
Use your favorite editor to open file ../scriptnet/eth-rpc-adaptor/config.yaml, paste in the follow content, save and close the file:
rpcEndpoint: ""
skipInitializeTestWallets: true
enabled: true
httpAddress: ""
httpPort: 18888
wsAddress: ""
wsPort: 18889
timeoutSecs: 600
maxConnections: 2048
levels: "*:info"
Then, launch the adaptor binary with the following command:
screen -S rpc_adaptor # if you run the node on a Linux server
script-eth-rpc-adaptor start --config=../scriptnet/eth-rpc-adaptor
The ETH RPC server should now be started at port 18888.
Sanity checks
After the adaptor is started, you can issue the following curl commands to make sure the ETH RPC APIs service is up and running. Note that in the config.yaml file, rpc.httpAddress is set to "", which enables the RPC APIs to be accessible from a remote machine. Of course, you'd also need to setup proper firewall rules to allow remote access.

Query Chain ID

curl -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"eth_chainId","params":[],"id":67}'

Query synchronization status

curl -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}'

Query block number

curl -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":83}'

Query account SPAY balance (should return an integer which represents the current SPAY balance in wei)

curl -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"eth_getBalance","params":["0xc15149236229bd13f0aec783a9cc8e8059fb28da", "latest"],"id":1}'