Skip to content

Commit 101c448

Browse files
committed
Merge branch 'integration'
2 parents 02e9695 + ca133a6 commit 101c448

File tree

1,081 files changed

+32124
-210106
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,081 files changed

+32124
-210106
lines changed

.flake8

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
[flake8]
22
max-line-length = 120
33
exclude = ./typings/**/*
4+
ignore = E203,W503

.github/workflows/pythonpackage.yml

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ jobs:
77
build:
88
runs-on: ${{ matrix.os }}
99
strategy:
10+
fail-fast: false
1011
max-parallel: 4
1112
matrix:
1213
python-version: [3.7, 3.8]
@@ -18,31 +19,33 @@ jobs:
1819
uses: actions/[email protected]
1920
with:
2021
python-version: ${{ matrix.python-version }}
21-
- name: Install dependencies
22+
- name: Install Mac dependencies
23+
if: startsWith(matrix.os, 'mac')
24+
run: |
25+
brew update && brew install gmp boost openssl
26+
- name: Install ubuntu dependencies
27+
if: startsWith(matrix.os, 'ubuntu')
28+
run: |
29+
sudo apt-get install libboost-all-dev libssl-dev
30+
- name: Run install script
31+
env:
32+
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
2233
run: |
23-
brew update && brew install gmp boost || echo ""
2434
sh install.sh
25-
- name: Test proof of space
26-
run: |
27-
cd lib/chiapos
28-
mkdir -p build && cd build
29-
cmake ../
30-
cmake --build . -- -j 6
31-
./RunTests
32-
cd ../../../
33-
- name: Test vdf
34-
run: |
35-
. .venv/bin/activate
36-
cd lib/chiavdf/fast_vdf
37-
python python_bindings/test_verifier.py
38-
cd ../../../
35+
- name: Install time lord
36+
run: |
37+
. ./activate
38+
sh install-timelord.sh
39+
- name: Install developer requirements
40+
run: |
41+
venv/bin/python -m pip install -r requirements-dev.txt
3942
- name: Lint source with flake8
4043
run: |
41-
./.venv/bin/flake8 src
44+
./venv/bin/flake8 src
4245
- name: Lint source with mypy
4346
run: |
44-
./.venv/bin/mypy src tests
47+
./venv/bin/mypy src tests
4548
- name: Test blockchain code with pytest
4649
run: |
47-
./.venv/bin/py.test tests -s -v
50+
./venv/bin/py.test tests -s -v
4851
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Build
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
upload_source_dist:
7+
name: Upload source distribution
8+
runs-on: [macos-latest]
9+
10+
steps:
11+
- uses: actions/checkout@v1
12+
with:
13+
fetch-depth: 0
14+
# we need fetch-depth 0 so setuptools_scm can resolve tags
15+
- uses: actions/setup-python@v1
16+
name: Install Python
17+
with:
18+
python-version: '3.7'
19+
20+
- name: Build source distribution
21+
run: |
22+
pip install pep517
23+
python -m pep517.build --source --out-dir dist .
24+
25+
- name: Upload artifacts
26+
uses: actions/upload-artifact@v1
27+
with:
28+
name: dist
29+
path: ./dist
30+
31+
- name: Install twine
32+
run: pip install twine
33+
34+
- name: Publish distribution to Test PyPI
35+
env:
36+
TWINE_REPOSITORY_URL: https://test.pypi.org/legacy/
37+
TWINE_USERNAME: __token__
38+
TWINE_NON_INTERACTIVE: 1
39+
TWINE_PASSWORD: ${{ secrets.test_pypi_password }}
40+
run: twine upload --non-interactive --skip-existing --verbose 'dist/*'
41+
42+
- name: Publish distribution to PyPI
43+
if: startsWith(github.event.ref, 'refs/tags')
44+
env:
45+
TWINE_USERNAME: __token__
46+
TWINE_NON_INTERACTIVE: 1
47+
TWINE_PASSWORD: ${{ secrets.pypi_password }}
48+
run: twine upload --non-interactive --skip-existing --verbose 'dist/*'

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ pip-delete-this-directory.txt
5252
.python-version
5353
.eggs
5454
.venv
55+
venv
56+
activate
5557

5658
# mypy
5759
.mypy_cache/
@@ -61,3 +63,9 @@ pip-delete-this-directory.txt
6163

6264
# Packaging
6365
chia-blockchain.tar.gz
66+
67+
# Electron wallet node modules
68+
src/wallet/electron/node_modules/
69+
70+
# Node modules
71+
**/node_modules

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ If you want to learn more about this project, read the [wiki](https://github.com
1212
We would be pleased to accept code contributions to this project.
1313
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.
1414
You can visit our [Trello project board](https://trello.com/b/ZuNx7sET) to get a sense of what is in the backlog.
15-
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.
15+
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.
1616
Usually the things closer to the top of each column are the ones that will be worked on soonest.
1717
If you are interested in cryptography, math, or just like hacking in python, there are many interesting problems to work on.
1818
Contact any of the team members on keybase: https://keybase.io/team/chia_network.public, which we use as the main communication method and you can comment on any Trello card.
@@ -22,15 +22,15 @@ The first time the tests are run, BlockTools will create and persist many plots.
2222
proofs of space during testing. The next time tests are run, this won't be necessary.
2323

2424
```bash
25-
black src tests && flake8 src && mypy src tests
25+
black src tests && flake8 src --exclude src/wallet/electron/node_modules && mypy src tests
2626
py.test tests -s -v
2727
```
2828
Black is used as an automatic style formatter to make things easier, and flake8 helps ensure consistent style.
2929
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.
3030

3131
### Configure VS code
3232
1. Install Python extension
33-
2. Set the environment to ./.venv/bin/python
33+
2. Set the environment to ./venv/bin/python
3434
3. Install mypy plugin
3535
4. Preferences > Settings > Python > Linting > flake8 enabled
3636
5. Preferences > Settings > Python > Linting > mypy enabled

INSTALL.md

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
## Installation
2+
3+
To install the chia-blockchain node, follow the instructions according to your operating system.
4+
After installing, follow the remaining instructions in [README.md](README.md) to run the software.
5+
6+
### MacOS
7+
Make sure [brew](https://brew.sh/) is available before starting the setup.
8+
```bash
9+
brew upgrade python
10+
brew install npm gmp
11+
12+
git clone https://github.com/Chia-Network/chia-blockchain.git
13+
cd chia-blockchain
14+
15+
sh install.sh
16+
. ./activate
17+
```
18+
19+
### Debian/Ubuntu
20+
21+
On Ubuntu 18.04, you need python 3.7. It's not available in the default
22+
repository, so you need to add an alternate source. You can skip this step
23+
if you install in Ubuntu 19.x or higher.
24+
25+
```bash
26+
# for add-apt-repository
27+
sudo apt install software-properties-common -y
28+
sudo add-apt-repository ppa:deadsnakes/ppa -y
29+
```
30+
31+
Install dependencies for Ubuntu 18.04 from above or Ubuntu 19.x or higher.
32+
```bash
33+
sudo apt-get update
34+
sudo apt-get install python3.7-venv python3.7-dev python3-pip git -y
35+
36+
git clone https://github.com/Chia-Network/chia-blockchain.git
37+
cd chia-blockchain
38+
39+
sh install.sh
40+
41+
. ./activate
42+
```
43+
44+
### Windows (WSL)
45+
#### Install WSL2 + Ubuntu 18.04 LTS
46+
47+
From an Administrator PowerShell
48+
`dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart`
49+
and then
50+
`dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart`.
51+
This usually requires a reboot. Once that is complete, install Ubuntu 18.04 LTS from the Microsoft Store and run it. Then follow the steps below.
52+
```bash
53+
# add-apt-repository
54+
sudo add-apt-repository ppa:deadsnakes/ppa -y
55+
56+
sudo apt-get -y update
57+
sudo apt-get -y upgrade
58+
59+
sudo apt-get install python3.7-venv python3.7-dev python3-pip git -y
60+
61+
git clone https://github.com/Chia-Network/chia-blockchain.git
62+
cd chia-blockchain
63+
64+
sh install.sh
65+
. ./activate
66+
```
67+
You will need to download the Windows native Wallet and unzip into somewhere convenient in Windows.
68+
69+
[main.js-win32-x64.zip](https://hosted.chia.net/beta-1.0-win64-wallet/main.js-win32-x64.zip)
70+
71+
Instead of `chia-start-wallet-ui &` as explained in the [README.md](README.md) you run `chia-start-wallet-server &` in Ubuntu/WSL 2 to allow the Wallet to connect to the Full Node running in Ubuntu/WSL 2. Once you've enabled `chia-start-wallet-server &` you can run `chia.exe` from the unzipped `chia-win32-x64` directory.
72+
73+
### Amazon Linux 2
74+
75+
```bash
76+
sudo yum update
77+
sudo yum install python3 python3-devel git
78+
79+
# Install npm and node
80+
curl -sL https://rpm.nodesource.com/setup_10.x | sudo bash -
81+
sudo yum install nodejs
82+
83+
# uPnP and setproctitle require compiling
84+
sudo yum install gcc
85+
86+
git clone https://github.com/Chia-Network/chia-blockchain.git
87+
cd chia-blockchain
88+
89+
sh install.sh
90+
91+
. ./activate
92+
```
93+
94+
### CentOS 7.7 or newer
95+
96+
```bash
97+
sudo yum update
98+
sudo yum install gcc openssl-devel bzip2-devel libffi libffi-devel
99+
sudo yum install libsqlite3x-devel
100+
101+
# Install python 3.7
102+
wget https://www.python.org/ftp/python/3.7.7/Python-3.7.7.tgz
103+
tar -zxvf Python-3.7.7.tgz ; cd Python-3.7.7
104+
./configure --enable-optimizations; sudo make install; cd ..
105+
106+
# Install npm and node
107+
curl -sL https://rpm.nodesource.com/setup_10.x | sudo bash -
108+
sudo yum install nodejs
109+
110+
git clone https://github.com/Chia-Network/chia-blockchain.git
111+
cd chia-blockchain
112+
113+
sh install.sh
114+
. ./activate
115+
```

LINUX_TIMELORD.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
The Linux chiavdf wheels are currently missing an executable required to run a timelord.
2+
If you want to run a timelord on Linux, you must install the wheel from source (which may require
3+
some additional packages).
4+
5+
```
6+
source ./activate
7+
pip install --force --no-binary chiavdf chiavdf==0.12.1
8+
```
9+
10+
If the compile fails, it's likely due to a missing dependency. See [INSTALL.md](INSTALL.md) to determine
11+
how to install dependent packages for your system.

0 commit comments

Comments
 (0)