chia-blockchain/CONTRIBUTING.md
Gene Hoffman c3a3fdba1f Integrate GH super linter - fix shell, markdown, python issues (#296)
* Try super-linter
* Fix lint issues, move to separate gh action
* Fix md, shell
* Ignore import-error for python - fix MDs
* Disable standard-js, initial eslint config
* Fix raises, remove prettier for now
* skip pylint no-member check in src/util/byte_types.py line 40
* pyinstaller windows back to INFO
* Disable powershell lint for now.
* Disable css validation temporarily
2020-07-16 13:05:43 -07:00

3.7 KiB

Introduction

Welcome to the chia-blockchain project! We are happy that you are taking a look at the code for Chia, a proof of space and time cryptocurrency.

A lot of fascinating new cryptography and blockchain concepts are used and implemented here. This repo includes the code for the Chia full node, farmer, and timelord (in src), which are all written in python. It also includes a verifiable delay function implementation that it imports from the chiavdf repo (in c/c++), and a proof of space implementation that it imports from the chiapos repo. BLS signatures are imported from the bls-signatures repo as blspy. There is an additional dependency on the chiabip158 repo. For major platforms, binary and source wheels are shipped to PyPI from each dependent repo and then chia-blockchain can pip install those from PyPI or they can be prepackaged as is done for the Windows installer. On unsupported platforms, pip will fall back to the source distributions to be compiled locally.

If you want to learn more about this project, read the wiki, or check out the green paper.

Contributions

We would be pleased to accept code contributions to this project. As we are in the alpha stage, the main priority is getting a robust blockchain up and running, with as many of the mainnet features as possible. You can visit our Trello project board to get a sense of what is in the backlog. Generally things to the left are in progress or done. Some things go through "Coming up soon" but some will come directly out of other columns. Usually the things closer to the top of each column are the ones that will be worked on soonest. If you are interested in cryptography, math, or just like hacking in python, there are many interesting problems to work on. Contact any of the team members on Keybase, which we use as the main communication method and you can comment on any Trello card.

Run tests and linting

The first time the tests are run, BlockTools will create and persist many plots. These are used for creating proofs of space during testing. The next time tests are run, this won't be necessary.

. ./activate
pip install -r requirements-dev.txt
black src tests && flake8 src --exclude src/wallet/electron/node_modules  && mypy src tests
py.test tests -s -v

Black is used as an automatic style formatter to make things easier, and flake8 helps ensure consistent style. Mypy is very useful for ensuring objects are of the correct type, so try to always add the type of the return value, and the type of local variables.

Configure VS code

  1. Install Python extension
  2. Set the environment to ./venv/bin/python
  3. Install mypy plugin
  4. Preferences > Settings > Python > Linting > flake8 enabled
  5. Preferences > Settings > Python > Linting > mypy enabled
  6. Preferences > Settings > Formatting > Python > Provider > black
  7. Preferences > Settings > mypy > Targets: set to ./src and ./tests

Submit changes

To submit changes, please make a pull request to the dev development branch.

By contributing to this repository, you agree to license your work under the Apache License Version 2.0, or the MIT License, or release your work to the public domain. Any work contributed where you are not the original author must contain its license header with the original author(s) and be in the public domain, or licensed under the Apache License Version 2.0 or the MIT License.