未验证 提交 cfcba8d1 编写于 作者: Z zorba80 提交者: GitHub

Merge branch 'master' into issue3189

......@@ -4,7 +4,7 @@
# Go into cmd loop: sudo ./cleos.sh
# Run single cmd: sudo ./cleos.sh <cleos paramers>
PREFIX="docker exec docker_nodeos_1 cleos"
PREFIX="docker exec docker_nodeosd_1 cleos"
if [ -z $1 ] ; then
while :
do
......
......@@ -11,7 +11,7 @@ services:
nodeosd:
image: eosio/eos:latest
command: /opt/eosio/bin/nodeosd.sh --data-dir /opt/eosio/bin/data-dir --resync --mongodb-uri mongodb://mongo:27017/EOS
command: /opt/eosio/bin/nodeosd.sh --data-dir /opt/eosio/bin/data-dir --resync #--mongodb-uri mongodb://mongo:27017/EOS
hostname: nodeosd
links:
- mongo
......@@ -38,4 +38,4 @@ volumes:
nodeos-data-volume:
external: true
keosd-data-volume:
external: true
\ No newline at end of file
external: true
Subproject commit 50dc015b2f0e25c0cd01cf520245da23c0ed446b
Subproject commit 70e23f7ebbdccb64f9ac11ade9fa41ba78b31b5e
......@@ -143,6 +143,9 @@ struct controller_impl {
void emit( const Signal& s, Arg&& a ) {
try {
s(std::forward<Arg>(a));
} catch (boost::interprocess::bad_alloc& e) {
wlog( "bad alloc" );
throw e;
} catch ( fc::exception& e ) {
wlog( "${details}", ("details", e.to_detail_string()) );
} catch ( ... ) {
......
......@@ -158,6 +158,7 @@ namespace eosio { namespace chain {
signal<void(const transaction_metadata_ptr&)> accepted_transaction;
signal<void(const transaction_trace_ptr&)> applied_transaction;
signal<void(const header_confirmation&)> accepted_confirmation;
signal<void(const int&)> bad_alloc;
/*
signal<void()> pre_apply_block;
......
......@@ -23,6 +23,7 @@
#include <fc/io/json.hpp>
#include <fc/variant.hpp>
#include <signal.h>
namespace eosio {
......@@ -268,7 +269,6 @@ void chain_plugin::plugin_startup()
("num", my->chain->head_block_num())("ts", (std::string)my->chain_config->genesis.initial_timestamp));
my->chain_config.reset();
} FC_CAPTURE_LOG_AND_RETHROW( (my->genesis_file.generic_string()) ) }
void chain_plugin::plugin_shutdown() {
......@@ -524,36 +524,50 @@ fc::variant read_only::get_block(const read_only::get_block_params& params) cons
}
read_write::push_block_results read_write::push_block(const read_write::push_block_params& params) {
db.push_block( std::make_shared<signed_block>(params) );
try {
db.push_block( std::make_shared<signed_block>(params) );
} catch ( ... ) {
raise(SIGUSR1);
}
return read_write::push_block_results();
}
read_write::push_transaction_results read_write::push_transaction(const read_write::push_transaction_params& params) {
auto pretty_input = std::make_shared<packed_transaction>();
auto resolver = make_resolver(this);
chain::transaction_id_type id;
fc::variant pretty_output;
try {
abi_serializer::from_variant(params, *pretty_input, resolver);
} EOS_RETHROW_EXCEPTIONS(chain::packed_transaction_type_exception, "Invalid packed transaction")
auto pretty_input = std::make_shared<packed_transaction>();
auto resolver = make_resolver(this);
try {
abi_serializer::from_variant(params, *pretty_input, resolver);
} EOS_RETHROW_EXCEPTIONS(chain::packed_transaction_type_exception, "Invalid packed transaction")
auto trx_trace_ptr = app().get_method<incoming::methods::transaction_sync>()(pretty_input);
auto trx_trace_ptr = app().get_method<incoming::methods::transaction_sync>()(pretty_input);
fc::variant pretty_output = db.to_variant_with_abi( *trx_trace_ptr );;
//abi_serializer::to_variant(*trx_trace_ptr, pretty_output, resolver);
return read_write::push_transaction_results{ trx_trace_ptr->id, pretty_output };
pretty_output = db.to_variant_with_abi( *trx_trace_ptr );;
//abi_serializer::to_variant(*trx_trace_ptr, pretty_output, resolver);
id = trx_trace_ptr->id;
} catch ( ... ) {
raise(SIGUSR1);
}
return read_write::push_transaction_results{ id, pretty_output };
}
read_write::push_transactions_results read_write::push_transactions(const read_write::push_transactions_params& params) {
FC_ASSERT( params.size() <= 1000, "Attempt to push too many transactions at once" );
push_transactions_results result;
result.reserve(params.size());
for( const auto& item : params ) {
try {
result.emplace_back( push_transaction( item ) );
} catch ( const fc::exception& e ) {
result.emplace_back( read_write::push_transaction_results{ transaction_id_type(),
fc::mutable_variant_object( "error", e.to_detail_string() ) } );
try {
result.reserve(params.size());
for( const auto& item : params ) {
try {
result.emplace_back( push_transaction( item ) );
} catch ( const fc::exception& e ) {
result.emplace_back( read_write::push_transaction_results{ transaction_id_type(),
fc::mutable_variant_object( "error", e.to_detail_string() ) } );
}
}
} catch ( ... ) {
raise(SIGUSR1);
}
return result;
}
......
......@@ -73,7 +73,8 @@ class producer_plugin_impl {
producer_plugin_impl(boost::asio::io_service& io)
:_timer(io)
,_transaction_ack_channel(app().get_channel<compat::channels::transaction_ack>())
{}
{
}
void schedule_production_loop();
block_production_condition::block_production_condition_enum block_production_loop();
......@@ -186,6 +187,7 @@ class producer_plugin_impl {
chain::controller& chain = app().get_plugin<chain_plugin>().chain();
// abort the pending block
chain.abort_block();
......
......@@ -97,6 +97,10 @@ int main(int argc, char** argv)
app().exec();
} catch (const fc::exception& e) {
elog("${e}", ("e",e.to_detail_string()));
} catch (const boost::interprocess::bad_alloc& e) {
elog("bad alloc");
//elog("${e}", ("e", boost::diagnostic_information(e)));
return 3;
} catch (const boost::exception& e) {
elog("${e}", ("e",boost::diagnostic_information(e)));
} catch (const std::exception& e) {
......@@ -104,5 +108,6 @@ int main(int argc, char** argv)
} catch (...) {
elog("unknown exception");
}
return 0;
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册