2019-07-19 06:30:31 +03:00
|
|
|
# chia-blockchain
|
2019-08-05 09:16:08 +03:00
|
|
|
Python 3.7 is used for this project.
|
2019-07-19 06:30:31 +03:00
|
|
|
|
|
|
|
### Install
|
|
|
|
|
|
|
|
```bash
|
2019-09-19 10:38:54 +03:00
|
|
|
# for Debian-based distros
|
|
|
|
sudo apt-get install build-essential cmake python3-dev --no-install-recommends
|
|
|
|
|
2019-07-19 06:30:31 +03:00
|
|
|
git submodule update --init --recursive
|
|
|
|
python3 -m venv .venv
|
|
|
|
. .venv/bin/activate
|
2019-09-19 10:38:54 +03:00
|
|
|
pip install wheel
|
2019-07-23 17:11:07 +03:00
|
|
|
pip install .
|
2019-07-19 06:30:31 +03:00
|
|
|
pip install lib/chiapos
|
|
|
|
```
|
2019-07-30 09:54:26 +03:00
|
|
|
|
|
|
|
### Run servers
|
2019-08-14 22:02:15 +03:00
|
|
|
Run the servers in the following order (you can also use ipython):
|
2019-07-30 09:54:26 +03:00
|
|
|
```bash
|
2019-08-14 22:02:15 +03:00
|
|
|
python -m src.server.start_plotter
|
|
|
|
python -m src.server.start_timelord
|
|
|
|
python -m src.server.start_farmer
|
2019-09-20 07:57:22 +03:00
|
|
|
python -m src.server.start_full_node "127.0.0.1" 8002 "-f" "-t"
|
|
|
|
python -m src.server.start_full_node "127.0.0.1" 8004
|
|
|
|
|
2019-08-05 09:16:08 +03:00
|
|
|
```
|
2019-09-20 07:57:22 +03:00
|
|
|
You can also run the simulation, which runs all servers at once.
|
|
|
|
|
|
|
|
```bash
|
|
|
|
./src/simulation/simulate_network.sh
|
|
|
|
```
|
|
|
|
|
2019-08-05 09:16:08 +03:00
|
|
|
|
|
|
|
### Run tests
|
|
|
|
```bash
|
|
|
|
py.test tests -s -v
|
|
|
|
```
|
|
|
|
|
|
|
|
### Run linting
|
|
|
|
```bash
|
|
|
|
flake8 src
|
|
|
|
pyright
|
|
|
|
```
|