Skip to content

Commit

Permalink
readme.md. update installation.
Browse files Browse the repository at this point in the history
  • Loading branch information
royshang committed Apr 21, 2018
1 parent 73e1b2b commit 2bc361b
Show file tree
Hide file tree
Showing 5 changed files with 86 additions and 94 deletions.
97 changes: 61 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,48 +48,45 @@ Or use the stable testnet release in __testnet__.
git checkout testnet
```

2. Install rocksdb && dependencies.
2. Install rocksdb.

* **OS X**:
* Install latest C++ compiler that supports C++ 11:
* Update XCode: run `xcode-select --install` (or install it from XCode App's settting).
* Install via [homebrew](http://brew.sh/).
* If you're first time developer in MacOS, you still need to run: `xcode-select --install` in your command line.
* run `brew tap homebrew/versions; brew install gcc48 --use-llvm` to install gcc 4.8 (or higher).
* Install via [homebrew](http://brew.sh/).
* run `brew install rocksdb`

* **Linux - Ubuntu**
* Install rocksdb by source code: (https://github.com/facebook/rocksdb/blob/master/INSTALL.md)
`git clone https://github.com/facebook/rocksdb.git`
`cd rocksdb & make install`
* Upgrade your gcc to version at least 4.8 to get C++11 support.
* Install gflags. First, try: `sudo apt-get install libgflags-dev`
If this doesn't work and you're using Ubuntu, here's a nice tutorial:
(http://askubuntu.com/questions/312173/installing-gflags-12-04)
* Install snappy. This is usually as easy as:
`sudo apt-get install libsnappy-dev`.
* Install zlib. Try: `sudo apt-get install zlib1g-dev`.
* Install bzip2: `sudo apt-get install libbz2-dev`.
* Install lz4: `sudo apt-get install liblz4-dev`.
* Install zstandard: `sudo apt-get install libzstd-dev`.
* Install Dependencies
```bash
apt-get update
apt-get -y build-essential libgflags-dev libsnappy-dev zlib1g-dev libbz2-dev liblz4-dev libzstd-dev
```
* Install rocksdb by source code:
```bash
git clone https://github.com/facebook/rocksdb.git
cd rocksdb & make shared_lib && make install-shared
```
* **Linux - Centos**
* Install Dependencies
```bash
yum -y install epel-release && yum -y update
yum -y install gflags-devel snappy-devel zlib-devel bzip2-devel gcc-c++ libstdc++-devel
```
* Install rocksdb by source code:
```bash
git clone https://github.com/facebook/rocksdb.git
cd rocksdb & make shared_lib && make install-shared
```

3. Install dependencies packages.
* all golang dependencies will be stored in ./vendor.
* run `make dep` to install dependencies.
* If you failed to run this, please download our [vendor.tar.gz](http://ory7cn4fx.bkt.clouddn.com/vendor.tar.gz) directly.

```bash
make dep
```

4. Install dependent libraries.

```bash
make deploy-v8
```
4. Install v8 libraries.
* run `make deploy-v8`

5. Build the neb binary.

```bash
make build
```
* run `make build`

## Run

Expand Down Expand Up @@ -142,12 +139,40 @@ From the log, we can see the binary execution starts neblet, starts network serv
## Docker
### Build

`docker build -t nebulas .`
* pull from dockerhub directly
```bash
docker pull bkbabydp/go-nebulas
```
* build locally
```bash
docker-compose up
```
### Run

`docker run -it -v $(pwd)/data.db:/nebulas/data.db nebulas`
* edit [your conf path] in docker-compose.yml
```yml
# node:
# image: bkbabydp/go-nebulas
# build:
# context: ./docker
# ports:
# - '8680'
# - '8684'
# - '8685'
# - '8888'
# - '8086'
# volumes:
# - .:/go/src/github.com/nebulasio/go-nebulas
# environment:
# - TZ=Asia/Shanghai
# - NEBULAS_BRANCH=master
# command: bash docker/scripts/neb.bash -c [your conf path]
```
* start the node
```bash
cd /path/to/go-nebulas
docker-compose up node
```

## TestNet

Expand Down
42 changes: 5 additions & 37 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,49 +1,17 @@
version: '3'

services:

seed:
image: bkbabydp/go-nebulas
build:
context: ./docker
ports:
- '8680'
- '8684'
- '8685'
- '8888'
- '8086'
volumes:
- .:/go/src/github.com/nebulasio/go-nebulas
environment:
- TZ=Asia/Shanghai
- NEBULAS_BRANCH=master
command: bash docker/scripts/neb.bash -c conf/default/config.conf

miner:
image: bkbabydp/go-nebulas
build:
context: ./docker
ports:
- '8780'
- '8784'
- '8785'
- '8087:8086'
volumes:
- .:/go/src/github.com/nebulasio/go-nebulas
environment:
- TZ=Asia/Shanghai
- NEBULAS_BRANCH=master
command: bash docker/scripts/neb.bash -c conf/example/miner.conf

# node:
# image: bkbabydp/go-nebulas
# build:
# context: ./docker
# ports:
# - '8780'
# - '8784'
# - '8785'
# - '8087:8086'
# - '8680'
# - '8684'
# - '8685'
# - '8888'
# - '8086'
# volumes:
# - .:/go/src/github.com/nebulasio/go-nebulas
# environment:
Expand Down
16 changes: 6 additions & 10 deletions docker/CHANGLOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,11 @@

### 2018-04-21

* 添加了 docker-compose 可以跑 seed 和 miner
* Added docker-compose.yml to run node directly

* 在 docker-compose 设置环境变量 NEBULAS_BRANCH,可以指定checkout的分支,默认master
* Included go1.9.2 and rocksdb5.13 in Dockerfile

* 把包含go1.9.2 和 rocksdb5.13 整合在 docker image 里

* 添加了一些功能:
如果在当前目录下 存在vendor 文件夹 则不执行vendor更新;
如果直接下载vendor压缩包,只要在当前目录下添加空文件 nodep 即可
```bash
touch ./nodep
```
* New Feature:
If you want to download vender instead of running `make dep`,
you can create `nodep` file with `touch nodep` in root directory
and then run `docker-compose up node`
17 changes: 12 additions & 5 deletions docker/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
### 安装 docker-compose
### 运行 seed
# Install docker-compose

## Pull image
```bash
docker-compose up seed
docker pull bkbabydp/go-nebulas
```
### 运行 miner
## Edit configuration
```bash
docker-compose up miner
edit [your conf path] in /path/to/go-nebulas/docker-compose.yml
```

## Launch node
```bash
docker-compose up node
```

8 changes: 2 additions & 6 deletions docker/scripts/neb.bash
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,9 @@ else
make dep
fi
fi

make deploy-v8
if [[ -x ${NEBULAS_SRC}/neb ]]; then
echo './neb exists.'
else
echo './neb not found. Building ./neb...'
make clean && make build
fi
make clean && make build

echo 'Run ./neb '$@
./neb $@

0 comments on commit 2bc361b

Please sign in to comment.