Chia-Network / chia-blockchain-gui

Chia blockchain GUI in electron/react
https://chia.net
Apache License 2.0
332 stars 246 forks source link
chia chia-blockchain

chia-blockchain-gui

Chia logo

GitHub contributors

Welcome to the Chia GUI repo!

Chia GUI is written in TypeScript and uses Electron/React.

This monorepo consists of the following packages:

Package name Description
api JS/TS library to access the Chia Blockchain RPC
api-react React library that wraps api in hooks
core Common React components and hooks
gui The actual GUI package. It uses our packages like api-react and core under the hood
icons Chia specific icons
wallets Common React components and hooks. Do not use this in you project. Will be merged to core package soon

Development

  1. This repo (chia-blockchain-gui) must be under chia-blockchain repo. Please follow the installation steps for the chia-blockchain. Make sure to install from source code (git clone...).
  2. Run the sh install-gui.sh as instructed in the previous step. This will clone the chia-blockchain-gui under chia-blockchain repo.
  3. Change directory into the chia-blockchain-gui subdirectory.
  4. Run npm run dev:gui

When developing, please:

Installing NPM packages

To install an NPM package, please navigate to the root directory of this repo.

After adding a new NPM package, please pin down the package version. This is done to lower the possibility of supply chain attacks.

Common eslint issues

Git workflow

Git commit messages

  1. Separate subject from body with a blank line

    A single subject line is usually sufficient, but if you need to include additional details, add an empty line after the subject and enter the detailed message. Example:

    Capitalized, short (70 chars or less) summary

    More detailed explanatory text, if necessary. Wrap it to about 72 characters or so. In some contexts, the first line is treated as the subject of an email and the rest of the text as the body. The blank line separating the summary from the body is critical (unless you omit the body entirely); tools like rebase can get confused if you run the two together.

  2. Commit subject line should always be able to complete the following sentence:

    If applied, this commit will your subject line here

    Fixed bug with Y -> Fix bug in the contact form

    Adding new field of X -> Add new field - "discount code", in the order form

    More fixes for broken stuff -> Fix broken responsive layout

Localization

Do not edit files directly in the repo, but instead please head over to our Crowdin project and add/edit translations there.

Troubleshooting

Debugging

  1. In the Chia Electron app, click View -> Developer -> Developer tools.
  2. In the console tab of the developer tools, change the default console events to include verbose events. These are the events emitted from the debug package.

Simulator / SimNet

  1. Please follow the Install and configure the simulator. Do this step only once.
  2. In the chia-blockchain directory, run this to setup the ENV variables. Use these instead of the ones mentioned in the above guide.
export CHIA_ROOT=~/.chia/simulator/main
export CHIA_SIMULATOR_ROOT=~/.chia/simulator
export CHIA_KEYS_ROOT=~/.chia_keys_simulator
  1. . ./activate
  2. chia start simulator
  3. cd chia-blockchain-gui/packages/gui
  4. npm run dev:skipLocales
  5. You should see your simulator wallets. You should not see your testNet / mainNet wallets.
  6. Run chia dev sim farm as many times you want to farm some coins.

Chia FAQ/WIKI

Please check out the wiki and FAQ for information on this project.