• Stars
    star
    332
  • Rank 126,957 (Top 3 %)
  • Language
    TypeScript
  • License
    Apache License 2.0
  • Created almost 4 years ago
  • Updated about 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Chia blockchain GUI in electron/react

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. Run npm run dev:gui

When developing, please:

  • Only edit the code with the Vscode editor.

  • Always have chia-blockchain-gui opened as a root folder in the Vscode and not chia-blockchain, or chia-blockchain-gui/packages/... Failing to do so will result in incorrect auto linting and auto formatting which would not go trough the CI quality checks.

  • When you open the repo in the vscode, click on "Install recommended plugins" pop-up.

  • To develop in testnet, please follow these steps.

  • Please write tests for your code

  • When disabling an eslint rule, please provide a reason after two dashes (--), example:

    // eslint-disable-next-line react-hooks/exhaustive-deps -- Some dependencies intentionally left out

Installing NPM packages

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

  • To install lodash for all packages: npx lerna add lodash
  • To install lodash for single package: npx lerna add lodash --scope=@chia-network/icons
  • To install as a dev dependency, add --dev

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

  • react/no-array-index-key

    Only use index as a key when all of the following conditions are met:

    1. the list and items are static / hardcoded.
    2. the list is never reordered or filtered.

    In all other cases, you have to figure out what unique string you will use as an key, or create a dedicated ID.

  • import/no-extraneous-dependencies

    Packages that are used only in development should not be present on the production build. You have 3 options:

    1. If its a whole directory, add it to the .eslintrc.json file
    2. If its a single file, rename it by adding .dev. in the extension. Example: file.ts -> file.dev.ts
    3. If its a file that is run on the production, use this:
    if (process.env.NODE_ENV === 'development') {
      // eslint-disable-next-line global-require -- We cannot use import since it should be only loaded in development
      const package = require('package');
    }
    

Git workflow

  • Git branch from "main"
  • For Chia employees: prefix your branch with your name, like this: yourName/what-is-the-code-about. This helps when cleaning up old branches.
  • All commits must be signed.

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

  • npm install in the root directory does not install packages correctly (Or other Lerna issues)

    Please run npx lerna clean -y && rm -rf node_modules && npm install && npx lerna bootstrap

  • npm run dev:gui fails to start the app without providing a reason

    1. In your command line, please go to the chia-blockchain directory (one level up)
    2. Run . ./activate
    3. Run cd chia-blockchain-gui
    4. Run npm run dev:gui to start the app.
    5. If still does not work, please open you process manager and kill all Chia / Python related processes.
  • Why is my component keeps rerendering?

    We have why-did-you-render installed.

    You will see the reasons in the electron console after adding this to your functional component:

    YourComponent.whyDidYouRender = {
      logOnDifferentValues: true,
    }
    

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 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.

Chia FAQ/WIKI

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

More Repositories

1

chia-blockchain

Chia blockchain python implementation (full node, farmer, harvester, timelord, and wallet)
Python
10,831
star
2

pool-reference

Reference python implementation of Chia pool operations for pool operators
Python
439
star
3

bladebit

A high-performance k32-only, Chia (XCH) plotter supporting in-RAM and disk-based plotting
C
336
star
4

bls-signatures

BLS signatures in C++, using the blst library for BLS12-381
C++
295
star
5

chiapos

Chia Proof of Space library
HTML
267
star
6

chia-docker

Shell
213
star
7

website

Old Corporate web site
HTML
153
star
8

clvm

[Contract Language|Chia Lisp] Virtual Machine
Python
86
star
9

oldvdf-competition

VDF competition instructions, and simple implementation
Python
86
star
10

chia-network.github.io

The Current Chia Network website
HTML
75
star
11

clvm_rs

Rust implementation of clvm
Rust
67
star
12

chialisp-web

A docusaurus Chialisp website
JavaScript
67
star
13

drplotter

64
star
14

chiavdf

Chia VDF utilities
C++
60
star
15

clvm_tools

Tools for clvm development
Python
51
star
16

chia-dev-tools

A utility for developing in the Chia ecosystem: Chialisp functions, object inspection, RPC client and more.
Python
45
star
17

chips

JavaScript
45
star
18

chia-exporter

RPC/Websocket based metrics exporter for Chia
Go
39
star
19

cadt

Climate Action Data Trust
JavaScript
35
star
20

chia-gaming

OCaml
30
star
21

vdf-competition

Python
25
star
22

chia-docs

Chia Docs - documentation on the Chia blockchain, protocol and client
JavaScript
20
star
23

chia_rs

Rust crate & wheel with consensus code
Rust
19
star
24

CAT-admin-tool

Admin tool for issuing CATs
Python
18
star
25

proofofspace

HTML
15
star
26

go-chia-libs

Go
15
star
27

cadt-ui

Climate Action Data Trust User Interface
TypeScript
15
star
28

keybase-live-feed

JavaScript
14
star
29

post-mortem

This repo holds chia public post mortem records.
12
star
30

internal-custody

Smart coins to secure funds with M of N signature thresholds, re-keying, clawbacks, and timelock spends
Python
12
star
31

node-clvm-lib

A browser friendly implementation of clvm in TypeScript.
TypeScript
12
star
32

chia-dev-guides

Chia Dev Guides - tutorials for developers building on the Chia blockchain
JavaScript
12
star
33

clvm_tools_rs

clvm_tools ported to rust based on https://github.com/Chia-Mine/clvm_tools-js/, and chialisp-21 dialect with a new compiler.
Rust
11
star
34

chia-nft-minting-tool

Bulk Minting tool for NFTs
Python
9
star
35

hsms

HSMS: hardware security module software/simulator
Python
8
star
36

offline-signing-demo

Python
8
star
37

vdftrack1results

Track 1 results for Chia's VDF competition
C
8
star
38

node-chia-bls

A browser friendly implementation of bls-signatures in TypeScript.
TypeScript
8
star
39

vscode-chialisp-lsp

A Chialisp LSP client for Visual Studio Code
Rust
7
star
40

carbon-asset-token

carbon asset token project
JavaScript
7
star
41

mozilla-ca

6
star
42

chialinks

HTML
6
star
43

chia-wallet-connect-dapp-test

dApplication for wallet connect testing
TypeScript
6
star
44

node-chia-wallet-lib

Unofficial implementations for standard puzzles and the wallet for Chia
TypeScript
4
star
45

walletconnect-rpcs-dapp

An example dApp for testing Chia WalletConnect commands.
TypeScript
3
star
46

ledger_sim

Python
3
star
47

node-chia-rpc

An implementation of Chia RPC calls in TypeScript.
TypeScript
3
star
48

vdftrack2results

Track 2 results for Chia's VDF competition
C++
3
star
49

Climate-Wallet

Climate Wallet that integrates with the Chia Wallet
JavaScript
3
star
50

chia-simulator-docker

Docker Containers for a One-click Chiaβ„’ Simulator Setup.
Dockerfile
3
star
51

pub-metrics-grafana

Jinja
3
star
52

build-images

Docker images used for the release pipelines
Dockerfile
2
star
53

chia-operator

A Kubernetes operator for Chia
Go
2
star
54

helm-charts

Smarty
2
star
55

dev-community-meetings

2
star
56

actions

TypeScript
2
star
57

terraform-modules

common modules for chia terraform these modules are intended to be inherited by downstream projects
HCL
2
star
58

Climate-Tokenization-Engine

JavaScript
2
star
59

ansible-roles

Jinja
2
star
60

chia-toolbox

Tools
Python
2
star
61

chia-clawback-primitive

A developer primitive for clawbacks on the Chia Blockchain
Python
2
star
62

chiabip158

Chia's implementation of BIP 158 - https://github.com/bitcoin/bips/blob/master/bip-0158.mediawiki
C++
2
star
63

chialisp-crash-course

TypeScript
2
star
64

proofofspaceresults

C++
1
star
65

ecosystem-activity

Go
1
star
66

core-registry-ui

Unified user interface for the carbon Core Registry suite
JavaScript
1
star
67

vdfcontest2results

C++
1
star
68

go-modules

Go
1
star
69

public_bluebox_image

Generate an AWS AMI for public use
HCL
1
star
70

climate-token-driver

Provides three types of functionality for carbon tokenization
Python
1
star
71

chia-healthcheck

A simple healthcheck for Chia components - support being added to new Chia components over time
Go
1
star
72

climate-explorer-ui

User Interface for Climate Explorer
JavaScript
1
star
73

CAT-addresses

Tool that discovers all CAT addresses
Python
1
star
74

coin-tracing-scripts

Python
1
star
75

Climate-Tokenization-Engine-UI

Create tokenized carbon units on the blockchain
JavaScript
1
star
76

mysqlpunch

A small CLI tool for slamming a table in mysql with records to see how it reacts to load
Go
1
star
77

MonsterSprouts

TypeScript
1
star