Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
YottaChain
YTBP
提交
8ff41f24
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,发现更多精彩内容 >>
提交
8ff41f24
编写于
8月 18, 2017
作者:
D
Daniel Larimer
提交者:
GitHub
8月 18, 2017
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #177 from EOSIO/skip-sig-173
Fix for issue 173, --skip-transaction-signatures to eosd
上级
d5c30e59
b976510b
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
43 addition
and
5 deletion
+43
-5
contracts/eoslib/eosc.dox
contracts/eoslib/eosc.dox
+7
-1
plugins/chain_plugin/chain_plugin.cpp
plugins/chain_plugin/chain_plugin.cpp
+27
-2
plugins/chain_plugin/include/eos/chain_plugin/chain_plugin.hpp
...ns/chain_plugin/include/eos/chain_plugin/chain_plugin.hpp
+6
-2
plugins/producer_plugin/producer_plugin.cpp
plugins/producer_plugin/producer_plugin.cpp
+3
-0
未找到文件。
contracts/eoslib/eosc.dox
浏览文件 @
8ff41f24
...
...
@@ -6,7 +6,13 @@
@section intro Introduction to EOSC
`eosc` is a command line tool that interfaces with the REST api exposed by @ref eosd. In order to use `eosc` you will need to
have a local copy of `eosd` running and configured to load the 'eos::chain_api_plugin'.
have a local copy of `eosd` running and configured to load the 'eos::chain_api_plugin'.
As an easy way for developers to test functionality without dealing with keys, `eosd` can be run so that
Transaction signatures are not required.
...
./eosd --skip-transaction-signatures
...
```
# Plugin(s) to enable, may be specified multiple times
...
...
plugins/chain_plugin/chain_plugin.cpp
浏览文件 @
8ff41f24
...
...
@@ -36,6 +36,7 @@ public:
bfs
::
path
block_log_dir
;
bfs
::
path
genesis_file
;
chain
::
Time
genesis_timestamp
;
uint32_t
skip_flags
=
chain_controller
::
skip_nothing
;
bool
readonly
=
false
;
flat_map
<
uint32_t
,
block_id_type
>
loaded_checkpoints
;
...
...
@@ -66,6 +67,8 @@ void chain_plugin::set_program_options(options_description& cli, options_descrip
"clear chain database and replay all blocks"
)
(
"resync-blockchain"
,
bpo
::
bool_switch
()
->
default_value
(
false
),
"clear chain database and block log"
)
(
"skip-transaction-signatures"
,
bpo
::
bool_switch
()
->
default_value
(
false
),
"Disable Transaction signature verification. ONLY for TESTING."
)
;
}
...
...
@@ -107,6 +110,20 @@ void chain_plugin::plugin_initialize(const variables_map& options) {
app
().
get_plugin
<
database_plugin
>
().
wipe_database
();
fc
::
remove_all
(
my
->
block_log_dir
);
}
if
(
options
.
at
(
"skip-transaction-signatures"
).
as
<
bool
>
())
{
ilog
(
"Setting skip_transaction_signatures"
);
elog
(
"Setting skip_transaction_signatures
\n
"
"
\n
"
"**************************************
\n
"
"* *
\n
"
"* -- EOSD IGNORING SIGNATURES -- *
\n
"
"* - TEST MODE - *
\n
"
"* ------------------------------ *
\n
"
"* *
\n
"
"**************************************
\n
"
);
my
->
skip_flags
|=
chain_controller
::
skip_transaction_signatures
;
}
if
(
options
.
count
(
"checkpoint"
))
{
...
...
@@ -154,6 +171,10 @@ void chain_plugin::plugin_startup()
void
chain_plugin
::
plugin_shutdown
()
{
}
chain_apis
::
read_write
chain_plugin
::
get_read_write_api
()
{
return
chain_apis
::
read_write
(
chain
(),
my
->
skip_flags
);
}
bool
chain_plugin
::
accept_block
(
const
chain
::
signed_block
&
block
,
bool
currently_syncing
)
{
if
(
currently_syncing
&&
block
.
block_num
()
%
10000
==
0
)
{
ilog
(
"Syncing Blockchain --- Got block: #${n} time: ${t} producer: ${p}"
,
...
...
@@ -166,7 +187,7 @@ bool chain_plugin::accept_block(const chain::signed_block& block, bool currently
}
void
chain_plugin
::
accept_transaction
(
const
chain
::
SignedTransaction
&
trx
)
{
chain
().
push_transaction
(
trx
);
chain
().
push_transaction
(
trx
,
my
->
skip_flags
);
}
bool
chain_plugin
::
block_is_on_preferred_chain
(
const
chain
::
block_id_type
&
block_id
)
{
...
...
@@ -177,6 +198,10 @@ bool chain_plugin::block_is_on_preferred_chain(const chain::block_id_type& block
return
chain
().
get_block_id_for_num
(
chain
::
block_header
::
num_from_id
(
block_id
))
==
block_id
;
}
bool
chain_plugin
::
is_skipping_transaction_signatures
()
const
{
return
my
->
skip_flags
&
chain_controller
::
skip_transaction_signatures
;
}
chain_controller
&
chain_plugin
::
chain
()
{
return
*
my
->
chain
;
}
const
chain
::
chain_controller
&
chain_plugin
::
chain
()
const
{
return
*
my
->
chain
;
}
...
...
@@ -301,7 +326,7 @@ read_write::push_block_results read_write::push_block(const read_write::push_blo
}
read_write
::
push_transaction_results
read_write
::
push_transaction
(
const
read_write
::
push_transaction_params
&
params
)
{
auto
ptrx
=
db
.
push_transaction
(
params
);
auto
ptrx
=
db
.
push_transaction
(
params
,
skip_flags
);
auto
pretty_trx
=
db
.
transaction_to_variant
(
ptrx
);
return
read_write
::
push_transaction_results
{
params
.
id
(),
pretty_trx
};
}
...
...
plugins/chain_plugin/include/eos/chain_plugin/chain_plugin.hpp
浏览文件 @
8ff41f24
...
...
@@ -142,8 +142,9 @@ public:
class
read_write
{
chain_controller
&
db
;
uint32_t
skip_flags
;
public:
read_write
(
chain_controller
&
db
)
:
db
(
db
)
{}
read_write
(
chain_controller
&
db
,
uint32_t
skip_flags
)
:
db
(
db
),
skip_flags
(
skip_flags
)
{}
using
push_block_params
=
chain
::
signed_block
;
using
push_block_results
=
empty
;
...
...
@@ -172,13 +173,16 @@ public:
void
plugin_shutdown
();
chain_apis
::
read_only
get_read_only_api
()
const
{
return
chain_apis
::
read_only
(
chain
());
}
chain_apis
::
read_write
get_read_write_api
()
{
return
chain_apis
::
read_write
(
chain
());
}
chain_apis
::
read_write
get_read_write_api
()
;
bool
accept_block
(
const
chain
::
signed_block
&
block
,
bool
currently_syncing
);
void
accept_transaction
(
const
chain
::
SignedTransaction
&
trx
);
bool
block_is_on_preferred_chain
(
const
chain
::
block_id_type
&
block_id
);
// return true if --skip-transaction-signatures passed to eosd
bool
is_skipping_transaction_signatures
()
const
;
// Only call this after plugin_startup()!
chain_controller
&
chain
();
// Only call this after plugin_startup()!
...
...
plugins/producer_plugin/producer_plugin.cpp
浏览文件 @
8ff41f24
...
...
@@ -238,6 +238,9 @@ block_production_condition::block_production_condition_enum producer_plugin_impl
fc
::
time_point
now_fine
=
fc
::
time_point
::
now
();
fc
::
time_point_sec
now
=
now_fine
+
fc
::
microseconds
(
500000
);
if
(
app
().
get_plugin
<
chain_plugin
>
().
is_skipping_transaction_signatures
())
{
_production_skip_flags
|=
chain_controller
::
skip_transaction_signatures
;
}
// If the next block production opportunity is in the present or future, we're synced.
if
(
!
_production_enabled
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录