Skip to content

Commit d9bf22c

Browse files
hoffmang9mariano54rostislavrichardkisswjblanke
committed
Separate timelord, add Windows/CentOS/AMZN (#62)
1.1.1 release * windows build instructions * install.sh newline fix \n wasn't as cross platform as it should be so reverted to an extra echo * Add CentOS to README.md Full CentOS 7.7 install instructions * mention blspy * confirmed boost 1.67.0 works on Ubuntu * Update README.md. * Fix problem with zip download. * Remove scm warning Revert install instructions due to scm fix * Update README and install scripts to separate timelord installation Do not install VDF server and its dependencies in install.sh, create a separate script install_timelord.sh for that. * Move installation of VDF server dependencies to install_timelord.sh * First and broken attempt at CentOS install * Working CentOS 7.7 install * typos in timelord explanation * Timlord/VDF build instructions Specifics for CentOS and MacOS * Various install tips and tricks * spelling error * Add AMZN linux 2 install * Add AMZN linux 2 timelord install Also clean up base install instructions * Combine TL for AMZN and CentOS * Nits for AMZN and CentOS * CentOS, AMZN timelord paralleling * Fix header layouts * Replace VDF server compilation scripts with Makefile * layout improvements * fast_vdf: Remove unused files * Partial ARM install support * missing l in lib * Fleshed out Windows/WSL installs And verified the method for upgrade to 19.x * Move MacOS install fullnode to bottom * Change to mongo "system-wide" * Add mongo start to WSL * Add actual upgrade for WSL/Ubuntu Co-authored-by: Mariano Sorgente <[email protected]> Co-authored-by: Rostislav Skudnov <[email protected]> Co-authored-by: Richard Kiss <[email protected]> Co-authored-by: wjblanke <[email protected]>
1 parent 5492bbf commit d9bf22c

File tree

12 files changed

+273
-135
lines changed

12 files changed

+273
-135
lines changed

README.md

Lines changed: 205 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,51 +3,224 @@ Python 3.7 is used for this project. Make sure your default python version is >=
33

44
You will need to enable [UPnP](https://www.homenethowto.com/ports-and-nat/upnp-automatic-port-forward/) on your router or add a NAT (for IPv4 but not IPv6) and firewall rule to allow TCP port 8444 access to your peer. These methods tend to be router make/model specific.
55

6-
### Install on Debian/Ubuntu
6+
For alpha testnet most should only install harvesters, farmers, plotter and full nodes. Building timelords and VDFs is for sophisticated users in most environments. Chia Network and additional volunteers are running sufficient time lords for testnet consensus.
7+
8+
## Install harvester, farmer, plotter, and full node
9+
10+
### Debian/Ubuntu
711

812
```bash
913
sudo apt-get update
10-
sudo apt-get install build-essential cmake python3-dev python3-venv --no-install-recommends
14+
sudo apt-get install build-essential cmake python3-dev python3-venv libssl-dev libffi-dev --no-install-recommends
15+
16+
git clone https://github.com/Chia-Network/chia-blockchain.git
17+
cd chia-blockchain
18+
19+
sh install.sh
20+
21+
# Install MongoDB Community Edition
22+
# Instructions - https://docs.mongodb.com/manual/administration/install-on-linux/
23+
24+
# Run mongo database if not running system-wide
25+
mongod --fork --dbpath ./db/ --logpath mongod.log
26+
27+
. .venv/bin/activate
28+
```
29+
### Amazon Linux 2
30+
31+
```bash
32+
sudo yum update
33+
sudo yum install gcc-c++ cmake3 wget git openssl openssl-devel
34+
sudo yum install python3 python3-devel libffi-devel
35+
36+
# CMake - add a symlink for cmake3 - required by blspy
37+
sudo ln -s /usr/bin/cmake3 /usr/local/bin/cmake
38+
39+
git clone https://github.com/Chia-Network/chia-blockchain.git
40+
cd chia-blockchain
41+
42+
sh install.sh
43+
44+
# Install MongoDB Community Edition
45+
# Instructions - https://docs.mongodb.com/manual/administration/install-on-linux/
1146

12-
# Update boost version to 1.71.0 or greater if needed, check version: dpkg -s libboost-dev | grep 'Version'
13-
# Install from www.boost.org
47+
# Run mongo database if not running system-wide
48+
mongod --fork --dbpath ./db/ --logpath mongod.log
49+
50+
. .venv/bin/activate
51+
```
52+
### CentOS 7
53+
54+
```bash
55+
sudo yum update
56+
sudo yum install centos-release-scl-rh epel-release
57+
sudo yum install devtoolset-8-toolchain cmake3 libffi-devel
58+
sudo yum install wget git openssl openssl-devel
59+
60+
# CMake - add a symlink for cmake3 - required by blspy
61+
sudo ln -s /usr/bin/cmake3 /usr/local/bin/cmake
62+
63+
scl enable devtoolset-8 bash
64+
65+
# Install Python 3.7.5 (current rpm's are 3.6.x)
66+
wget https://www.python.org/ftp/python/3.7.5/Python-3.7.5.tgz
67+
tar -zxvf Python-3.7.5.tgz; cd Python-3.7.5
68+
./configure --enable-optimizations; sudo make install; cd ..
69+
70+
git clone https://github.com/Chia-Network/chia-blockchain.git
71+
cd chia-blockchain
1472

1573
sh install.sh
1674

1775
# Install MongoDB Community Edition
1876
# Instructions - https://docs.mongodb.com/manual/administration/install-on-linux/
1977

20-
# Run mongo database
78+
# Run mongo database if not running system-wide
79+
mongod --fork --dbpath ./db/ --logpath mongod.log
80+
81+
. .venv/bin/activate
82+
```
83+
84+
### Windows (WSL + Ubuntu)
85+
#### Install WSL + Ubuntu 18.04 LTS, upgrade to Ubuntu 19.x
86+
87+
This will require multiple reboots. From an Administrator PowerShell
88+
`Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux`
89+
and then
90+
`Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform`.
91+
Once that is complete, install Ubuntu 18.04 LTS from the Windows Store.
92+
```bash
93+
# Upgrade to 19.x
94+
sudo nano /etc/update-manager/release-upgrades
95+
# Change "Prompt=lts" to "Prompt=normal" save and exit
96+
97+
sudo apt-get -y update
98+
sudo apt-get -y upgrade
99+
sudo do-release-upgrade
100+
101+
sudo apt-get install -y build-essential cmake python3-dev python3-venv mongodb software-properties-common --no-install-recommends
102+
103+
git clone https://github.com/Chia-Network/chia-blockchain.git
104+
cd chia-blockchain
105+
106+
sudo sh install.sh
107+
108+
# Run mongo database if not running system-wide
21109
mongod --fork --dbpath ./db/ --logpath mongod.log
22110

23111
. .venv/bin/activate
24112
```
25-
### Install on MacOS
113+
114+
#### Alternate method for Ubuntu 18.04 LTS
115+
In `./install.sh`:
116+
Change `python3` to `python3.7`
117+
Each line that starts with `pip ...` becomes `python -m pip ...`
118+
119+
```bash
120+
sudo apt-get -y update
121+
sudo apt-get install -y build-essential cmake python3-dev python3-venv mongodb software-properties-common --no-install-recommends
122+
123+
# Install python3.7 with ppa
124+
sudo add-apt-repository -y ppa:deadsnakes/ppa
125+
sudo apt-get -y update
126+
sudo apt-get install -y python3.7 python3.7-venv python3.7-dev
127+
128+
git clone https://github.com/Chia-Network/chia-blockchain.git
129+
cd chia-blockchain
130+
131+
sudo sh install.sh
132+
133+
# Run mongo database if not running system-wide
134+
mongod --fork --dbpath ./db/ --logpath mongod.log
135+
136+
. .venv/bin/activate
137+
```
138+
139+
### MacOS
26140
Make sure [brew](https://brew.sh/) is available before starting the setup.
27141
```bash
28142
brew tap mongodb/brew
29143
brew upgrade python
30-
brew install cmake boost gmp mpir mpfr [email protected]
31-
32-
git clone https://github.com/Chia-Network/chia-blockchain.git && cd chia-blockchain
144+
brew install cmake [email protected]
33145

34-
git clone https://github.com/wbhart/flint2
146+
git clone https://github.com/Chia-Network/chia-blockchain.git
147+
cd chia-blockchain
35148

36149
sh install.sh
37150

38-
# Run mongo database
151+
# Run mongo database if not running system-wide
39152
mongod --fork --dbpath ./db/ --logpath mongod.log
40153

41154
. .venv/bin/activate
42155
```
43156

44-
### Generate keys
157+
158+
## Install timelord
159+
Note: this step is needed only if you intend to run a timelord or a local simulation.
160+
These assume you've already successfully installed harvester, farmer, plotting, and full node above.
161+
### Ubuntu/Debian
162+
```bash
163+
cd chia-blockchain
164+
165+
sh install_timelord.sh
166+
```
167+
### Amazon Linux 2 and CentOS 7
168+
```bash
169+
#Only for Amazon Linux 2
170+
sudo amazon-linux-extras install epel
171+
172+
sudo yum install gmp-devel mpfr-devel
173+
174+
# Install Boost 1.72.0
175+
wget https://dl.bintray.com/boostorg/release/1.72.0/source/boost_1_72_0.tar.gz
176+
tar -zxvf boost_1_72_0.tar.gz
177+
cd boost_1_72_0
178+
./bootstrap.sh --prefix=/usr/local
179+
sudo ./b2 install --prefix=/usr/local --with=all; cd ..
180+
181+
# Install Flint2
182+
git clone https://github.com/wbhart/flint2
183+
cd flint2; ./configure; sudo make install; cd ..
184+
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
185+
186+
cd chia-blockchain
187+
188+
sh install_timelord.sh
189+
```
190+
191+
### Windows (WSL + Ubuntu)
192+
#### Install WSL + Ubuntu upgraded to 19.x
193+
```bash
194+
cd chia-blockchain
195+
196+
sh install_timelord.sh
197+
```
198+
#### Alternate method for Ubuntu 18.04
199+
```bash
200+
# Install boost 1.70 with ppa
201+
sudo add-apt-repository -y ppa:mhier/libboost-latest
202+
sudo apt-get update
203+
sudo apt-get install libboost1.70 libboost1.70-dev
204+
```
205+
206+
### MacOS
207+
```bash
208+
brew install boost gmp mpir mpfr
209+
210+
cd chia-blockchain
211+
212+
git clone https://github.com/wbhart/flint2
213+
214+
sh install_timelord.sh
215+
```
216+
217+
## Generate keys
45218
First, create some keys by running the following script:
46219
```bash
47220
python -m scripts.regenerate_keys
48221
```
49222

50-
### Run a full node
223+
## Run a full node
51224
To run a full node on port 8002, and connect to the testnet, run the following command.
52225
This wil also start an ssh server in port 8222 for the UI, which you can connect to
53226
to see the state of the node.
@@ -56,7 +229,7 @@ python -m src.server.start_full_node "127.0.0.1" 8444 -id 1 -u 8222 &
56229
ssh -p 8222 localhost
57230
```
58231

59-
### Run a farmer + full node
232+
## Run a farmer + full node
60233
Farmers are entities in the network who use their hard drive space to try to create
61234
blocks (like Bitcoin's miners), and earn block rewards. First, you must generate some hard drive plots, which
62235
can take a long time depending on the size of the plots (the k variable). Then, run the farmer + full node with
@@ -66,24 +239,34 @@ python -m scripts.create_plots -k 20 -n 10
66239
sh ./scripts/run_farming.sh
67240
```
68241

69-
### Run a timelord + full node
242+
## Run a timelord + full node
70243
Timelords execute sequential verifiable delay functions (proofs of time), that get added to
71-
blocks to make them valid. This requires fast CPUs and a lot of memory.
244+
blocks to make them valid. This requires fast CPUs and a lot of memory as well as completing
245+
both install steps above.
72246
```bash
73247
sh ./scripts/run_timelord.sh
74248
```
75249

76-
### Tips
250+
## Tips
77251
When running the servers on Mac OS, allow the application to accept incoming connections.
78252

79-
UPnP is enabled by default, to open the port for incoming connections. If this causes issues, you can disable it in the configuration. Some routers may require port forwarding, or enabling UPnP in the router configuration.
253+
Ubuntu 19.xx, Amazon Linux 2, and CentOS 7.7 or newer are the easiest linux install environments currently.
254+
255+
UPnP is enabled by default, to open the port for incoming connections. If this causes issues,
256+
you can disable it in the configuration. Some routers may require port forwarding, or enabling
257+
UPnP in the router configuration.
80258

81-
Due to the nature of proof of space lookups by the harvester you should limit the number of plots on a physical drive to 50 or less.
259+
Due to the nature of proof of space lookups by the harvester you should limit the number of plots
260+
on a physical drive to 50 or less. This limit should significantly increase before beta.
82261

83262
You can also run the simulation, which runs all servers and multiple full nodes, locally, at once.
84-
If you want to run the simulation, change the introducer ip in ./config/config.yaml so that the full node points to the local introducer (127.0.0.1:8445).
85-
Note the the simulation is local only.
86-
The introducer will only know the local ips of the full nodes, so it cannot broadcast the correct ips to external peers.
263+
If you want to run the simulation, change the introducer ip in ./config/config.yaml so that the
264+
full node points to the local introducer (127.0.0.1:8445).
265+
266+
Note the the simulation is local only and requires installation of timelords and VDFs.
267+
268+
The introducer will only know the local ips of the full nodes, so it cannot broadcast the correct
269+
ips to external peers.
87270

88271
```bash
89272
sh ./scripts/run_all_simulation.sh

install.sh

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,13 @@
1+
#!/bin/bash
2+
set -e
3+
14
python3 -m venv .venv
25
. .venv/bin/activate
36
pip install wheel # For building blspy
47
pip install -e .
58
pip install -r requirements.txt
69

7-
# Install libgmp, libboost, and libflint, and then run the following
8-
# Check for git clone of flint2 on MacOS and install if found
9-
if [ -f flint2/configure ]; then
10-
cd flint2/
11-
if [ ! -f Makefile ]; then
12-
./configure
13-
fi
14-
make -j4
15-
make install
16-
cd ../
17-
fi
18-
19-
cd lib/chiavdf/fast_vdf && sh install.sh
20-
echo "\nChia blockchain install.sh complete."
10+
echo ""
11+
echo "Chia blockchain install.sh complete."
2112
echo "For assistance join us on Keybase in the #testnet chat channel"
2213
echo "https://keybase.io/team/chia_network.public"

install_timelord.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/bin/bash
2+
set -e
3+
4+
if [ `uname` = "Linux" ] && type apt-get; then
5+
# Debian/Ubuntu
6+
sudo apt-get install -y libgmp3-dev libflint-dev \
7+
libboost-dev libboost-system-dev
8+
fi
9+
10+
# Install libgmp, libboost, and libflint, and then run the following
11+
# Check for git clone of flint2 on MacOS and install if found
12+
if [ -f flint2/configure ]; then
13+
cd flint2/
14+
if [ ! -f Makefile ]; then
15+
./configure
16+
fi
17+
make -j4
18+
make install
19+
cd ../
20+
fi
21+
22+
make -C lib/chiavdf/fast_vdf
23+
24+
echo ""
25+
echo "Chia blockchain install_timelord.sh complete."
26+
echo "For assistance join us on Keybase in the #testnet chat channel"
27+
echo "https://keybase.io/team/chia_network.public"

lib/chiavdf/fast_vdf/Makefile

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
UNAME := $(shell uname)
2+
3+
ifeq ($(UNAME),Linux)
4+
ALL_INSTR := $(shell grep -w avx2 /proc/cpuinfo | grep -w fma | grep -w -q adx \
5+
&& echo 1 || echo 0)
6+
else
7+
ALL_INSTR := 0
8+
endif
9+
10+
LDFLAGS += -no-pie
11+
LDLIBS += -lgmpxx -lgmp -lflint -lboost_system -pthread
12+
CXXFLAGS += -std=c++1z -D VDF_MODE=0 -D ENABLE_ALL_INSTRUCTIONS=$(ALL_INSTR) \
13+
-no-pie -pthread -march=native
14+
ifeq ($(UNAME),Darwin)
15+
CXXFLAGS += -D CHIAOSX=1
16+
else
17+
OPT_CFLAGS = -O3
18+
endif
19+
20+
.PHONY: all clean
21+
22+
all: vdf_server
23+
24+
clean:
25+
rm -f *.o vdf_server compile_asm
26+
27+
vdf_server: vdf_server.o asm_compiled.o
28+
$(CXX) $(LDFLAGS) -o $@ $^ $(LDLIBS)
29+
30+
vdf_server.o: CXXFLAGS += $(OPT_CFLAGS)
31+
32+
asm_compiled.s: compile_asm
33+
./compile_asm
34+
35+
compile_asm: compile_asm.o
36+
$(CXX) $(LDFLAGS) -o $@ $^ $(LDLIBS)

lib/chiavdf/fast_vdf/compile.sh

Lines changed: 0 additions & 2 deletions
This file was deleted.

lib/chiavdf/fast_vdf/copy_to_repo.sh

Lines changed: 0 additions & 2 deletions
This file was deleted.

lib/chiavdf/fast_vdf/install.sh

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)