Build
Getting Started
Connect to Rooch
Connect to testnet

Connect testnet

After developers initialize through rooch init, the dev environment is activated by default.

You can view the environment list in the configuration through the command rooch env list:

rooch env list
       Env Alias         |                     RPC URL                      |                  Websocket URL                   |  Active Env 
---------------------------------------------------------------------------------------------------------------------------------------------------------
         local           |               http://0.0.0.0:6767               |                       Null                       |             
          dev            |       https://dev-seed.rooch.network:443/        |                       Null                       |     True  

At this point we need to manually add the test network:

rooch env add --alias test --rpc https://test-seed.rooch.network:443

Activate the test network:

rooch env switch --alias test

Check that you have switched to the correct test network:

rooch env list
       Env Alias         |                     RPC URL                      |                  Websocket URL                   |  Active Env
---------------------------------------------------------------------------------------------------------------------------------------------------------
         local           |               http://0.0.0.0:6767               |                       Null                       |
          dev            |       https://dev-seed.rooch.network:443/        |                       Null                       |
          test           |       https://test-seed.rooch.network:443        |                       Null                       |     True

Testnet network information

  1. Name: test
  2. ChainID: 2
  3. RPC: https://test-seed.rooch.network/ (opens in a new tab)

Note: The current testnet is a pioneer network, and the data may be reset before the permanent incentive testnet is launched!

Call RPC via curl

Query the ID information of the current chain and you can see that the returned JSON data is exactly the information of the test network:

curl -H "Content-Type: application/json" -X POST --data '{"jsonrpc":"2.0","method":"rooch_getChainID","params":[],"id":1}' https://test-seed.rooch.network
{"jsonrpc":"2.0","result":"2","id":1}

Deploy the Example contract

Currently, the testnet will automatically allocate GasCoin to developers, and developers can deploy contracts directly through commands.

git clone https://github.com/rooch-network/rooch.git
cd rooch
rooch move publish -p ./examples/counter --sender-account default --named-addresses rooch_examples=default