chia-blockchain/README.md

100 lines
4.7 KiB
Markdown
Raw Normal View History

# chia-blockchain
2020-01-15 07:10:34 +03:00
Please check out the [wiki](https://github.com/Chia-Network/chia-blockchain/wiki) and [FAQ](https://github.com/Chia-Network/chia-blockchain/wiki/FAQ) for information on this project.
2020-04-02 03:29:48 +03:00
Python 3.7+ is required. Make sure your default python version is >=3.7 by typing `python3`.
2019-12-05 21:43:24 +03:00
If you are behind a NAT, it can be difficult for peers outside your subnet to reach you. You can 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 rules to allow TCP port 8444 access to your peer. These methods
tend to be router make/model specific.
2020-04-02 03:29:48 +03:00
For 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.
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 <sorgente711@gmail.com> Co-authored-by: Rostislav Skudnov <skrostislav@gmail.com> Co-authored-by: Richard Kiss <him@richardkiss.com> Co-authored-by: wjblanke <wjb2002@flex.com>
2019-12-25 22:18:07 +03:00
2020-04-02 03:29:48 +03:00
All data is now stored in the $CHIA_ROOT environment variable. or ~/.chia/VERSION-DIR/ if unset. You can find databases, keys, plots, logs here. You can set $CHIA_ROOT to the .chia directory in your home directory with `export CHIA_ROOT=~/.chia`.
2020-03-30 00:29:39 +03:00
2020-02-07 08:14:54 +03:00
## Step 1: Install the code
2020-04-02 03:57:59 +03:00
To install chia-blockchain, follow [these install](INSTALL.md) instructions according to your operating system. This only supports 64 bit operating systems.
2020-03-27 20:33:07 +03:00
2020-04-02 03:29:48 +03:00
Remember that once you complete your install you **must be in the Python virtual environment** which you access from the chia-blockchain directory with the command `. ./activate`. Both dots are critical and once executed correctly your cli prompt will look something like `(venv) username@machine:~$` with the (venv) prepended. Use `deactivate` should you want to exit the venv.
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 <sorgente711@gmail.com> Co-authored-by: Rostislav Skudnov <skrostislav@gmail.com> Co-authored-by: Richard Kiss <him@richardkiss.com> Co-authored-by: wjblanke <wjb2002@flex.com>
2019-12-25 22:18:07 +03:00
2020-03-09 16:44:01 +03:00
## Step 2: Generate keys
First, create some keys by running the following script:
2019-07-30 09:54:26 +03:00
```bash
chia-generate-keys
```
2019-09-20 07:57:22 +03:00
## Step 3a: Run a full node + wallet
2020-01-12 04:57:51 +03:00
To run a full node on port 8444, and connect to the testnet, run the following command.
If you want to see std::out log output, modify the logging.std_out variable in ./config/config.yaml.
```bash
chia-start-node &
chia-start-wallet-gui &
2019-08-05 09:16:08 +03:00
```
2019-09-20 07:57:22 +03:00
## Step 3b: Run a farmer + full node + wallet
Instead of running only a full node (as in 4a), you can also run a farmer.
Farmers are entities in the network who use their hard drive space to try to create
blocks (like Bitcoin's miners), and earn block rewards. First, you must generate some hard drive plots, which
2020-01-12 04:57:51 +03:00
can take a long time depending on the [size of the plots](https://github.com/Chia-Network/chia-blockchain/wiki/k-sizes)
(the k variable). Then, run the farmer + full node with the following script. A full node is also started.
You can also change the working directory and
final directory for plotting, with the "-t" and "-d" arguments to the create_plots script.
2019-09-20 07:57:22 +03:00
```bash
chia-create-plots -k 20 -n 10
chia-start-farmer &
chia-start-wallet-gui &
2019-09-20 07:57:22 +03:00
```
## Step 3c: Run a timelord + full node + wallet
*Note*
If you want to run a timelord on Linux, see LINUX_TIMELORD.md.
2020-04-02 03:57:59 +03:00
Timelords execute sequential verifiable delay functions (proofs of time or VDFs), that get added to
blocks to make them valid. This requires fast CPUs and a few cores per VDF as well as completing
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 <sorgente711@gmail.com> Co-authored-by: Rostislav Skudnov <skrostislav@gmail.com> Co-authored-by: Richard Kiss <him@richardkiss.com> Co-authored-by: wjblanke <wjb2002@flex.com>
2019-12-25 22:18:07 +03:00
both install steps above.
2019-10-31 00:38:16 +03:00
```bash
chia-start-timelord &
chia-start-wallet-gui &
2019-10-31 00:38:16 +03:00
```
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 <sorgente711@gmail.com> Co-authored-by: Rostislav Skudnov <skrostislav@gmail.com> Co-authored-by: Richard Kiss <him@richardkiss.com> Co-authored-by: wjblanke <wjb2002@flex.com>
2019-12-25 22:18:07 +03:00
## Tips
When running the servers on Mac OS, allow the application to accept incoming connections.
2019-11-28 09:36:01 +03:00
2020-04-02 03:57:59 +03:00
Ubuntu 18.04 LTS, 19.xx, Amazon Linux 2, and CentOS 7.7 or newer are the easiest linux install environments currently.
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 <sorgente711@gmail.com> Co-authored-by: Rostislav Skudnov <skrostislav@gmail.com> Co-authored-by: Richard Kiss <him@richardkiss.com> Co-authored-by: wjblanke <wjb2002@flex.com>
2019-12-25 22:18:07 +03:00
2020-01-12 04:57:51 +03:00
UPnP is enabled by default, to open port 8444 for incoming connections. If this causes issues,
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 <sorgente711@gmail.com> Co-authored-by: Rostislav Skudnov <skrostislav@gmail.com> Co-authored-by: Richard Kiss <him@richardkiss.com> Co-authored-by: wjblanke <wjb2002@flex.com>
2019-12-25 22:18:07 +03:00
you can disable it in the configuration. Some routers may require port forwarding, or enabling
UPnP in the router configuration.
2019-11-28 09:36:01 +03:00
2020-04-02 03:57:59 +03:00
Due to the nature of proof of space lookups by the harvester in the current release you should limit
the number of plots on a physical drive to 50 or less. This limit should significantly increase before soon.
2019-12-04 03:14:13 +03:00
2019-11-28 09:36:01 +03:00
You can also run the simulation, which runs all servers and multiple full nodes, locally, at once.
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 <sorgente711@gmail.com> Co-authored-by: Rostislav Skudnov <skrostislav@gmail.com> Co-authored-by: Richard Kiss <him@richardkiss.com> Co-authored-by: wjblanke <wjb2002@flex.com>
2019-12-25 22:18:07 +03:00
Note the the simulation is local only and requires installation of timelords and VDFs.
The introducer will only know the local ips of the full nodes, so it cannot broadcast the correct
ips to external peers.
```bash
chia-start-sim
```
## uvloop
For increased networking performance, install uvloop:
```bash
pip install -e ".[uvloop]"
```
2020-01-29 06:16:29 +03:00
You can also use the [HTTP RPC](https://github.com/Chia-Network/chia-blockchain/wiki/Networking-and-Serialization#rpc) api to access information and control the full node:
2020-01-29 06:16:29 +03:00
```bash
curl -X POST http://localhost:8555/get_blockchain_state
curl -d '{"header_hash":"afe223d75d40dd7bd19bf35846d0c9dce608bfc77ee5baa9f9cd6b98436e428b"}' -H "Content-Type: application/json" -X POST http://localhost:8555/get_header
2020-02-07 08:14:54 +03:00
```