From 891137cf5728848da664da0f8a3b98452089e987 Mon Sep 17 00:00:00 2001 From: Alfredo Date: Mon, 17 Dec 2018 18:50:05 -0300 Subject: [PATCH 1/5] merge PR 2 --- libraries/chain/account_evaluator.cpp | 12 +- .../include/graphene/chain/account_object.hpp | 6 + tests/tests/voting_tests.cpp | 166 ++++++++++++++++++ 3 files changed, 183 insertions(+), 1 deletion(-) create mode 100644 tests/tests/voting_tests.cpp diff --git a/libraries/chain/account_evaluator.cpp b/libraries/chain/account_evaluator.cpp index a08e9031..2d117f52 100644 --- a/libraries/chain/account_evaluator.cpp +++ b/libraries/chain/account_evaluator.cpp @@ -279,6 +279,17 @@ void_result account_update_evaluator::do_evaluate( const account_update_operatio void_result account_update_evaluator::do_apply( const account_update_operation& o ) { try { database& d = db(); + + if( o.new_options.valid() ) + { + d.modify( acnt->statistics( d ), [&]( account_statistics_object& aso ) + { + if((o.new_options->votes != acnt->options.votes || + o.new_options->voting_account != acnt->options.voting_account)) + aso.last_vote_time = d.head_block_time(); + } ); + } + bool sa_before, sa_after; d.modify( *acnt, [&](account_object& a){ if( o.owner ) @@ -320,7 +331,6 @@ void_result account_update_evaluator::do_apply( const account_update_operation& sa.account = o.account; } ); } - return void_result(); } FC_CAPTURE_AND_RETHROW( (o) ) } diff --git a/libraries/chain/include/graphene/chain/account_object.hpp b/libraries/chain/include/graphene/chain/account_object.hpp index 51ba6748..914ade33 100644 --- a/libraries/chain/include/graphene/chain/account_object.hpp +++ b/libraries/chain/include/graphene/chain/account_object.hpp @@ -82,6 +82,11 @@ namespace graphene { namespace chain { */ share_type pending_vested_fees; + /** + * Keep the date of the last voting activity for this account. + */ + time_point_sec last_vote_time; + /// @brief Split up and pay out @ref pending_fees and @ref pending_vested_fees void process_fees(const account_object& a, database& d) const; @@ -463,6 +468,7 @@ FC_REFLECT_DERIVED( graphene::chain::account_statistics_object, (total_core_in_orders) (lifetime_fees_paid) (pending_fees)(pending_vested_fees) + (last_vote_time) ) FC_REFLECT_DERIVED( graphene::chain::pending_dividend_payout_balance_for_holder_object, diff --git a/tests/tests/voting_tests.cpp b/tests/tests/voting_tests.cpp new file mode 100644 index 00000000..b88f485a --- /dev/null +++ b/tests/tests/voting_tests.cpp @@ -0,0 +1,166 @@ +/* + * Copyright (c) 2018 oxarbitrage, and contributors. + * + * The MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include + +#include +#include + +#include + +#include "../common/database_fixture.hpp" + +using namespace graphene::chain; +using namespace graphene::chain::test; + + +BOOST_FIXTURE_TEST_SUITE(voting_tests, database_fixture) + +BOOST_AUTO_TEST_CASE(last_voting_date) +{ + try + { + ACTORS((alice)); + + transfer(committee_account, alice_id, asset(100)); + + // we are going to vote for this witness + auto witness1 = witness_id_type(1)(db); + + auto stats_obj = alice_id(db).statistics(db); + BOOST_CHECK_EQUAL(stats_obj.last_vote_time.sec_since_epoch(), 0); + + // alice votes + graphene::chain::account_update_operation op; + op.account = alice_id; + op.new_options = alice.options; + op.new_options->votes.insert(witness1.vote_id); + trx.operations.push_back(op); + sign(trx, alice_private_key); + PUSH_TX( db, trx, ~0 ); + + auto now = db.head_block_time().sec_since_epoch(); + + // last_vote_time is updated for alice + stats_obj = alice_id(db).statistics(db); + BOOST_CHECK_EQUAL(stats_obj.last_vote_time.sec_since_epoch(), now); + + } FC_LOG_AND_RETHROW() +} +BOOST_AUTO_TEST_CASE(last_voting_date_proxy) +{ + try + { + ACTORS((alice)(proxy)(bob)); + + transfer(committee_account, alice_id, asset(100)); + transfer(committee_account, bob_id, asset(200)); + transfer(committee_account, proxy_id, asset(300)); + + generate_block(); + + // witness to vote for + auto witness1 = witness_id_type(1)(db); + + // round1: alice changes proxy, this is voting activity + { + graphene::chain::account_update_operation op; + op.account = alice_id; + op.new_options = alice_id(db).options; + op.new_options->voting_account = proxy_id; + trx.operations.push_back(op); + sign(trx, alice_private_key); + PUSH_TX( db, trx, ~0 ); + } + // alice last_vote_time is updated + auto alice_stats_obj = alice_id(db).statistics(db); + auto round1 = db.head_block_time().sec_since_epoch(); + BOOST_CHECK_EQUAL(alice_stats_obj.last_vote_time.sec_since_epoch(), round1); + + generate_block(); + + // round 2: alice update account but no proxy or voting changes are done + { + graphene::chain::account_update_operation op; + op.account = alice_id; + op.new_options = alice_id(db).options; + trx.operations.push_back(op); + sign(trx, alice_private_key); + set_expiration( db, trx ); + PUSH_TX( db, trx, ~0 ); + } + // last_vote_time is not updated + auto round2 = db.head_block_time().sec_since_epoch(); + alice_stats_obj = alice_id(db).statistics(db); + BOOST_CHECK_EQUAL(alice_stats_obj.last_vote_time.sec_since_epoch(), round1); + + generate_block(); + + // round 3: bob votes + { + graphene::chain::account_update_operation op; + op.account = bob_id; + op.new_options = bob_id(db).options; + op.new_options->votes.insert(witness1.vote_id); + trx.operations.push_back(op); + sign(trx, bob_private_key); + set_expiration( db, trx ); + PUSH_TX(db, trx, ~0); + } + + // last_vote_time for bob is updated as he voted + auto round3 = db.head_block_time().sec_since_epoch(); + auto bob_stats_obj = bob_id(db).statistics(db); + BOOST_CHECK_EQUAL(bob_stats_obj.last_vote_time.sec_since_epoch(), round3); + + generate_block(); + + // round 4: proxy votes + { + graphene::chain::account_update_operation op; + op.account = proxy_id; + op.new_options = proxy_id(db).options; + op.new_options->votes.insert(witness1.vote_id); + trx.operations.push_back(op); + sign(trx, proxy_private_key); + PUSH_TX(db, trx, ~0); + } + + // proxy just voted so the last_vote_time is updated + auto round4 = db.head_block_time().sec_since_epoch(); + auto proxy_stats_obj = proxy_id(db).statistics(db); + BOOST_CHECK_EQUAL(proxy_stats_obj.last_vote_time.sec_since_epoch(), round4); + + // alice haves proxy, proxy votes but last_vote_time is not updated for alice + alice_stats_obj = alice_id(db).statistics(db); + BOOST_CHECK_EQUAL(alice_stats_obj.last_vote_time.sec_since_epoch(), round1); + + // bob haves nothing to do with proxy so last_vote_time is not updated + bob_stats_obj = bob_id(db).statistics(db); + BOOST_CHECK_EQUAL(bob_stats_obj.last_vote_time.sec_since_epoch(), round3); + + } FC_LOG_AND_RETHROW() +} + +BOOST_AUTO_TEST_SUITE_END() From 1c1652cca2a09feb5e76fd93c8ae66934b2f4c0a Mon Sep 17 00:00:00 2001 From: pbattu123 Date: Thu, 30 May 2019 10:29:13 -0300 Subject: [PATCH 2/5] need to remove backup files --- programs/witness_node/bkup_config.ini | 83 ---- programs/witness_node/bkup_genesis.json | 496 ------------------------ 2 files changed, 579 deletions(-) delete mode 100644 programs/witness_node/bkup_config.ini delete mode 100644 programs/witness_node/bkup_genesis.json diff --git a/programs/witness_node/bkup_config.ini b/programs/witness_node/bkup_config.ini deleted file mode 100644 index 912230cb..00000000 --- a/programs/witness_node/bkup_config.ini +++ /dev/null @@ -1,83 +0,0 @@ -# Endpoint for P2P node to listen on -p2p-endpoint = 0.0.0.0:9777 - -# P2P nodes to connect to on startup (may specify multiple times) -# seed-node = - -# JSON array of P2P nodes to connect to on startup -# seed-nodes = - -# Pairs of [BLOCK_NUM,BLOCK_ID] that should be enforced as checkpoints. -# checkpoint = - -# Endpoint for websocket RPC to listen on -rpc-endpoint = 0.0.0.0:8090 - -# Endpoint for TLS websocket RPC to listen on -# rpc-tls-endpoint = - -# The TLS certificate file for this server -# server-pem = - -# Password for this certificate -# server-pem-password = - -# File to read Genesis State from - genesis-json =genesis.json - -# Block signing key to use for init witnesses, overrides genesis file -# dbg-init-key = - -# JSON file specifying API permissions -# api-access = - -# Enable block production, even if the chain is stale. -enable-stale-production = true - -# Percent of witnesses (0-99) that must be participating in order to produce blocks -required-participation = false - -# ID of witness controlled by this node (e.g. "1.6.5", quotes are required, may specify multiple times) -# witness-id = - -# IDs of multiple witnesses controlled by this node (e.g. ["1.6.5", "1.6.6"], quotes are required) - witness-ids = ["1.6.1", "1.6.2", "1.6.3", "1.6.4", "1.6.5", "1.6.6", "1.6.7", "1.6.8", "1.6.9", "1.6.10", "1.6.11"] - -# Tuple of [PublicKey, WIF private key] (may specify multiple times) -private-key = ["TEST6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV","5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3"] - -# Account ID to track history for (may specify multiple times) -# track-account = - -# Keep only those operations in memory that are related to account history tracking -# partial-operations = - -# Maximum number of operations per account will be kept in memory -# max-ops-per-account = - -# Track market history by grouping orders into buckets of equal size measured in seconds specified as a JSON array of numbers -bucket-size = [15,60,300,3600,86400] - -# How far back in time to track history for each bucket size, measured in the number of buckets (default: 1000) -history-per-size = 1000 - -# declare an appender named "stderr" that writes messages to the console -[log.console_appender.stderr] -stream=std_error - -# declare an appender named "p2p" that writes messages to p2p.log -[log.file_appender.p2p] -filename=logs/p2p/p2p.log -# filename can be absolute or relative to this config file - -# route any messages logged to the default logger to the "stderr" logger we -# declared above, if they are info level are higher -[logger.default] -level=info -appenders=stderr - -# route messages sent to the "p2p" logger to the p2p appender declared above -[logger.p2p] -level=info -appenders=p2p - diff --git a/programs/witness_node/bkup_genesis.json b/programs/witness_node/bkup_genesis.json deleted file mode 100644 index 15bcf26a..00000000 --- a/programs/witness_node/bkup_genesis.json +++ /dev/null @@ -1,496 +0,0 @@ -{ - "initial_timestamp": "2019-01-02T19:42:12", - "max_core_supply": "1000000000000000", - "initial_parameters": { - "current_fees": { - "parameters": [[ - 0,{ - "fee": 2000000, - "price_per_kbyte": 1000000 - } - ],[ - 1,{ - "fee": 500000 - } - ],[ - 2,{ - "fee": 0 - } - ],[ - 3,{ - "fee": 2000000 - } - ],[ - 4,{} - ],[ - 5,{ - "basic_fee": 500000, - "premium_fee": 200000000, - "price_per_kbyte": 100000 - } - ],[ - 6,{ - "fee": 2000000, - "price_per_kbyte": 100000 - } - ],[ - 7,{ - "fee": 300000 - } - ],[ - 8,{ - "membership_annual_fee": 200000000, - "membership_lifetime_fee": 1000000000 - } - ],[ - 9,{ - "fee": 50000000 - } - ],[ - 10,{ - "symbol3": "50000000000", - "symbol4": "30000000000", - "long_symbol": 500000000, - "price_per_kbyte": 10 - } - ],[ - 11,{ - "fee": 50000000, - "price_per_kbyte": 10 - } - ],[ - 12,{ - "fee": 50000000 - } - ],[ - 13,{ - "fee": 50000000 - } - ],[ - 14,{ - "fee": 2000000, - "price_per_kbyte": 100000 - } - ],[ - 15,{ - "fee": 2000000 - } - ],[ - 16,{ - "fee": 100000 - } - ],[ - 17,{ - "fee": 10000000 - } - ],[ - 18,{ - "fee": 50000000 - } - ],[ - 19,{ - "fee": 100000 - } - ],[ - 20,{ - "fee": 500000000 - } - ],[ - 21,{ - "fee": 2000000 - } - ],[ - 22,{ - "fee": 2000000, - "price_per_kbyte": 10 - } - ],[ - 23,{ - "fee": 2000000, - "price_per_kbyte": 10 - } - ],[ - 24,{ - "fee": 100000 - } - ],[ - 25,{ - "fee": 100000 - } - ],[ - 26,{ - "fee": 100000 - } - ],[ - 27,{ - "fee": 2000000, - "price_per_kbyte": 10 - } - ],[ - 28,{ - "fee": 0 - } - ],[ - 29,{ - "fee": 500000000 - } - ],[ - 30,{ - "fee": 2000000 - } - ],[ - 31,{ - "fee": 100000 - } - ],[ - 32,{ - "fee": 100000 - } - ],[ - 33,{ - "fee": 2000000 - } - ],[ - 34,{ - "fee": 500000000 - } - ],[ - 35,{ - "fee": 100000, - "price_per_kbyte": 10 - } - ],[ - 36,{ - "fee": 100000 - } - ],[ - 37,{} - ],[ - 38,{ - "fee": 2000000, - "price_per_kbyte": 10 - } - ],[ - 39,{ - "fee": 500000, - "price_per_output": 500000 - } - ],[ - 40,{ - "fee": 500000, - "price_per_output": 500000 - } - ],[ - 41,{ - "fee": 500000 - } - ],[ - 42,{} - ],[ - 43,{ - "fee": 2000000 - } - ],[ - 44,{} - ],[ - 45,{ - "fee": 100000 - } - ],[ - 46,{ - "fee": 100000 - } - ],[ - 47,{ - "fee": 100000 - } - ],[ - 48,{ - "fee": 50000000 - } - ],[ - 49,{ - "distribution_base_fee": 0, - "distribution_fee_per_holder": 0 - } - ],[ - 50,{} - ],[ - 51,{ - "fee": 100000 - } - ],[ - 52,{ - "fee": 100000 - } - ],[ - 53,{ - "fee": 100000 - } - ],[ - 54,{ - "fee": 100000 - } - ],[ - 55,{ - "fee": 100000 - } - ],[ - 56,{ - "fee": 100000 - } - ],[ - 57,{ - "fee": 100000 - } - ],[ - 58,{ - "fee": 100000 - } - ],[ - 59,{ - "fee": 100000 - } - ],[ - 60,{ - "fee": 100000 - } - ],[ - 61,{ - "fee": 100000 - } - ],[ - 62,{ - "fee": 1000 - } - ],[ - 63,{ - "fee": 100000 - } - ],[ - 64,{} - ],[ - 65,{} - ],[ - 66,{ - "fee": 100000 - } - ],[ - 67,{} - ],[ - 68,{ - "fee": 0 - } - ],[ - 69,{} - ],[ - 70,{ - "fee": 100000 - } - ],[ - 71,{ - "fee": 100000 - } - ],[ - 72,{ - "fee": 100000 - } - ],[ - 73,{ - "fee": 100000 - } - ],[ - 74,{ - "fee": 100000 - } - ],[ - 75,{} - ],[ - 76,{} - ] - ], - "scale": 10000 - }, - "block_interval": 3, - "maintenance_interval": 900, - "maintenance_skip_slots": 3, - "committee_proposal_review_period": 2000, - "maximum_transaction_size": 2048, - "maximum_block_size": 1228800000, - "maximum_time_until_expiration": 86400, - "maximum_proposal_lifetime": 2419200, - "maximum_asset_whitelist_authorities": 10, - "maximum_asset_feed_publishers": 10, - "maximum_witness_count": 1001, - "maximum_committee_count": 1001, - "maximum_authority_membership": 10, - "reserve_percent_of_fee": 2000, - "network_percent_of_fee": 2000, - "lifetime_referrer_percent_of_fee": 3000, - "cashback_vesting_period_seconds": 31536000, - "cashback_vesting_threshold": 10000000, - "count_non_member_votes": true, - "allow_non_member_whitelists": false, - "witness_pay_per_block": 1000000, - "worker_budget_per_day": "50000000000", - "max_predicate_opcode": 1, - "fee_liquidation_threshold": 10000000, - "accounts_per_fee_scale": 1000, - "account_fee_scale_bitshifts": 4, - "max_authority_depth": 2, - "witness_schedule_algorithm": 1, - "min_round_delay": 0, - "max_round_delay": 600, - "min_time_per_commit_move": 0, - "max_time_per_commit_move": 600, - "min_time_per_reveal_move": 0, - "max_time_per_reveal_move": 600, - "rake_fee_percentage": 300, - "maximum_registration_deadline": 2592000, - "maximum_players_in_tournament": 256, - "maximum_tournament_whitelist_length": 1000, - "maximum_tournament_start_time_in_future": 2419200, - "maximum_tournament_start_delay": 604800, - "maximum_tournament_number_of_wins": 100, - "extensions": {} - }, - "initial_bts_accounts": [], - "initial_accounts": [{ - "name": "init0", - "owner_key": "TEST6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV", - "active_key": "TEST6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV", - "is_lifetime_member": true - },{ - "name": "init1", - "owner_key": "TEST6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV", - "active_key": "TEST6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV", - "is_lifetime_member": true - },{ - "name": "init2", - "owner_key": "TEST6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV", - "active_key": "TEST6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV", - "is_lifetime_member": true - },{ - "name": "init3", - "owner_key": "TEST6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV", - "active_key": "TEST6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV", - "is_lifetime_member": true - },{ - "name": "init4", - "owner_key": "TEST6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV", - "active_key": "TEST6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV", - "is_lifetime_member": true - },{ - "name": "init5", - "owner_key": "TEST6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV", - "active_key": "TEST6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV", - "is_lifetime_member": true - },{ - "name": "init6", - "owner_key": "TEST6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV", - "active_key": "TEST6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV", - "is_lifetime_member": true - },{ - "name": "init7", - "owner_key": "TEST6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV", - "active_key": "TEST6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV", - "is_lifetime_member": true - },{ - "name": "init8", - "owner_key": "TEST6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV", - "active_key": "TEST6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV", - "is_lifetime_member": true - },{ - "name": "init9", - "owner_key": "TEST6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV", - "active_key": "TEST6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV", - "is_lifetime_member": true - },{ - "name": "init10", - "owner_key": "TEST6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV", - "active_key": "TEST6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV", - "is_lifetime_member": true - },{ - "name": "nathan", - "owner_key": "TEST6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV", - "active_key": "TEST6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV", - "is_lifetime_member": false - } - ], - "initial_assets": [], - "initial_balances": [{ - "owner": "TESTFAbAx7yuxt725qSZvfwWqkdCwp9ZnUama", - "asset_symbol": "TEST", - "amount": "1000000000000000" - } - ], - "initial_vesting_balances": [], - "initial_active_witnesses": 11, - "initial_witness_candidates": [{ - "owner_name": "init0", - "block_signing_key": "TEST6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV" - },{ - "owner_name": "init1", - "block_signing_key": "TEST6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV" - },{ - "owner_name": "init2", - "block_signing_key": "TEST6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV" - },{ - "owner_name": "init3", - "block_signing_key": "TEST6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV" - },{ - "owner_name": "init4", - "block_signing_key": "TEST6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV" - },{ - "owner_name": "init5", - "block_signing_key": "TEST6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV" - },{ - "owner_name": "init6", - "block_signing_key": "TEST6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV" - },{ - "owner_name": "init7", - "block_signing_key": "TEST6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV" - },{ - "owner_name": "init8", - "block_signing_key": "TEST6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV" - },{ - "owner_name": "init9", - "block_signing_key": "TEST6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV" - },{ - "owner_name": "init10", - "block_signing_key": "TEST6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV" - } - ], - "initial_committee_candidates": [{ - "owner_name": "init0" - },{ - "owner_name": "init1" - },{ - "owner_name": "init2" - },{ - "owner_name": "init3" - },{ - "owner_name": "init4" - },{ - "owner_name": "init5" - },{ - "owner_name": "init6" - },{ - "owner_name": "init7" - },{ - "owner_name": "init8" - },{ - "owner_name": "init9" - },{ - "owner_name": "init10" - } - ], - "initial_worker_candidates": [], - "initial_chain_id": "aa34045518f1469a28fa4578240d5f039afa9959c0b95ce3b39674efa691fb21", - "immutable_parameters": { - "min_committee_member_count": 11, - "min_witness_count": 11, - "num_special_accounts": 0, - "num_special_assets": 0 - } -} From 859a5257b3a2526f101f16b9451d7b1b95d995b6 Mon Sep 17 00:00:00 2001 From: Bobinson K B Date: Tue, 13 Aug 2019 18:01:21 +0530 Subject: [PATCH 3/5] Update README.md corrected an issue with the path --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a6f9cf26..2a78a0c7 100644 --- a/README.md +++ b/README.md @@ -36,12 +36,12 @@ export BOOST_ROOT=/root/boost_1_67_0 export CC=gcc-5 ; export CXX=g++-5 cd $HOME/src git clone https://github.com/peerplays-network/peerplays.git -mkdir $HOME/peerplays/build; cd $HOME/src/peerplays/build +mkdir $HOME/src/peerplays/build; cd $HOME/src/peerplays/build git submodule update --init --recursive cmake -DBOOST_ROOT="$BOOST_ROOT" -DCMAKE_BUILD_TYPE=Release .. make -j$(nproc) -ake install # this can install the executable files under /usr/local +make install # this can install the executable files under /usr/local ``` Rest of the instructions on starting the chain remains same. From 4d426e1f5a2513a26cb88446ea8002caac86417f Mon Sep 17 00:00:00 2001 From: Srdjan Obucina Date: Wed, 14 Aug 2019 14:05:30 +0200 Subject: [PATCH 4/5] Enable building on Ubuntu 18.04 using GCC 7 compiler --- CMakeLists.txt | 6 +++++- README.md | 7 +++---- .../include/graphene/chain/vesting_balance_object.hpp | 4 ++-- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 20d96a9a..595e1cc0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -119,7 +119,11 @@ else( WIN32 ) # Apple AND Linux message( STATUS "Configuring BitShares on Linux" ) set( CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -std=c++11 -Wall" ) set( rt_library rt ) - set( pthread_library pthread) + #set( pthread_library pthread) + set(CMAKE_LINKER_FLAGS "-pthread" CACHE STRING "Linker Flags" FORCE) + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_LINKER_FLAGS}" CACHE STRING "" FORCE) + set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_LINKER_FLAGS}" CACHE STRING "" FORCE) + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_LINKER_FLAGS}" CACHE STRING "" FORCE) if ( NOT DEFINED crypto_library ) # I'm not sure why this is here, I guess someone has openssl and can't detect it with find_package()? # if you have a normal install, you can define crypto_library to the empty string to avoid a build error diff --git a/README.md b/README.md index 2a78a0c7..1c0f1cd5 100644 --- a/README.md +++ b/README.md @@ -32,13 +32,12 @@ cd boost_1_67_0/ ## Building Peerplays ``` -export BOOST_ROOT=/root/boost_1_67_0 -export CC=gcc-5 ; export CXX=g++-5 cd $HOME/src +export BOOST_ROOT=$HOME/src/boost_1_67_0 git clone https://github.com/peerplays-network/peerplays.git -mkdir $HOME/src/peerplays/build; cd $HOME/src/peerplays/build +cd peerplays git submodule update --init --recursive -cmake -DBOOST_ROOT="$BOOST_ROOT" -DCMAKE_BUILD_TYPE=Release .. +cmake -DBOOST_ROOT="$BOOST_ROOT" -DCMAKE_BUILD_TYPE=Release make -j$(nproc) make install # this can install the executable files under /usr/local diff --git a/libraries/chain/include/graphene/chain/vesting_balance_object.hpp b/libraries/chain/include/graphene/chain/vesting_balance_object.hpp index 6e0bd689..b2b2e7a2 100644 --- a/libraries/chain/include/graphene/chain/vesting_balance_object.hpp +++ b/libraries/chain/include/graphene/chain/vesting_balance_object.hpp @@ -189,9 +189,9 @@ namespace graphene { namespace chain { ordered_non_unique< tag, composite_key< vesting_balance_object, - member_offset, + member_offset, member, - member_offset + member_offset //member //member_offset >, From f525737879728c66d3a10c4701a45aa85f7dc796 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miha=20=C4=8Can=C4=8Dula?= Date: Mon, 19 Aug 2019 15:13:27 +0200 Subject: [PATCH 5/5] Fix out-of-source CMake builds --- libraries/net/CMakeLists.txt | 2 +- libraries/wallet/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/net/CMakeLists.txt b/libraries/net/CMakeLists.txt index 39f9cd05..7aa617d7 100644 --- a/libraries/net/CMakeLists.txt +++ b/libraries/net/CMakeLists.txt @@ -13,7 +13,7 @@ target_link_libraries( graphene_net PUBLIC fc graphene_db ) target_include_directories( graphene_net PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include" - PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/../chain/include" + PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/../chain/include" "${CMAKE_CURRENT_BINARY_DIR}/../chain/include" ) if(MSVC) diff --git a/libraries/wallet/CMakeLists.txt b/libraries/wallet/CMakeLists.txt index 74b9f7c5..8c9f8790 100644 --- a/libraries/wallet/CMakeLists.txt +++ b/libraries/wallet/CMakeLists.txt @@ -10,7 +10,7 @@ if( PERL_FOUND AND DOXYGEN_FOUND AND NOT "${CMAKE_GENERATOR}" STREQUAL "Ninja" ) COMMAND ${DOXYGEN_EXECUTABLE} DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile include/graphene/wallet/wallet.hpp ) add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/api_documentation.cpp - COMMAND PERLLIB=${CMAKE_CURRENT_SOURCE_DIR} ${PERL_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/generate_api_documentation.pl ${CMAKE_CURRENT_BINARY_DIR}/api_documentation.cpp.new + COMMAND PERLLIB=${CMAKE_CURRENT_BINARY_DIR} ${PERL_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/generate_api_documentation.pl ${CMAKE_CURRENT_BINARY_DIR}/api_documentation.cpp.new COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_BINARY_DIR}/api_documentation.cpp.new ${CMAKE_CURRENT_BINARY_DIR}/api_documentation.cpp COMMAND ${CMAKE_COMMAND} -E remove ${CMAKE_CURRENT_BINARY_DIR}/api_documentation.cpp.new