diff --git a/README.md b/README.md index 74a196d6..e1e2469b 100644 --- a/README.md +++ b/README.md @@ -137,6 +137,39 @@ nvm use 20.16 npm run start ``` +### Run CADT on a Testnet + +Chia has a few test networks called "[testnets](https://docs.chia.net/testnets/)". Testnets allow anyone to test applications using plentiful and low value TXCH instead of needing to purchace XCH. We recommend running a testnet version of CADT in order to test integrations, software updates, and experiment in a low-stakes environment. + +CADT runs on a testnet called "testnetA" which is different than the main Chia testnet, testnet11. TestnetA has a CADT governance node and an [observer](https://chia-cadt-demo.chiamanaged.com/). To configure your Chia and CADT environment to use testnetA, do the following: + +*Note - these instructions only work with Chia version 2.4.4 and above* + + 1. Follow the [instructions here and install chia-tools](https://github.com/chia-network/chia-tools?tab=readme-ov-file#apt-repo-installation). + + 2. Use chia-tools to switch to testneta in the Chia config + + `chia-tools network switch testneta` + + 3. Restart Chia + + `sudo systemctl restart chia-wallet@ chia-data-layer@ chia-full-node@` + + 4. Stop CADT + + `sudo systemctl stop cadt@` + + 4. Update the `GOVERNANCE_BODY_ID` in `~/.chia/mainnet/cadt/v1/config.yaml` to be `1019153f631bb82e7fc4984dc1f0f2af9e95a7c29df743f7b4dcc2b975857409` + + 5. If you already were running CADT on mainnet, delete the CADT database + + `rm ~/.chia/mainnet/cadt/v1/data.sqlite3*` + + 6. Start CADT + + `sudo systemctl start cadt@` + + ### Ports, Networking, and Security By default, the CADT API will listen on localhost only on port 31310. If running a node with `READ_ONLY` set to `false`, it is highly recommended that CADT is run on a private network or with access limited by IP address. To allow remote connections to CADT, set the `BIND_ADDRESS` (see the [Configuration](#configuration) section below) to the IP to listen on, or `0.0.0.0` to listen on all interfaces. The port for the CADT API can be set with the parameter `CW_PORT`. The default port is 31310. In many cases, users will need to access the API from their workstations for either the [CADT UI](https://github.com/Chia-Network/climate-warehouse-ui) or to integrate with existing tools and scripts. To add authentication to the API, use the `CADT_API_KEY` parameter. Alternatively, the API can be served behind an authentication proxy to restrict access and the `CADT_API_KEY` can be left blank. If running an observer node with `READ_ONLY` set to `true`, the CADT API will only share data from the public blockchain, and running without authentication is usually safe. If `READ_ONLY` is set to `false`, authentication must be used to prevent unauthorized writes to the blockchain. @@ -156,6 +189,7 @@ In the `CHIA_ROOT` directory (usually `~/.chia/mainnet` on Linux), CADT will add * **DB_HOST**: Hostname of the MySQL database * **APP**: This section is for configuring the CADT application. * **CW_PORT**: CADT port where the API will be available. 31310 by default. + * **LOG_LEVEL**: Controls verbosity of logging. Common settings are `info` and `debug`. Setting to `silly` will log all queries. * **BIND_ADDRESS**: By default, CADT listens on localhost only. To enable remote connections to CADT, change this to `0.0.0.0` to listen on all network interfaces, or to an IP address to listen on a specific network interface. * **DATALAYER_URL**: URL and port to connect to the [Chia DataLayer RPC](https://docs.chia.net/datalayer-rpc). If Chia is installed locally with default settings, https://localhost:8562 will work. * **WALLET_URL**: URL and port to connect to the [Chia Wallet RPC](https://docs.chia.net/wallet-rpc). If Chia is installed on the same machine as CADT with default settings, https://localhost:9256 will work.