Chia-Network / climate-token-driver

Provides three types of functionality for carbon tokenization
Apache License 2.0
2 stars 3 forks source link
chia-blockchain

Climate Token Driver Suite

Minimum Chia Version Tested Up to Chia Version

This application can run in 4 modes, each providing a separate application with a distinct use case:

When compiling from source, the "mode" is controlled by the .env file. Each application, or mode, is offered as precompiled binaries, appropriate for most users.

Related Projects

Hierarchy

Installation and configuration

Precompiled executables are available for Mac, Windows, and Linux (both ARM and x86) on the releases page.

Debian-based Linux Distros

For users of Debian, Ubuntu, Mint, PopOS, and other Debian-based distributions, a .deb file is provided on the releases page. This can be installed with

dpkg -i package-filename.deb

The Chia Climate Tokenization and Climate Explorer applications are also available via apt:

  1. Start by updating apt and allowing repository download over HTTPS:
sudo apt-get update
sudo apt-get install ca-certificates curl gnupg
  1. Add Chia's official GPG Key (if you have installed Chia with apt, you'll have this key already and will get a message about overwriting the existing key, which is safe to do):
curl -sL https://repo.chia.net/FD39E6D3.pubkey.asc | sudo gpg --dearmor -o /usr/share/keyrings/chia.gpg
  1. Use the following command to setup the repository.
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/chia.gpg] https://repo.chia.net/climate-tokenization/debian/ stable main" | sudo tee /etc/apt/sources.list.d/climate-tokenization.list > /dev/null
  1. Install Chia Clmate Tokenization and Climate Explorer
sudo apt-get update
sudo apt-get install climate-tokenization-chia
sudo apt-get install climate-explorer-chia
  1. Start Chia Climate Tokenization and Climate Explorer with systemd
sudo systemctl start climate-tokenization-chia@<USERNAME>
sudo systemctl start climate-explorer-chia@<USERNAME>

For <USERNAME>, enter the user that Chia runs as (the user with the .chia directory in their home directory). For example, if the ubuntu is where Chia runs, start Chia Climate Tokenization with systemctl start climate-tokenization-chia@ubuntu.

  1. Set the Chia Climate Tokenization and Climate Explorer to run at boot
sudo systemctl enable climate-tokenization-chia@<USERNAME>
sudo systemctl enable climate-explorer-chia@<USERNAME>

From Source

Configurations

Note there are two steps the application loads the configurations:

  1. The application will first look for any environment variables set on the host machine for MODE, CHIA_ROOT, and CONFIG_PATH. Any variables not set on the host system will be loaded from the .env environment file, which is opened via python-dotenv, where ${CHIA_ROOT} and ${CONFIG_PATH} are pre-loaded. This file is not visible to end users in packaged binaries, and are suitable for binary builders to change the default flavor for the binary (though it is overridden by system environment variables).

  2. Then, a config.yaml file located at ${CHIA_ROOT}/${CONFIG_PATH} is loaded, which adds to the configurations after .env. This part of the configuration is free to change by end binary users. When the application is closed and reopened, the new configurable would automatically apply.

The whole list of configurable variables are detailed in config.py, and below we provide brief explanations:

Only when in registry (Chia Climate Tokenization) and client (Climate Token Driver) modes, the following configurations are relevant:

Only in registry mode (Chia Climate Tokenization), the following configurations are relevant:

There is no option to set the SERVER_HOST in registry mode as this is designed to only integrate with the Climate Tokenization Engine or other tokenization engines on localhost and will therefore only listen on 127.0.0.1.

Only in client mode (Climate Token Driver) are the following configurations relevant:

As with registry mode, client mode is only designed to integrate with other tools (such as the Climate Wallet) on localhost and therefore only listens on 127.0.0.1.

Only when in explorer mode, the following configurations are relevant:

For Developers

Run from source for development

Package app

Run test cases

Commiting

Signed commits are required.

​This repo uses a commit convention. A typical commit message might read: ​

    fix: correct home screen layout

​ The first part of this is the commit "type". The most common types are "feat" for new features, and "fix" for bugfixes. Using these commit types helps us correctly manage our version numbers and changelogs. Since our release process calculates new version numbers from our commits it is very important to get this right. ​

After the type and scope there should be a colon.

​ The "subject" of the commit follows. It should be a short indication of the change. The commit convention prefers that this is written in the present-imperative tense.

Branch Layout

All pull requests should be made against the develop branch. Commits to the main branch will trigger a release, so the main branch is always the code in the latest release.