Skip to content

Commit

Permalink
Merge pull request #158 from Chia-Network/beta-1.2
Browse files Browse the repository at this point in the history
Beta 1.3 release
  • Loading branch information
mariano54 authored Apr 9, 2020
2 parents 1212590 + d4cf4ec commit 51ab626
Show file tree
Hide file tree
Showing 90 changed files with 1,981 additions and 1,051 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,15 @@ jobs:
- name: Install Mac dependencies
if: startsWith(matrix.os, 'mac')
run: |
brew update && brew install gmp boost openssl
brew update
- name: Install ubuntu dependencies
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt-get install libboost-all-dev libssl-dev
sudo apt-get update
sudo apt-get install python3.7-venv python3.7-distutils git -y
#sudo apt-get install libboost-all-dev libssl-dev


- name: Run install script
env:
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
Expand All @@ -48,4 +52,3 @@ jobs:
- name: Test blockchain code with pytest
run: |
./venv/bin/py.test tests -s -v
14 changes: 14 additions & 0 deletions .github/workflows/windows-installer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Build Windows Installer

on: [push, pull_request]

jobs:
upload_source_dist:
name: Upload source distribution
runs-on: [windows-latest]

steps:
- uses: actions/checkout@v1
with:
fetch-depth: 0
# we need fetch-depth 0 so setuptools_scm can resolve tags
2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ The first time the tests are run, BlockTools will create and persist many plots.
proofs of space during testing. The next time tests are run, this won't be necessary.

```bash
. ./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
```
Expand Down
118 changes: 70 additions & 48 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ To install the chia-blockchain node, follow the instructions according to your o
After installing, follow the remaining instructions in [README.md](README.md) to run the software.

### MacOS
Currently Catalina (10.15.x) is required. Make sure [brew](https://brew.sh/) is available before starting the setup.
Currently Catalina (10.15.x) is required.
Make sure [brew](https://brew.sh/) is available before starting the setup.
```bash
brew upgrade python
brew install npm gmp

git clone https://github.com/Chia-Network/chia-blockchain.git
cd chia-blockchain

Expand All @@ -18,98 +16,122 @@ sh install.sh

### Debian/Ubuntu

On Ubuntu 18.04, you need python 3.7. It's not available in the default
repository, so you need to add an alternate source. You can skip this step
if you install in Ubuntu 19.x or higher.

```bash
# for add-apt-repository
sudo apt install software-properties-common -y
sudo add-apt-repository ppa:deadsnakes/ppa -y
```

Install dependencies for Ubuntu 18.04 from above or Ubuntu 19.x or higher.
Install dependencies for Ubuntu 18.04, Ubuntu 19.x or newer.
```bash
sudo apt-get update
sudo apt-get install python3.7-venv python3.7-dev python3-pip git -y
sudo apt-get install python3.7-venv python3.7-distutils git -y

# Either checkout the source and install
git clone https://github.com/Chia-Network/chia-blockchain.git
cd chia-blockchain

sh install.sh

. ./activate

# Or install chia-blockchain as a binary package
python3.7 -m venv venv
ln -s venv/bin/activate
. ./activate
pip install --upgrade pip
pip install -i https://hosted.chia.net/simple/ miniupnpc==2.0.2 setproctitle==1.1.10 cbor2==5.0.1

pip install chia-blockchain==1.0.beta3
```

### Windows (WSL)
#### Install WSL2 + Ubuntu 18.04 LTS

From an Administrator PowerShell
`dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart`
and then
`dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart`.
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.
```bash
# add-apt-repository
sudo add-apt-repository ppa:deadsnakes/ppa -y

sudo apt-get -y update
sudo apt-get -y upgrade
```
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all
```
You will be prompted to reboot. Once that is complete, install Ubuntu 18.04 LTS from the Microsoft Store and run it and complete its initial install steps. You now have linux bash shell that can run linux native software on Windows.

sudo apt-get install python3.7-venv python3.7-dev python3-pip git -y
Then follow the steps below which are the same as the usual Ubuntu instructions above.
```bash
sudo apt-get update
sudo apt-get install python3.7-venv python3.7-distutils git -y

# Either checkout the source and install
git clone https://github.com/Chia-Network/chia-blockchain.git
cd chia-blockchain

sh install.sh

. ./activate

# Or install chia-blockchain as a binary package
python3.7 -m venv venv
ln -s venv/bin/activate
. ./activate
pip install --upgrade pip
pip install -i https://hosted.chia.net/simple/ miniupnpc==2.0.2 setproctitle==1.1.10 cbor2==5.0.1

pip install chia-blockchain==1.0.beta3
```
You will need to download the Windows native Wallet and unzip into somewhere convenient in Windows.
You will need to download the Windows native Wallet and unzip into somewhere convenient in Windows. You may have to choose "More Info" and "Run Anyway" to be able to run the currently unsigned installer. This will place a Chia icon in your Start menu and on your Desktop that starts the Wallet UI.

[Download: chia-win32-x64.zip](https://hosted.chia.net/beta-1.0-win64-wallet/chia-win32-x64.zip)
[Download: Chia-Wallet-Install-0.1.3](https://hosted.chia.net/beta-1.3-win64-wallet/Chia-Wallet-Install-0.1.3.msi)

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.
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" from the Start menu or your Desktop.

### Amazon Linux 2

```bash
sudo yum update
sudo yum install python3 python3-devel git

# Install npm and node
curl -sL https://rpm.nodesource.com/setup_10.x | sudo bash -
sudo yum install nodejs

# uPnP and setproctitle require compiling
sudo yum install gcc
sudo yum update -y
sudo yum install python3 git -y

git clone https://github.com/Chia-Network/chia-blockchain.git
cd chia-blockchain

sh install.sh

. ./activate

# Or install chia-blockchain as a binary package
curl -sL https://rpm.nodesource.com/setup_10.x | sudo bash -
sudo yum install -y nodejs

python3.7 -m venv venv
ln -s venv/bin/activate
. ./activate
pip install --upgrade pip
pip install -i https://hosted.chia.net/simple/ miniupnpc==2.0.2 setproctitle==1.1.10 cbor2==5.0.1

pip install chia-blockchain==1.0.beta3
```

### CentOS 7.7 or newer
### CentOS/RHEL 7.7 or newer

```bash
sudo yum update
sudo yum install gcc openssl-devel bzip2-devel libffi libffi-devel
sudo yum install libsqlite3x-devel
sudo yum update -y

# Compiling python 3.7 is generally required on CentOS 7.7 and newer
sudo yum install gcc openssl-devel bzip2-devel libffi libffi-devel -y
sudo yum install libsqlite3x-devel -y

# Install python 3.7
wget https://www.python.org/ftp/python/3.7.7/Python-3.7.7.tgz
tar -zxvf Python-3.7.7.tgz ; cd Python-3.7.7
./configure --enable-optimizations; sudo make install; cd ..

# Install npm and node
curl -sL https://rpm.nodesource.com/setup_10.x | sudo bash -
sudo yum install nodejs

# Download and install the source version
git clone https://github.com/Chia-Network/chia-blockchain.git
cd chia-blockchain

sh install.sh
. ./activate

# Or install from binary wheels
curl -sL https://rpm.nodesource.com/setup_10.x | sudo bash -
sudo yum install -y nodejs

python3.7 -m venv venv
ln -s venv/bin/activate
. ./activate
pip install --upgrade pip
pip install -i https://hosted.chia.net/simple/ miniupnpc==2.0.2 setproctitle==1.1.10 cbor2==5.0.1

pip install chia-blockchain==1.0.beta3
```
12 changes: 6 additions & 6 deletions LINUX_TIMELORD.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
The Linux chiavdf wheels are currently missing an executable required to run a timelord.
If you want to run a timelord on Linux, you must install the wheel from source (which may require
some additional packages).
If you want to run a timelord on Linux, you must install the wheel from source (which may require some additional packages) while in the virtual environment.

```
source ./activate
pip install --force --no-binary chiavdf chiavdf==0.12.1
. ./activate
sh install-timelord.sh
```

If the compile fails, it's likely due to a missing dependency. See [INSTALL.md](INSTALL.md) to determine
how to install dependent packages for your system.
If the compile fails, it's likely due to a missing dependency. See [INSTALL.md](INSTALL.md)
to determine how to install dependent packages for your system.
19 changes: 12 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,23 @@ For testnet most should only install harvesters, farmers, plotter and full nodes

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`.

## Step 1: Install the code
## Install the code
To install chia-blockchain, follow [these install](INSTALL.md) instructions according to your operating system. This only supports 64 bit operating systems.

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.
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`. (Or . ./venv/bin/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.

## Step 2: Generate keys
## Migrate or set up configuration files
```bash
chia init
```

## Generate keys
First, create some keys by running the following script:
```bash
chia-generate-keys
```

## Step 3a: Run a full node + wallet
## Run a full node + wallet
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.

Expand All @@ -38,7 +43,7 @@ chia-start-wallet-server &
```
And then run `chia.exe` from the unzipped `chia-win32-x64` directory in Windows (not Ubuntu/WSL 2.)

## Step 3b: Run a farmer + full node + wallet
## Run a farmer + full node + wallet
Instead of running only a full node (as in 3a), 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
Expand All @@ -60,7 +65,7 @@ chia-start-wallet-server &
And then run `chia.exe` from the unzipped `chia-win32-x64` directory in Windows (not Ubuntu/WSL 2.)


## Step 3c: Run a timelord + full node + wallet
## Run a timelord + full node + wallet

*Note*
If you want to run a timelord on Linux, see LINUX_TIMELORD.md.
Expand All @@ -85,7 +90,7 @@ you can disable it in the configuration. Some routers may require port forwardin
UPnP in the router configuration.

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.
the number of plots on a physical drive to 50 or less. This limit should significantly increase soon.

You can also run the simulation, which runs all servers and multiple full nodes, locally, at once.

Expand Down
10 changes: 10 additions & 0 deletions electron-ui/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
const wallet_rpc_host_and_port = "ws://127.0.0.1:9256";
const full_node_rpc_host = "127.0.0.1";
const full_node_rpc_port = 8555;


module.exports = {
wallet_rpc_host_and_port,
full_node_rpc_host,
full_node_rpc_port,
}
12 changes: 9 additions & 3 deletions electron-ui/full_node/full_node_rpc_client.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
const http = require('http')
const { full_node_rpc_host, full_node_rpc_port } = require("../config");

class FullNodeRpcClient {
constructor() {
this._host = "127.0.0.1";
this._port = 8555;
this._host = full_node_rpc_host;
this._port = full_node_rpc_port;
}

async get_blockchain_state() {
Expand Down Expand Up @@ -55,13 +56,18 @@ class FullNodeRpcClient {
}
}
const req = http.request(options, res => {
let collected_data = []
if (res.statusCode != 200) {
reject(res.statusCode + " " + res.statusMessage);
return;
}

res.on('data', d => {
resolve(JSON.parse(d));
collected_data = collected_data.concat(d)
})

res.on('end', () => {
resolve(JSON.parse(collected_data))
})
})

Expand Down
3 changes: 1 addition & 2 deletions electron-ui/full_node/renderer-block.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,5 +94,4 @@ async function render() {
}
}

render();
// console.log("header hash", header_hash);
render();
1 change: 0 additions & 1 deletion electron-ui/full_node/renderer-full-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,6 @@ class FullNodeView {
let redisplay_blocks = false;
if (!this.areEqualSets(tip_hashes, this.state.tip_hashes)) {
redisplay_blocks = true;
console.log("Redisplaying bloc.. tips", tip_hashes, this.state.tip_hashes);
this.state.latest_blocks = await this.get_latest_blocks(blockchain_state.tips);
this.state.tip_hashes = tip_hashes;
}
Expand Down
5 changes: 0 additions & 5 deletions electron-ui/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion electron-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"dependencies": {
"dialogs": "2.0.1",
"electron-rebuild": "1.10.0",
"jquery": "3.4.1",
"qrcode": "1.4.4",
"ws": "6.2.1",
"big.js": "5.2.2"
Expand Down
Loading

0 comments on commit 51ab626

Please sign in to comment.