Skip to content

Commit

Permalink
update installation
Browse files Browse the repository at this point in the history
  • Loading branch information
qywang2012 committed Nov 21, 2019
1 parent 1109ccb commit bf81590
Showing 1 changed file with 9 additions and 80 deletions.
89 changes: 9 additions & 80 deletions docs/go-nebulas/tutorials/01-installation.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Nebulas 101 - 01 Compile and Install Nebulas

The current version of Nebulas Mainnet is 2.0, which is called Nebulas Nova.
The current version of Nebulas Mainnet is 2.1.1, which is called Nebulas Nova.

Nebulas Nova aims to discover the value of blockchain data, and it also means the future of collaboration.

Expand All @@ -21,8 +21,8 @@ Nebulas is implemented in Golang and C++.

| Components | Description |
| --- | --- |
| [Golang](https://golang.org) | The Go Programming Language, version >= 1.11 |
| [C++](https://en.wikipedia.org/wiki/C%2B%2B) | The C++ programming language, based on c++14 standard |
| [Golang](https://golang.org) | The Go Programming Language, version >= 1.12 |


### Mac OSX

Expand All @@ -42,10 +42,10 @@ export GOPATH=/path/to/workspace

```bash
# download
wget https://dl.google.com/go/go1.11.linux-amd64.tar.gz
wget https://dl.google.com/go/go1.12.linux-amd64.tar.gz

# extract
tar -C /usr/local -xzf go1.11.linux-amd64.tar.gz
tar -C /usr/local -xzf go1.12.linux-amd64.tar.gz

# environment variables
export PATH=$PATH:/usr/local/go/bin
Expand All @@ -60,8 +60,7 @@ Clone source code with the following commands.

```bash
# enter workspace
mkdir -p $GOPATH/src/github.com/nebulasio
cd $GOPATH/src/github.com/nebulasio
cd /path/to/workspace

# download
git clone https://github.com/nebulasio/go-nebulas.git
Expand All @@ -73,88 +72,18 @@ cd go-nebulas
git checkout master
```

### Build NBRE

NBRE is short for Nebulas Blockchain Runtime Environment, which is the platform that runs the core protocols and algorithms.

To build NBRE:

```bash
cd $GOPATH/src/github.com/nebulasio/go-nebulas/nbre

# build dependencies
# switch your shell to bash before running the script
./prepare.sh

# set up environment variables
source env.set.sh

# build NBRE
mkdir build
cd build & cmake -DRelease=1 ..
make
```

The preparation steps listed above may take some time to complete.


### Install Go Dependencies

Go dependencies in Go-Nebulas are managed by [Dep](https://github.com/golang/dep).

| Components | Version | Description |
| --- | --- | --- |


[Dep](https://github.com/golang/dep) \| >= 0.3.1 \| Dep is a dependency management tool for Go. \|

#### Install Dep

* **Mac OSX**
* Install Dep via [Homebrew](https://brew.sh/)

```bash
brew install dep
brew upgrade dep
```

* **Linux**
* Install dep

```bash
cd /usr/local/bin/
wget https://github.com/golang/dep/releases/download/v0.3.2/dep-linux-amd64
ln -s dep-linux-amd64 dep
```

#### Download Dependencies

Switch to the root directory of the project to download dependencies for Go-Nebulas:

```bash
cd $GOPATH/src/github.com/nebulasio/go-nebulas
make dep
```

> `make dep` downloads lots of dependencies. It might take a long time to download for the first time. Some dependencies may fail to download. If you can not download, you can directly download the zipped dependency files generated by dep [vendor.tar.gz](http://develop-center.oss-cn-zhangjiakou.aliyuncs.com/setup/vendor/vendor.tar.gz) and extract it to the nebulas root directory.
>
> ```bash
> vendor.tar.gz
> MD5: fd9bba20b5b8d8e347329bc32feb9d34
> ```
### Build NEB

- Set up runtime environment
```bash
cd $GOPATH/src/github.com/nebulasio/go-nebulas
source install-native-libs.sh
cd /path/to/workspace/go-nebulas
source setup.sh
```
- Build NEB
You can now build the executable for Nebulas:

```bash
cd $GOPATH/src/github.com/nebulasio/go-nebulas
cd /path/to/workspace/go-nebulas
make build
```

Expand Down

0 comments on commit bf81590

Please sign in to comment.