Skip to content

Commit

Permalink
Merge pull request bcosorg#13 from toxotguo/master
Browse files Browse the repository at this point in the history
更新使用说明文档内容
  • Loading branch information
bcosdev authored Aug 4, 2017
2 parents aedb152 + 6e7b628 commit 1345235
Show file tree
Hide file tree
Showing 25 changed files with 210 additions and 510 deletions.
78 changes: 39 additions & 39 deletions config.json
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
{
"sealEngine": "PBFT",
"systemproxyaddress":"0x0",
"systemproxyaddressDfsFile":"",
"systemproxyaddressDfsServer":"",
"listenip":"127.0.0.1",
"rpcport":"6801",
"p2pport":"30303",
"wallet":"keys.info",
"keystoredir":"keystore/",
"datadir":"",
"vm":"interpreter",
"networkid":"12345",
"logverbosity":"4",
"coverlog":"OFF",
"eventlog":"ON",
"logconf":"log.conf",
"dfsNode":"de0fa385816b505799433e54b88788e21cb42092a6ff5bcaa2285d7ace906e5e6ce8ef2b30134ff276a5834d58721291acc5864e07e6d52469b79b28e699dfde",
"dfsGroup":"group1",
"dfsStorage":"filestorage",
"params": {
"accountStartNonce": "0x0",
"maximumExtraDataSize": "0x0",
"tieBreakingGas": false,
"blockReward": "0x0",
"networkID" : "0x0"
},
"NodeextraInfo":[
{
"Nodeid":"de0fa385816b505799433e54b88788e21cb42092a6ff5bcaa2285d7ace906e5e6ce8ef2b30134ff276a5834d58721291acc5864e07e6d52469b79b28e699dfde",
"Nodedesc": "node1",
"Agencyinfo": "node1",
"Peerip": "127.0.0.1",
"Identitytype": 1,
"Port":30303,
"Idx":0
}
]
}
{
"sealEngine": "PBFT",
"systemproxyaddress":"0x0",
"systemproxyaddressDfsFile":"",
"systemproxyaddressDfsServer":"",
"listenip":"127.0.0.1",
"rpcport":"6801",
"p2pport":"30303",
"wallet":"/mydata/nodedata-1/keys.info",
"keystoredir":"/mydata/nodedata-1/keystore/",
"datadir":"/mydata/nodedata-1/data/",
"vm":"interpreter",
"networkid":"12345",
"logverbosity":"4",
"coverlog":"OFF",
"eventlog":"ON",
"logconf":"/mydata/nodedata-1/log.conf",
"dfsNode":"de0fa385816b505799433e54b88788e21cb42092a6ff5bcaa2285d7ace906e5e6ce8ef2b30134ff276a5834d58721291acc5864e07e6d52469b79b28e699dfde",
"dfsGroup":"group1",
"dfsStorage":"filestorage",
"params": {
"accountStartNonce": "0x0",
"maximumExtraDataSize": "0x0",
"tieBreakingGas": false,
"blockReward": "0x0",
"networkID" : "0x0"
},
"NodeextraInfo":[
{
"Nodeid":"de0fa385816b505799433e54b88788e21cb42092a6ff5bcaa2285d7ace906e5e6ce8ef2b30134ff276a5834d58721291acc5864e07e6d52469b79b28e699dfde",
"Nodedesc": "node1",
"Agencyinfo": "node1",
"Peerip": "127.0.0.1",
"Identitytype": 1,
"Port":30303,
"Idx":0
}
]
}
40 changes: 18 additions & 22 deletions doc/manual/manual.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,15 @@ BCOS区块链开源平台由深圳前海微众银行股份有限公司、万向
① 安装nodejs(安装后版本nodejs版本大于6)、babel-node环境
```bash
sudo yum install -y nodejs
sudo yum install
sudo npm config set registry https://registry.npm.taobao.org
sudo npm install -g cnpm --registry=https://registry.npm.taobao.org
sudo cnpm install -g babel-cli babel-preset-es2017
echo '{ "presets": ["es2017"] }' > ~/.babelrc
```

② 安装智能合约solidity编译器
方式一:直接下载solc二进制执行程序
```bash
wget https://github.com/ethereum/solidity/releases/download/v0.4.11/solc-static-linux
wget https://github.com/ethereum/solidity/releases/download/v0.4.13/solc-static-linux
sudo cp solc-static-linux /usr/bin/solc
sudo chmod +x /usr/bin/solc
```
Expand Down Expand Up @@ -105,7 +104,11 @@ cmake3 -DEVMJIT=OFF -DTESTS=OFF -DMINIUPNPC=OFF .. #注意命令末尾的..
make -j2
```

编译成功,eth/eth 即是区块链可执行程序。
编译成功,eth/bcoseth 即是区块链可执行程序。
执行安装
```
make install
```

# 第二章、启动创世节点

Expand Down Expand Up @@ -182,7 +185,11 @@ make -j2
## 2.4.生成节点身份NodeId
节点身份NodeId是一个公钥,代表节点的唯一身份标识。
```
./build/eth/eth --gennetworkrlp /mydata/nodedata-1/network.rlp
mkdir -p /mydata/nodedata-1/
mkdir -p /mydata/nodedata-1/data/
mkdir -p /mydata/nodedata-1/log/
mkdir -p /mydata/nodedata-1/keystore/
bcoseth --gennetworkrlp /mydata/nodedata-1/network.rlp
```
将在/mydata/nodedata-1/ 目录下生成两个文件 network.rlp 和 network.rlp.pub。
network.rlp是节点身份的私钥二进制文件。
Expand Down Expand Up @@ -296,7 +303,7 @@ node accountManager.js
## 2.7.创世节点启动
命令行:区块链执行程序路径 --genesis 创世块文件 --config 配置文件

``` ./build/eth/eth --genesis ./genesis.json --config ./config.json & ```
``` bcoseth --genesis ./genesis.json --config ./config.json & ```

查看日志是否正常出块

Expand Down Expand Up @@ -485,18 +492,6 @@ JAVA SDK提供的接口功能包括文件上传,文件删除,文件下载,
|**输出参数**|**参数类型**|**参数说明**|
|NA|NA|NA|


- 接口名称:addServer
- 接口功能说明:添加文件服务器节点
- 参数说明

|输入参数|参数类型|参数说明|
|:-----|:-----|:-----|
|server|FileServer|文件服务节点信息|
|ret|int|返回值|
|**输出参数**|**参数类型**|**参数说明**|
|NA|NA|NA|

###### b. 删除文件服务器节点

- 接口名称:deleteServer
Expand Down Expand Up @@ -866,7 +861,7 @@ web3.admin.getPeers(console.log)

本章详细介绍在一个创始节点已正常运行的前提下,如何一步步操作,加入新的区块链节 点, 组成区块链网络的操作流程。

系统合约是 OpenDL 区块链的重要设计思路之一,也是控制网络节点加入和退出的重要方式,
系统合约是 BCOS 区块链的重要设计思路之一,也是控制网络节点加入和退出的重要方式,

因此[部署系统合约](#7.1 部署系统合约)是多节点组网的前提条件。并且仅需执行一次。

Expand All @@ -876,10 +871,11 @@ web3.admin.getPeers(console.log)

执行以下命令:


```shell
cd systemcontractv2
cnpm install
vim config.js #更新内网监听Ip和RPC监听端口,及privKey和account(可复用第四章部署合约 中的或重新生成)
vim config.js #更新内网监听Ip和RPC监听端口,及privKey和account(可复用2.5.生成管理员公私钥对 中的或重新生成)
babel-node deploy.js
```

Expand Down Expand Up @@ -1005,7 +1001,7 @@ vim node2.json
执行以下命令启动区块链节点进程:

```shell
./build/eth/eth --genesis /mydata/nodedata-2/genesis.json --config /mydata/nodedata-2/config.json
bcoseth --genesis /mydata/nodedata-2/genesis.json --config /mydata/nodedata-2/config.json
```

查看块高变化及连接节点信息:
Expand Down Expand Up @@ -1401,7 +1397,7 @@ console.log("配置项:"+key+","+value);
示例如下:

```
./build/eth/eth --genesis ./genesis.json --config ./config.json
bcoseth --genesis ./genesis.json --config ./config.json
--export-genesis ./genesis.file
```

Expand Down
46 changes: 23 additions & 23 deletions eth/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,39 +5,39 @@ file(GLOB HEADERS "*.h")

include(EthDependencies)

add_executable(eth ${SRC_LIST} ${HEADERS})
add_executable(bcoseth ${SRC_LIST} ${HEADERS})

find_package(Eth)
find_package(Web3)

target_include_directories(eth PRIVATE ..)
target_include_directories(bcoseth PRIVATE ..)

include_directories(../libodbc/include
../libodbc/include/db2_linux
../libodbc/include/ibase
../libodbc/include/infomix
../libodbc/include/mysql
../libodbc/include/odbc_linux
../libodbc/include/pgsql
../libodbc/include/sqlbase
../libodbc/include/sqllite
../libodbc/include/ss_linux
../libodbc/include/sybase)
target_link_libraries(eth ${Eth_EVM_LIBRARIES})
target_link_libraries(eth ${Web3_WEB3JSONRPC_LIBRARIES})
target_link_libraries(eth ${Web3_WEBTHREE_LIBRARIES})
target_link_libraries(eth contract)
target_link_libraries(eth JsonRpcCpp::Client)
../libodbc/include/db2_linux
../libodbc/include/ibase
../libodbc/include/infomix
../libodbc/include/mysql
../libodbc/include/odbc_linux
../libodbc/include/pgsql
../libodbc/include/sqlbase
../libodbc/include/sqllite
../libodbc/include/ss_linux
../libodbc/include/sybase)

target_link_libraries(bcoseth ${Eth_EVM_LIBRARIES})
target_link_libraries(bcoseth ${Web3_WEB3JSONRPC_LIBRARIES})
target_link_libraries(bcoseth ${Web3_WEBTHREE_LIBRARIES})
target_link_libraries(bcoseth contract)
target_link_libraries(bcoseth JsonRpcCpp::Client)

if (EVMJIT)
# Do we need include paths here?
target_link_libraries(eth ${Eth_EVMJIT_LIBRARIES})
eth_copy_dlls(eth EVMJIT_DLLS)
# Do we need include paths here?
target_link_libraries(bcoseth ${Eth_EVMJIT_LIBRARIES})
eth_copy_dlls(eth EVMJIT_DLLS)
endif()

if (UNIX AND NOT APPLE)
target_link_libraries(eth pthread)
target_link_libraries(bcoseth pthread)
endif()

install(TARGETS eth DESTINATION bin)
install(TARGETS bcoseth DESTINATION bin)
24 changes: 12 additions & 12 deletions genesis.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"nonce": "0x0",
"difficulty": "0x0",
"mixhash": "0x0",
"coinbase": "0x0",
"timestamp": "0x0",
"parentHash": "0x0",
"extraData": "0x0",
"gasLimit": "0x13880000000000",
"god":"0x4d23de3297034cdd4a58db35f659a9b61fc7577b",
"alloc": {},
"initMinerNodes":["de0fa385816b505799433e54b88788e21cb42092a6ff5bcaa2285d7ace906e5e6ce8ef2b30134ff276a5834d58721291acc5864e07e6d52469b79b28e699dfde"]
{
"nonce": "0x0",
"difficulty": "0x0",
"mixhash": "0x0",
"coinbase": "0x0",
"timestamp": "0x0",
"parentHash": "0x0",
"extraData": "0x0",
"gasLimit": "0x13880000000000",
"god":"0x4d23de3297034cdd4a58db35f659a9b61fc7577b",
"alloc": {},
"initMinerNodes":["de0fa385816b505799433e54b88788e21cb42092a6ff5bcaa2285d7ace906e5e6ce8ef2b30134ff276a5834d58721291acc5864e07e6d52469b79b28e699dfde"]
}
2 changes: 1 addition & 1 deletion libdevcore/Common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace dev
{

char const* Version = ETH_PROJECT_VERSION;
char const* Copyright="By OpenDl (c) 2017.";
char const* Copyright="By BCOS (c) 2017.";

const u256 Invalid256 = ~(u256)0;

Expand Down
58 changes: 29 additions & 29 deletions log.conf
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
* GLOBAL:
ENABLED = true
TO_FILE = true
TO_STANDARD_OUTPUT = false
FORMAT = "%level|%datetime{%Y-%M-%d %H:%m:%s}|%msg"
FILENAME = "log/log_%datetime{%Y%M%d%H}.log"
MILLISECONDS_WIDTH = 3
PERFORMANCE_TRACKING = false
MAX_LOG_FILE_SIZE = 209715200 ## 200MB - Comment starts with two hashes (##)
LOG_FLUSH_THRESHOLD = 100 ## Flush after every 100 logs
* TRACE:
FILENAME = "log/trace_log_%datetime{%Y%M%d%H}.log"
* DEBUG:
FILENAME = "log/debug_log_%datetime{%Y%M%d%H}.log"
* FATAL:
ENABLED = false
* ERROR:
FILENAME = "log/error_log_%datetime{%Y%M%d%H}.log"
* WARNING:
ENABLED = false
* INFO:
ENABLED = false
* VERBOSE:
ENABLED = false
* GLOBAL:
ENABLED = true
TO_FILE = true
TO_STANDARD_OUTPUT = false
FORMAT = "%level|%datetime{%Y-%M-%d %H:%m:%s}|%msg"
FILENAME = "/mydata/nodedata-1/log/log_%datetime{%Y%M%d%H}.log"
MILLISECONDS_WIDTH = 3
PERFORMANCE_TRACKING = false
MAX_LOG_FILE_SIZE = 209715200 ## 200MB - Comment starts with two hashes (##)
LOG_FLUSH_THRESHOLD = 100 ## Flush after every 100 logs

* TRACE:
FILENAME = "/mydata/nodedata-1/log/trace_log_%datetime{%Y%M%d%H}.log"
* DEBUG:
FILENAME = "/mydata/nodedata-1/log/debug_log_%datetime{%Y%M%d%H}.log"
* FATAL:
FILENAME = "/mydata/nodedata-1/log/fatal_log_%datetime{%Y%M%d%H}.log"

* ERROR:
FILENAME = "/mydata/nodedata-1/log/error_log_%datetime{%Y%M%d%H}.log"

* WARNING:
FILENAME = "/mydata/nodedata-1/log/warn_log_%datetime{%Y%M%d%H}.log"

* INFO:
FILENAME = "/mydata/nodedata-1/log/info_log_%datetime{%Y%M%d%H}.log"

* VERBOSE:
ENABLED = false
34 changes: 34 additions & 0 deletions sample-node/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"sealEngine": "PBFT",
"systemproxyaddress":"0x0",
"listenip":"127.0.0.1",
"rpcport": "8545",
"p2pport": "30303",
"wallet":"./keys.info",
"keystoredir":"./keystore/",
"datadir":"./data/",
"vm":"interpreter",
"networkid":"12345",
"logverbosity":"4",
"coverlog":"ON",
"eventlog":"ON",
"logconf":"./log.conf",
"params": {
"accountStartNonce": "0x0",
"maximumExtraDataSize": "0x0",
"tieBreakingGas": false,
"blockReward": "0x0",
"networkID" : "0x0"
},
"NodeextraInfo":[
{
"Nodeid":"2a0cb7425bd63835d346ae20ec6107d28f64009a9dcca7d485713f1dfe7c4edf6e79b7e08a70cb8220beb133327361313e6bc793433311ba997a81e14800a85f",
"Nodedesc": "node1",
"Agencyinfo": "node1",
"Peerip": "127.0.0.1",
"Identitytype": 1,
"Port":30303,
"Idx":0
}
]
}
1 change: 1 addition & 0 deletions sample-node/data/keys.info
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
��ߒ�:OE�~υ5-�1�,"������5Ȯ�9�O��
1 change: 1 addition & 0 deletions sample-node/data/keys.info.salt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
\��aGݘa�� w,��֯`L"��ɗ��G8
Loading

0 comments on commit 1345235

Please sign in to comment.