Skip to content

Commit

Permalink
Merge pull request #110 from knull-cn/develop
Browse files Browse the repository at this point in the history
quick start
  • Loading branch information
needkane authored Apr 23, 2020
2 parents 5cd8aeb + 7bda9ee commit 8dedb5a
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 31 deletions.
13 changes: 13 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# compile environment;
FROM annchain/builder:go1.12 as builder
#copy files;
ADD . /AnnChain
WORKDIR /AnnChain
RUN GO111MODULE="on" GOPROXY="https://goproxy.cn" make genesis

# package environment;
FROM annchain/runner:alpine3.11
WORKDIR /genesis
COPY --from=builder /AnnChain/build/genesis /bin/
ENTRYPOINT ["genesis"]

13 changes: 13 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,23 @@ test-gemmill:
go test -v ./gemmill/modules/go-common
go test -v ./gemmill/modules/go-db
go test -v ./gemmill/modules/go-events
# 'go test flowrate' failed maybe your machine upgrade required.
go test -v ./gemmill/modules/go-flowrate/flowrate
go test -v ./gemmill/modules/go-log
go test -v ./gemmill/modules/go-merkle
go test -v ./gemmill/p2p
go test -v ./gemmill/refuse_list
go test -v ./gemmill/types
go test -v ./gemmill/utils

image:
docker build -t genesis:latest -f Dockerfile .
docker tag genesis:latest annchain/genesis:latest

# docker build and run
fastrun:image
docker-compose -f docker-compose.yaml up

clean_fastrun:
docker-compose -f docker-compose.yaml stop
docker-compose -f docker-compose.yaml rm
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ consensus = "raft"
#### Single node

``` shell
./build.sh genesis

./build/genesis init

./build/genesis run
Expand All @@ -130,11 +132,11 @@ consensus = "raft"
#### Local cluster using docker-compose

``` shell
## start cluster
➜ docker-compose up
# docker build image and docker-compose run
make fastrun

## remove cluster
➜ docker-compose down
# remove cluster
make clean_fastrun
```

## Usage
Expand Down
10 changes: 6 additions & 4 deletions README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ consensus = "raft"
#### 单节点

``` shell
./build.sh genesis

./build/genesis init

./build/genesis run
Expand All @@ -129,11 +131,11 @@ consensus = "raft"
#### 使用docker-compose的本地集群

``` shell
## start cluster
➜ docker-compose up
# docker build image and docker-compose run
make fastrun

## remove cluster
➜ docker-compose down
# remove cluster
make clean_fastrun
```

## 用法
Expand Down
9 changes: 0 additions & 9 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
version: '3'
services:
mgo:
image: mongo:3.2
ports:
- '27017:27017'
command: mongod
restart: always
networks:
app_net:
ipv4_address: 192.168.10.7
validator-0:
hostname: validator-0
image: annchain/genesis:latest
Expand Down
14 changes: 0 additions & 14 deletions docker/build_rendez.sh

This file was deleted.

0 comments on commit 8dedb5a

Please sign in to comment.