Skip to content

Chia-Network/Climate-Wallet

Repository files navigation

Climate Wallet

Minimum Chia Version
Tested Up to Chia Version

This repository holds the source code for the Climate Wallet in the Climate Tokenization Suite. Related programs are:

Note this wallet is an independent plugin to the latest official Chia Wallet.

Note: Version 1.1.0 contains breaking changes. Configuration variables are renamed in the config.yaml file and are best handled by taking a backup of the Climate Wallet config.yaml file, unistalling the Climate Wallet and deleting the climate-wallet config.yaml file, then reinstalling and reconfiguring.

Usage

The Climate Wallet connects with the official Chia Wallet running on localhost. The Climate Wallet also needs to connect to a CADT node, which could be a publicly available observer node.

Installation

Precompiled binaries and installers are available for x86 and ARM versions of MacOS, Windows, and Debian-based Linux distros (Ubuntu, Mint, PopOS, etc) on the releases page.

Using APT on Debian-based Linux Distros (Ubuntu, Mint, etc)

The Climate Wallet can be installed with 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 the Climate Wallet
sudo apt-get update
sudo apt-get install climate-wallet
  1. Run the Climate Wallet from your OS launcher or at the command line with climate-wallet.

Configuration

A config.yaml file located at ./chia/mainnet/climate-wallet. This config file is created when the application is first run. When configuration changes are made, the application must be restarted before they take effect. The default values in this file:

  • cadtApiServerHosts: List of CADT API servers
  • apiTimeout: API request timeout
  • cadtUiHost: CADT UI host
  • version: Climate Wallet version

Developer Guide

Hierarchy

  • src:
    • assets: fonts and images
    • components: react components
    • config: this project configs (env locales)
    • constants: this project constants
    • electron: electron start code
    • hooks: react custom hooks
    • pages: react page
    • services: rtk query service for api
    • store: redux store
    • theme: material-ui theme setting
    • types: typescript types
    • util: this project utilities

Prerequisite

You will need a running instance of Chia Wallet before the next steps.

Developer Installation and Configuration

  • Setup submodule and follow submodule readme to stepup env

    git submodule update --init --recursive
  • copy .env for submodule

    cp .env.submodule climate-token-driver/.env
  • package submodule for dev and production

    npm run package-submodule

    submodule used Climate Token Driver Suite client service port 31314

Run from source for development

  • Install nodejs or NVM

  • Make a .env file for your enviroment variables

    cp .env.example .env
    # change variables in .env
  • Run main script

    npm i
    npm run dev

Package app

  • Windows

    #Build react and electron
    npm run build
    #Build submodule
    npm run package-submodule
    #Package the app
    npm run package-windows
    
  • Mac

    #Build react and electron
    npm run build
    #Build submodule
    npm run package-submodule
    #Package the app
    npm run package-mac

Contributing

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.

  • feat is for introducing a new feature
  • fix is for bug fixes
  • docs for documentation only changes
  • style is for code formatting only
  • refactor is for changes to code which should not be detectable by users or testers
  • perf is for a code change that improves performance
  • test is for changes which only touch test files or related tooling
  • build is for changes which only touch our develop/release tools
  • ci is for changes to the continuous integration files and scripts
  • chore is for changes that don't modify code, like a version bump
  • revert is for reverting a previous commit

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.