Skip to content

Commit

Permalink
Merge pull request #139 from BoostryJP/dev-2.1
Browse files Browse the repository at this point in the history
Release v2.1.0
  • Loading branch information
YoshihitoAso authored Apr 6, 2023
2 parents 8adedaa + 4876bea commit 8248008
Show file tree
Hide file tree
Showing 41 changed files with 307 additions and 83 deletions.
20 changes: 17 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
.idea/
!.gitkeep

docker-compose-*.yml
.python-version

tests/contracts/*.json
tests/__pycache__/
tests/__pycache__/

# VSCode
.vscode

# Intellij
.idea/
/*.iml

# PyEnv
.python-version

# Mac
.DS_Store
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# ibet-Network

<p>
<img alt="Version" src="https://img.shields.io/badge/version-2.0-blue.svg?cacheSeconds=2592000" />
<img alt="Version" src="https://img.shields.io/badge/version-2.1-blue.svg?cacheSeconds=2592000" />
</p>

English | [日本語](./README_JA.md)

<img width="33%" align="right" src="https://user-images.githubusercontent.com/963333/130191619-f1f0c342-ab8f-499d-b8f8-52309c13d2cb.png"/>

## Features
Expand Down Expand Up @@ -56,15 +58,19 @@ The repository of ibet-Network will be version controlled by the following polic

## Quorum Version

Currently, ibet is using [v22.4.4](https://github.com/ConsenSys/quorum/releases/tag/v22.4.4) of Quorum.
Currently, the ibet Network is built using a node client based on [v22.7.6](https://github.com/ConsenSys/quorum/releases/tag/v22.7.6) of Quorum.
The node application has been optimized for ibet Network and partially differs from that of Quorum itself.
For more information, please refer to the following project.

[BoostryJP/quorum](https://github.com/BoostryJP/quorum)

## Consensus Protocol

In our ibet network we use [QBFT](https://arxiv.org/abs/2002.03613) as a consensus protocol.

## EVM Version

Our ibet network EVM version is byzantium. Therefore, smart contracts need to be compiled for this EVM version.
Our ibet network EVM version is `berlin`. Therefore, smart contracts need to be compiled for this EVM version.

## How to Join the ibet Network

Expand Down
84 changes: 84 additions & 0 deletions README_JA.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# ibet-Network

<p>
<img alt="Version" src="https://img.shields.io/badge/version-2.1-blue.svg?cacheSeconds=2592000" />
</p>

[English](./README.md) | 日本語

<img width="33%" align="right" src="https://user-images.githubusercontent.com/963333/130191619-f1f0c342-ab8f-499d-b8f8-52309c13d2cb.png"/>

## 特徴

[ibet](https://ibet.jp/)[株式会社BOOSTRY](https://boostry.co.jp/) が開発・運用を主導するコンソーシアムブロックチェーンです。

### 1. コンソーシアムブロックチェーン

ibet はコンソーシアム型のブロックチェーンです。
エンタープライズ向けOSSブロックチェーンプロダクトである [Quorum](https://consensys.net/quorum/) を利用して構築されています。
現在のところ、日本市場に限定して開発が行われています。

ibet は「企業」によって構成されるコンソーシアムブロックチェーンです。
コンソーシアム参加企業は自身のノード(非Validatorノード)を構築し、ネットワークに接続します。

### 2. 2つのブロックチェーン

日本法令に準拠する2つのネットワーク、"**ibet**" と "**ibet for Fin**" が存在します。
それぞれのネットワークは別々のネットワークとして構成されています。

各コンソーシアムには独立したガバナンスがあり、独自の規約とガイドラインに従って運営されています。

- **ibet** : どのような企業でも参加できるネットワークです。主に非金融商品の権利(ユーティリティトークン)が流通します。
- **ibet for Fin** : 主に金融機関のみが参加できるネットワークです。流通市場においては、認可を受けた金融機関の仲介が必要な商品が流通します。


## このリポジトリについて

このリポジトリでは、ibet コンソーシアムで定義されるネットワーク定義、
Quorumノードコンテナ(Validator、General)の管理を行います。

### リポジトリの構造

各ネットワークのネットワーク定義、ノード定義が以下のディレクトリに格納されています。

- `ibet-network` : ibet メインネットワーク
- `ibet-for-fin-network` : ibet for Fin メインネットワーク
- `test-network` : ibet テストネットワーク
- `local-network` : ローカルネットワーク

### バージョン管理方針

ibet-Networkのリポジトリは、以下の方針でバージョン管理されます。

- リポジトリ全体のバージョンアップは6ヶ月に1回行います。
- Quorumノードのバージョンアップは6ヶ月に1回行います。次回の更新で採用するバージョンは、コンソーシアムの合意により決定します。
- ハードフォークを行わず マイナーバージョンアップ(例:1.0 -> 1.1)
- ハードフォークあり メジャーバージョンアップ(例:1.0 -> 2.0)
- その他、緊急性の高い修正については、リビジョンアップを緊急にリリースします(例:1.1.0 -> 1.1.1)。


## Quorum バージョン

現在、ibet Network は Quorum の v22.7.6 をベースにしたノードクライアントを利用して構築されています。
ノードアプリケーションは ibet Network 向けに最適化されて、Quorum 本体のものとは部分的に異なります。
詳細は以下のプロジェクトをご参照ください。

[BoostryJP/quorum](https://github.com/BoostryJP/quorum)

## コンセンサスプロトコル

ibet ネットワークではコンセンサスプロトコルとして [QBFT](https://arxiv.org/abs/2002.03613) を利用しています。

## EVM バージョン

ibet ネットワークでは `berlin` を採用しています。
そのため、スマートコントラクトはこのバージョンでコンパイルをする必要があります。

## ibet ネットワークへの参加方法

ネットワークへの参加方法に関する詳細な情報は、[ibet 公式](https://ibet.jp/) をご確認ください。

## ライセンス

- go-ethereum 関連のライブラリは [GNU Lesser General Public License v3.0](https://www.gnu.org/licenses/lgpl-3.0.en.html) でライセンスされています。`COPYING.LESSER` のファイルを参照ください。
- go-ethereum 関連のバイナリは [GNU General Public License v3.0](https://www.gnu.org/licenses/gpl-3.0.en.html) でライセンスされています。`COPYING` のファイルを参照ください。
6 changes: 3 additions & 3 deletions ibet-for-fin-network/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@ Move `genesis.json` and `static-nodes.json` for the validator network as follows

Initialize the node. You need to run only the first time.
```
$ docker run --name validatorInit -e PRIVATE_CONFIG=ignore -v {mount_directory}:/eth \
$ docker run --rm --name validatorInit -e PRIVATE_CONFIG=ignore -v {mount_directory}:/eth \
ghcr.io/boostryjp/ibet-fin-network/validator:{version} \
geth --datadir /eth --nousb init /eth/genesis.json
```

Finally, start the node as follows.
```
$ docker run -d --name validator -e PRIVATE_CONFIG=ignore -v {mount_directory}:/eth \
$ docker run -d --name validator -e PRIVATE_CONFIG=ignore -e nodekeyhex={nodekey} -v {mount_directory}:/eth \
ghcr.io/boostryjp/ibet-fin-network/validator:{version} run.sh
```

Expand Down Expand Up @@ -97,7 +97,7 @@ if a General node, the Bridge node must be set as the connection node.

Initialize the node. You need to run only the first time.
```
$ docker run --name generalInit -e PRIVATE_CONFIG=ignore -v {mount_directory}:/eth \
$ docker run --rm --name generalInit -e PRIVATE_CONFIG=ignore -v {mount_directory}:/eth \
ghcr.io/boostryjp/ibet-fin-network/general:{version} \
geth --datadir /eth --nousb init /eth/genesis.json
```
Expand Down
8 changes: 4 additions & 4 deletions ibet-for-fin-network/general/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
# Build Geth in a stock Go builder container
FROM golang:1.16-alpine as builder
FROM golang:1.19-alpine as builder

WORKDIR /work

RUN apk add --no-cache make gcc musl-dev linux-headers git

RUN git clone https://github.com/ConsenSys/quorum.git && \
RUN git clone https://github.com/BoostryJP/quorum.git && \
cd quorum/ && \
git checkout v22.4.4
git checkout v2.1.0
RUN cd quorum/ && \
make geth bootnode && \
mv build/bin/geth /usr/local/bin && \
mv build/bin/bootnode /usr/local/bin

# Pull Geth into a second stage deploy alpine container
FROM python:3.9-alpine3.14
FROM python:3.9-alpine3.17

RUN apk add --no-cache --virtual .build-deps gcc g++
RUN apk add --no-cache ca-certificates
Expand Down
6 changes: 5 additions & 1 deletion ibet-for-fin-network/general/genesis.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,14 @@
"eip155Block": 3,
"eip158Block": 3,
"byzantiumBlock": 3,
"constantinopleBlock": 999999999,
"petersburgBlock": 999999999,
"istanbulBlock": 999999999,
"berlinBlock": 999999999,
"istanbul": {
"epoch": 30000,
"policy": 0,
"testQBFTBlock": 100000000
"testQBFTBlock": 77792450
},
"isQuorum": true
},
Expand Down
8 changes: 5 additions & 3 deletions ibet-for-fin-network/general/healthcheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ if [ $? -ne 0 ]; then
exit 1
fi

ps -ef | grep -v grep | grep "monitor_block_sync.py" > /dev/null 2>&1
if [ $? -ne 0 ]; then
exit 1
if [ -z "${BLOCK_SYNC_MONITORING_DISABLED}" ] || [ "${BLOCK_SYNC_MONITORING_DISABLED}" -ne 1 ]; then
ps -ef | grep -v grep | grep "monitor_block_sync.py" > /dev/null 2>&1
if [ $? -ne 0 ]; then
exit 1
fi
fi
6 changes: 5 additions & 1 deletion ibet-for-fin-network/general/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ test ! -z "${rpccorsdomain}" && CORS_OPT="--http.corsdomain ${rpccorsdomain}"
test ! -z "${rpcvhosts}" && VHOST_OPT="--http.vhosts ${rpcvhosts}"
test ! -z "${maxpeers}" && PEERS_OPT="--maxpeers ${maxpeers}"
test ! -z "${syncmode}" && SYNCMODE_OPT="--syncmode ${syncmode}"
test ! -z "${identity}" && IDENTITY_OPT="--identity ${identity}"

GETH_CMD="geth \
--http \
--http.addr 0.0.0.0 \
--http.port 8545 \
${CORS_OPT} \
${IDENTITY_OPT} \
--datadir /eth \
--port 30303 \
--http.api admin,debug,miner,txpool,eth,net,web3,istanbul,personal \
Expand All @@ -26,7 +28,9 @@ ${PEERS_OPT} \
${SYNCMODE_OPT} \
--nousb"

ash -c "nohup python monitoring/monitor_block_sync.py > /dev/stdout 2>&1 &"
if [ -z "${BLOCK_SYNC_MONITORING_DISABLED}" ] || [ "${BLOCK_SYNC_MONITORING_DISABLED}" -ne 1 ]; then
ash -c "nohup python monitoring/monitor_block_sync.py > /dev/stdout 2>&1 &"
fi
ash -c "nohup ${GETH_CMD//\*/\\\*} > /dev/stdout 2>&1 &"

for i in $(seq 1 300); do
Expand Down
4 changes: 2 additions & 2 deletions ibet-for-fin-network/general/static-nodes-general.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[
"enode://cfb88a3a4b3ad0f80cc785354947e1ac04753021c1309955c67dfa74f69b347dcdd231c19cd8d63145a53533618eb77c296eb2cf428e438fab8e08811b48d485@13.208.188.235:30303",
"enode://f310662c61c74be2221dd28f704b1073c9e62c8e922b951191265400e4f87c7a1c28d14fac289a3bb8d036688be8d32bff886d9d68771ca43a5fd656d045d48d@13.208.201.170:30303",
"enode://cfb88a3a4b3ad0f80cc785354947e1ac04753021c1309955c67dfa74f69b347dcdd231c19cd8d63145a53533618eb77c296eb2cf428e438fab8e08811b48d485@15.168.52.199:30303",
"enode://f310662c61c74be2221dd28f704b1073c9e62c8e922b951191265400e4f87c7a1c28d14fac289a3bb8d036688be8d32bff886d9d68771ca43a5fd656d045d48d@15.152.124.55:30303",
"enode://a491656cd482b4f03cdebdddb6008209e2fc982427d60c697abd52f853bfb8a23429ce74cb3661ca54523eeb465e2f911d75406a0efbe2c8b8ebb126820b6d70@54.65.22.133:30303",
"enode://e1b82644bad6092d222da8b4c50cd09c0ffd79a99b801844f10e010377029749728f9175c1716a6acee75979381e33d0fa545bb01773d0b66b5a3883683f937c@54.238.32.26:30303"
]
8 changes: 4 additions & 4 deletions ibet-for-fin-network/validator/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
# Build Geth in a stock Go builder container
FROM golang:1.16-alpine as builder
FROM golang:1.19-alpine as builder

WORKDIR /work

RUN apk add --no-cache make gcc musl-dev linux-headers git

RUN git clone https://github.com/ConsenSys/quorum.git && \
RUN git clone https://github.com/BoostryJP/quorum.git && \
cd quorum/ && \
git checkout v22.4.4
git checkout v2.1.0
RUN cd quorum/ && \
make geth bootnode && \
mv build/bin/geth /usr/local/bin && \
mv build/bin/bootnode /usr/local/bin

# Pull Geth into a second stage deploy alpine container
FROM alpine:3.14
FROM alpine:3.17

RUN apk add --no-cache ca-certificates
COPY --from=builder /usr/local/bin/geth /usr/local/bin/
Expand Down
6 changes: 5 additions & 1 deletion ibet-for-fin-network/validator/genesis.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,14 @@
"eip155Block": 3,
"eip158Block": 3,
"byzantiumBlock": 3,
"constantinopleBlock": 999999999,
"petersburgBlock": 999999999,
"istanbulBlock": 999999999,
"berlinBlock": 999999999,
"istanbul": {
"epoch": 30000,
"policy": 0,
"testQBFTBlock": 100000000
"testQBFTBlock": 77792450
},
"isQuorum": true
},
Expand Down
2 changes: 2 additions & 0 deletions ibet-for-fin-network/validator/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ mkdir -p /eth/geth
test ! -z "${rpccorsdomain}" && CORS_OPT="--http.corsdomain ${rpccorsdomain}"
test ! -z "${rpcvhosts}" && VHOST_OPT="--http.vhosts ${rpcvhosts}"
test ! -z "${maxpeers}" && PEERS_OPT="--maxpeers ${maxpeers}"
test ! -z "${identity}" && IDENTITY_OPT="--identity ${identity}"

GETH_CMD="geth \
--http \
--http.addr 0.0.0.0 \
--http.port 8545 \
${CORS_OPT} \
${IDENTITY_OPT} \
--datadir /eth \
--port 30303 \
--http.api admin,debug,miner,txpool,eth,net,web3,istanbul,personal \
Expand Down
6 changes: 3 additions & 3 deletions ibet-network/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,14 @@ Move `genesis.json` and `static-nodes.json` for the validator network as follows

Initialize the node. You need to run only the first time.
```
$ docker run --name validatorInit -e PRIVATE_CONFIG=ignore -v {mount_directory}:/eth \
$ docker run --rm --name validatorInit -e PRIVATE_CONFIG=ignore -v {mount_directory}:/eth \
ghcr.io/boostryjp/ibet-network/validator:{version} \
geth --datadir /eth --nousb init /eth/genesis.json_init
```

Finally, start the node as follows.
```
$ docker run -d --name validator -e PRIVATE_CONFIG=ignore -v ./:/eth \
$ docker run -d --name validator -e PRIVATE_CONFIG=ignore -e nodekeyhex={nodekey} -v ./:/eth \
ghcr.io/boostryjp/ibet-network/validator:{version} run.sh
```

Expand Down Expand Up @@ -100,7 +100,7 @@ if a General node, the Bridge node must be set as the connection node.

Initialize the node. You need to run only the first time.
```
$ docker run --name generalInit -e PRIVATE_CONFIG=ignore -v {mount_directory}:/eth \
$ docker run --rm --name generalInit -e PRIVATE_CONFIG=ignore -v {mount_directory}:/eth \
ghcr.io/boostryjp/ibet-network/general:{version} \
geth --datadir /eth --nousb init /eth/genesis.json_init
```
Expand Down
8 changes: 4 additions & 4 deletions ibet-network/general/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
# Build Geth in a stock Go builder container
FROM golang:1.16-alpine as builder
FROM golang:1.19-alpine as builder

WORKDIR /work

RUN apk add --no-cache make gcc musl-dev linux-headers git

RUN git clone https://github.com/ConsenSys/quorum.git && \
RUN git clone https://github.com/BoostryJP/quorum.git && \
cd quorum/ && \
git checkout v22.4.4
git checkout v2.1.0
RUN cd quorum/ && \
make geth bootnode && \
mv build/bin/geth /usr/local/bin && \
mv build/bin/bootnode /usr/local/bin

# Pull Geth into a second stage deploy alpine container
FROM python:3.9-alpine3.14
FROM python:3.9-alpine3.17

RUN apk add --no-cache --virtual .build-deps gcc g++
RUN apk add --no-cache ca-certificates
Expand Down
4 changes: 4 additions & 0 deletions ibet-network/general/genesis.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
"eip155Block": 3,
"eip158Block": 3,
"byzantiumBlock": 3,
"constantinopleBlock": 999999999,
"petersburgBlock": 999999999,
"istanbulBlock": 999999999,
"berlinBlock": 999999999,
"istanbul": {
"epoch": 30000,
"policy": 0,
Expand Down
7 changes: 6 additions & 1 deletion ibet-network/general/genesis.json_init
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,14 @@
"eip155Block": 3,
"eip158Block": 3,
"byzantiumBlock": 3,
"constantinopleBlock": 999999999,
"petersburgBlock": 999999999,
"istanbulBlock": 999999999,
"berlinBlock": 999999999,
"istanbul": {
"epoch": 30000,
"policy": 0
"policy": 0,
"testQBFTBlock": 100000000
},
"isQuorum": true
},
Expand Down
Loading

0 comments on commit 8248008

Please sign in to comment.