Build
Connect to Rooch
Run local network

Run a local testnet

This section will introduce how to use Rooch CLI to start local development environment.

In the current version, we provide the rooch server start and rooch server clean commands to start the Rooch local service and clean the server storage respectively.

Because Rooch is in the process of rapid development and iteration, you may encounter compatibility issues when deploying contracts. At this time, you can use the clean command to clean up old data.

Start service

When we finish writing the Rooch Move contract project, we need to start the Rooch local testnet to deploy and test the contract.

rooch server start
 
StoreConfig init store dir "/Users/username/.rooch/local/roochdb/rooch_store" "/Users/username/.rooch/local/roochdb/moveos_store"
2023-10-19T16:20:28.558718Z  INFO moveos_common::utils: set max open fds 45056
2023-10-19T16:20:30.235172Z  INFO rooch_rpc_server: RPC Server sequencer address: 0x5078ae74bac281e65fc446b467a843b186904a1b2d435f367030fc755eef1081
2023-10-19T16:20:30.235233Z  INFO rooch_sequencer::actor::sequencer: Load latest sequencer order 0
2023-10-19T16:20:30.235487Z  INFO rooch_rpc_server: RPC Server proposer address: 0x5078ae74bac281e65fc446b467a843b186904a1b2d435f367030fc755eef1081
2023-10-19T16:20:30.235882Z  INFO rooch_rpc_server: acl=Const("*")
2023-10-19T16:20:30.236662Z  INFO rooch_rpc_server: JSON-RPC HTTP Server start listening 0.0.0.0:6767
2023-10-19T16:20:30.236674Z  INFO rooch_rpc_server: Available JSON-RPC methods : ["eth_blockNumber", "eth_getBalance", "eth_gasPrice", "net_version", "rooch_getBalance", "eth_sendTransaction", "rooch_sendRawTransaction", "rooch_getTransactionsByHash", "eth_getTransactionCount", "rooch_executeRawTransaction", "rooch_getEventsByEventHandle", "eth_sendRawTransaction", "eth_getTransactionByHash", "rooch_executeViewFunction", "rooch_getBalances", "eth_getBlockByNumber", "eth_feeHistory", "rooch_listStates", "rooch_getTransactionsByOrder", "eth_getBlockByHash", "rooch_getChainID", "eth_getTransactionReceipt", "eth_estimateGas", "eth_chainId", "rooch_getStates"]
The active env was successfully switched to `local`

Local testnet information

  1. Name: local
  2. ChainID: 4
  3. RPC: http://localhost:6767 (opens in a new tab)

Solve data compatibility issues

If you encounter service data conflicts, first execute the clear command and then continue to start the service:

$ rooch server clean
 
StoreConfig init store dir "/Users/username/.rooch/local/roochdb/rooch_store" "/Users/username/.rooch/local/roochdb/moveos_store"
Rooch server storage successfully cleaned