Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
YottaChain
YTBP
提交
498b0002
Y
YTBP
项目概览
YottaChain
/
YTBP
通知
0
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Y
YTBP
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
498b0002
编写于
6月 04, 2018
作者:
P
Paul Calabrese
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Clean up p2p tests
上级
bb7b08a8
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
80 addition
and
65 deletion
+80
-65
libraries/chain/include/eosio/chain/config.hpp
libraries/chain/include/eosio/chain/config.hpp
+0
-2
programs/eosio-launcher/main.cpp
programs/eosio-launcher/main.cpp
+0
-1
tests/CMakeLists.txt
tests/CMakeLists.txt
+1
-3
tests/p2p_tests/dawn_515/test.sh
tests/p2p_tests/dawn_515/test.sh
+79
-59
未找到文件。
libraries/chain/include/eosio/chain/config.hpp
浏览文件 @
498b0002
...
...
@@ -45,8 +45,6 @@ const static uint64_t block_timestamp_epoch = 946684800000ll; // epoch is year 2
const
static
int
percent_100
=
10000
;
const
static
int
percent_1
=
100
;
const
static
uint32_t
required_producer_participation
=
33
*
config
::
percent_1
;
static
const
uint32_t
account_cpu_usage_average_window_ms
=
24
*
60
*
60
*
1000l
;
static
const
uint32_t
account_net_usage_average_window_ms
=
24
*
60
*
60
*
1000l
;
static
const
uint32_t
block_cpu_usage_average_window_ms
=
60
*
1000l
;
...
...
programs/eosio-launcher/main.cpp
浏览文件 @
498b0002
...
...
@@ -1029,7 +1029,6 @@ launcher_def::write_config_file (tn_node_def &node) {
}
}
if
(
instance
.
has_db
||
node
.
producers
.
size
())
{
cfg
<<
"required-participation = 33
\n
"
;
for
(
const
auto
&
kp
:
node
.
keys
)
{
cfg
<<
"private-key = [
\"
"
<<
string
(
kp
.
get_public_key
())
<<
"
\"
,
\"
"
<<
string
(
kp
)
<<
"
\"
]
\n
"
;
...
...
tests/CMakeLists.txt
浏览文件 @
498b0002
...
...
@@ -25,7 +25,6 @@ add_dependencies(plugin_test asserter test_api test_api_mem test_api_db test_api
configure_file
(
${
CMAKE_CURRENT_SOURCE_DIR
}
/core_symbol.py.in
${
CMAKE_CURRENT_BINARY_DIR
}
/core_symbol.py
)
configure_file
(
${
CMAKE_CURRENT_SOURCE_DIR
}
/p2p_tests/dawn_515/test.sh
${
CMAKE_CURRENT_BINARY_DIR
}
/p2p_tests/dawn_515/test.sh COPYONLY
)
configure_file
(
${
CMAKE_CURRENT_SOURCE_DIR
}
/trans_sync_across_mixed_cluster_test.sh
${
CMAKE_CURRENT_BINARY_DIR
}
/trans_sync_across_mixed_cluster_test.sh COPYONLY
)
configure_file
(
${
CMAKE_CURRENT_SOURCE_DIR
}
/distributed-transactions-test.py
${
CMAKE_CURRENT_BINARY_DIR
}
/distributed-transactions-test.py COPYONLY
)
configure_file
(
${
CMAKE_CURRENT_SOURCE_DIR
}
/distributed-transactions-remote-test.py
${
CMAKE_CURRENT_BINARY_DIR
}
/distributed-transactions-remote-test.py COPYONLY
)
configure_file
(
${
CMAKE_CURRENT_SOURCE_DIR
}
/sample-cluster-map.json
${
CMAKE_CURRENT_BINARY_DIR
}
/sample-cluster-map.json COPYONLY
)
...
...
@@ -42,13 +41,12 @@ add_test(NAME plugin_test COMMAND plugin_test --report_level=detailed --color_ou
add_test
(
NAME nodeos_run_test COMMAND tests/nodeos_run_test.py -v --dump-error-detail WORKING_DIRECTORY
${
CMAKE_BINARY_DIR
}
)
add_test
(
NAME nodeos_run_remote_test COMMAND tests/nodeos_run_remote_test.py -v --dump-error-detail WORKING_DIRECTORY
${
CMAKE_BINARY_DIR
}
)
# TODO removed on slim:
add_test(NAME p2p_dawn515_test COMMAND tests/p2p_tests/dawn_515/test.sh WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
add_test
(
NAME p2p_dawn515_test COMMAND tests/p2p_tests/dawn_515/test.sh WORKING_DIRECTORY
${
CMAKE_BINARY_DIR
}
)
#if(BUILD_MONGO_DB_PLUGIN)
# add_test(NAME nodeos_run_test-mongodb COMMAND tests/nodeos_run_test.py --mongodb -v --dump-error-detail WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
#endif()
# TODO: Tests removed until working again on master.
# TODO: add_test(NAME trans_sync_across_mixed_cluster_test COMMAND tests/trans_sync_across_mixed_cluster_test.sh -p 1 -n 2 WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
add_test
(
NAME distributed-transactions-test COMMAND tests/distributed-transactions-test.py -p 1 -n 4 -v --dump-error-detail WORKING_DIRECTORY
${
CMAKE_BINARY_DIR
}
)
add_test
(
NAME distributed-transactions-remote-test COMMAND tests/distributed-transactions-remote-test.py -v --dump-error-detail WORKING_DIRECTORY
${
CMAKE_BINARY_DIR
}
)
# TODO removed on slim: add_test(NAME restart-scenarios-test_resync COMMAND tests/restart-scenarios-test.py -c resync -p4 -v --dump-error-details WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
...
...
tests/p2p_tests/dawn_515/test.sh
浏览文件 @
498b0002
#!/bin/bash
#
# This test ensures that connections with the same p2p-server-address
# are not closed as redundant.
#
###############################################################
# Extracts staging directory and launchs cluster.
###############################################################
pnodes
=
1
total_nodes
=
3
total_nodes
=
2
topo
=
star
delay
=
1
read
-d
''
config00
<<
EOF
shared-file-size = 8192
read
-d
''
genesis
<<
EOF
{
"initial_timestamp": "2018-06-01T12:00:00.000",
"initial_key": "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
"initial_configuration": {
"max_block_net_usage": 1048576,
"target_block_net_usage_pct": 1000,
"max_transaction_net_usage": 524288,
"base_per_transaction_net_usage": 12,
"net_usage_leeway": 500,
"context_free_discount_net_usage_num": 20,
"context_free_discount_net_usage_den": 100,
"max_block_cpu_usage": 200000,
"target_block_cpu_usage_pct": 1000,
"max_transaction_cpu_usage": 150000,
"min_transaction_cpu_usage": 100,
"max_transaction_lifetime": 3600,
"deferred_trx_expiration_window": 600,
"max_transaction_delay": 3888000,
"max_inline_action_size": 4096,
"max_inline_action_depth": 4,
"max_authority_depth": 6
}
EOF
read
-d
''
configbios
<<
EOF
p2p-server-address = localhost:9876
plugin = eosio::producer_plugin
plugin = eosio::chain_api_plugin
plugin = eosio::account_history_plugin
plugin = eosio::account_history_api_plugin
required-participation = true
shared-file-dir = blockchain
plugin = eosio::net_plugin
plugin = eosio::history_api_plugin
http-server-address = 127.0.0.1:8888
block
-log
-dir = blocks
block
s
-dir = blocks
p2p-listen-endpoint = 0.0.0.0:9876
allowed-connection = any
private-key = ['EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV','5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3']
send-whole-blocks = true
readonly = 0
genesis-json = ./genesis.json
producer-name = inita
producer-name = initb
producer-name = initc
producer-name = initd
producer-name = inite
producer-name = initf
producer-name = initg
producer-name = inith
producer-name = initi
producer-name = initj
producer-name = initk
producer-name = initl
producer-name = initm
producer-name = initn
producer-name = inito
producer-name = initp
producer-name = initq
producer-name = initr
producer-name = inits
producer-name = initt
producer-name = initu
p2p-max-nodes-per-host = 10
enable-stale-production = true
producer-name = eosio
EOF
read
-d
''
config01
<<
EOF
genesis-json = ./genesis.json
block-log-dir = blocks
read
-d
''
config00
<<
EOF
blocks-dir = blocks
readonly = 0
send-whole-blocks = true
shared-file-dir = blockchain
shared-file-size = 8192
http-server-address = 127.0.0.1:8889
p2p-listen-endpoint = 0.0.0.0:9877
p2p-server-address = localhost:9877
allowed-connection = any
p2p-peer-address = localhost:9876
plugin = eosio::chain_api_plugin
plugin = eosio::account_history_plugin
plugin = eosio::account_history_api_plugin
EOF
read
-d
''
config02
<<
EOF
genesis-json = ./genesis.json
block-log-dir = blocks
read
-d
''
config01
<<
EOF
blocks-dir = blocks
readonly = 0
send-whole-blocks = true
shared-file-dir = blockchain
shared-file-size = 8192
http-server-address = 127.0.0.1:8890
p2p-listen-endpoint = 0.0.0.0:9878
p2p-server-address = localhost:9877
allowed-connection = any
p2p-peer-address = localhost:9876
plugin = eosio::chain_api_plugin
plugin = eosio::account_history_plugin
plugin = eosio::account_history_api_plugin
EOF
read
-d
''
logging
00
<<
EOF
read
-d
''
logging
bios
<<
EOF
{
"includes": [],
"appenders": [{
...
...
@@ -137,7 +135,7 @@ read -d '' logging00 << EOF
}
EOF
read
-d
''
logging0
1
<<
EOF
read
-d
''
logging0
0
<<
EOF
{
"includes": [],
"appenders": [{
...
...
@@ -191,7 +189,7 @@ read -d '' logging01 << EOF
}
EOF
read
-d
''
logging0
2
<<
EOF
read
-d
''
logging0
1
<<
EOF
{
"includes": [],
"appenders": [{
...
...
@@ -250,36 +248,58 @@ rm -rf etc/eosio/node_*
rm
-rf
var/lib
cName
=
config.ini
lName
=
logging.json
gName
=
genesis.json
path
=
staging/etc/eosio/node_bios
mkdir
-p
$path
echo
"
$configbios
"
>
$path
/
$cName
echo
"
$loggingbios
"
>
$path
/
$lName
echo
"
$genesis
"
>
$path
/
$gName
path
=
staging/etc/eosio/node_00
mkdir
-p
$path
echo
"
$config00
"
>
$path
/
$cName
echo
"
$logging00
"
>
$path
/
$lName
echo
"
$genesis
"
>
$path
/
$gName
path
=
staging/etc/eosio/node_01
mkdir
-p
$path
echo
"
$config01
"
>
$path
/
$cName
echo
"
$logging01
"
>
$path
/
$lName
path
=
staging/etc/eosio/node_02
mkdir
-p
$path
echo
"
$config02
"
>
$path
/
$cName
echo
"
$logging02
"
>
$path
/
$lName
echo
"
$genesis
"
>
$path
/
$gName
programs/
launcher/
launcher
-p
$pnodes
-n
$total_nodes
--nogen
-d
$delay
programs/
eosio-launcher/eosio-
launcher
-p
$pnodes
-n
$total_nodes
--nogen
-d
$delay
sleep
1
res
=
$(
grep
"reason = duplicate"
var/lib/node_0
*
/stderr.txt |
wc
-l
)
sleep
5
res
=
$(
grep
"reason = duplicate"
var/lib/node_
*
/stderr.txt |
wc
-l
)
ret
=
0
if
[
$res
-ne
0
]
;
then
echo
FAILURE: got a
\"
duplicate
\"
message
else
echo
"SUCCESS"
ret
=
1
fi
b5idbios
=
`
./programs/cleos/cleos
-u
http://localhost:8888 get block 5 |
grep
"^ *
\"
id
\"
"
`
b5id00
=
`
./programs/cleos/cleos
-u
http://localhost:8889 get block 5 |
grep
"^ *
\"
id
\"
"
`
b5id01
=
`
./programs/cleos/cleos
-u
http://localhost:8890 get block 5 |
grep
"^ *
\"
id
\"
"
`
if
[
"
$b5idbios
"
!=
"
$b5id00
"
]
;
then
echo
FAILURE: nodes are not
in
sync
ret
=
1
fi
if
[
"
$b5idbios
"
!=
"
$b5id01
"
]
;
then
echo
FAILURE: nodes are not
in
sync
ret
=
1
fi
if
[
$ret
-eq
0
]
;
then
echo
SUCCESS
fi
programs/
launcher/
launcher
-k
15
programs/
eosio-launcher/eosio-
launcher
-k
15
rm
-rf
staging
rm
-rf
var/lib/node_
*
rm
-rf
etc/eosio/node_
*
exit
$re
s
exit
$re
t
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录