Skip to content

Commit

Permalink
Merge branch 'master' into steem-prerelease-v0.19.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Vandeberg committed Jun 2, 2017
2 parents a3f8e73 + d04a629 commit 914c3f9
Show file tree
Hide file tree
Showing 16 changed files with 223 additions and 69 deletions.
2 changes: 1 addition & 1 deletion contrib/fullnode.config.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Set larger shared-file-size than default
shared-file-size = 48G
shared-file-size = 54G

# Set an API to be publicly available, may be specified multiple times
public-api = database_api login_api account_by_key_api network_broadcast_api tag_api follow_api market_history_api raw_block_api
Expand Down
1 change: 1 addition & 0 deletions contrib/healthcheck.conf.template
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_http_version 1.1;
proxy_buffering off;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
add_header 'Access-Control-Allow-Origin' '*';
Expand Down
9 changes: 7 additions & 2 deletions contrib/sync-sv-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,13 @@ if [[ ! -z "$BLOCKCHAIN_TIME" ]]; then
echo steemdsync: waiting for steemd to exit cleanly
while [ -e /proc/$STEEMD_PID ]; do sleep 0.1; done
echo steemdsync: starting a new blockchainstate upload operation
cd $HOME
cd ${COMPRESSPATH:-$HOME}
echo steemdsync: compressing blockchainstate...
tar cf blockchain.tar.bz2 --use-compress-prog=pbzip2 blockchain
tar cf blockchain.tar.bz2 --use-compress-prog=pbzip2 -C $HOME blockchain
if [[ ! $? -eq 0 ]]; then
echo NOTIFYALERT! steemdsync was unable to compress shared memory file, check the logs.
exit 1
fi
FILE_NAME=blockchain-$VERSION-`date '+%Y%m%d-%H%M%S'`.tar.bz2
echo steemdsync: uploading $FILE_NAME to $S3_BUCKET
aws s3 cp blockchain.tar.bz2 s3://$S3_BUCKET/$FILE_NAME
Expand All @@ -56,6 +60,7 @@ if [[ ! -z "$BLOCKCHAIN_TIME" ]]; then
exit 1
fi
# upload a current block_log
cd $HOME
aws s3 cp blockchain/block_log s3://$S3_BUCKET/block_log-intransit
aws s3 cp s3://$S3_BUCKET/block_log-intransit s3://$S3_BUCKET/block_log-latest
# kill the container starting the process over again
Expand Down
57 changes: 57 additions & 0 deletions doc/quickstart.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
Quickstart
----------

### Get current steemd
Use docker:
```
docker run \
-d -p 2001:2001 -p 8090:8090 --name steemd-default \
steemit/steem
```
#### Low memory node?
Above runs low memory node, which is suitable for:
- seed nodes
- witness nodes
- exchanges, etc.
For full api node use:

```
docker run \
--env USE_WAY_TOO_MUCH_RAM=1 --env USE_FULL_WEB_NODE=1 \
-d -p 2001:2001 -p 8090:8090 --name steemd-full \
steemit/steem
```
### Configure for your use case
#### Full API node
You need to use `USE_WAY_TOO_MUCH_RAM=1` and `USE_FULL_WEB_NODE=1` as stated above.
You can Use `contrib/fullnode.config.ini` as a base for your `config.ini` file.

#### Exchanges
Use low memory node.

Also make sure that your `config.ini` contains:
```
enable-plugin = account_history
public-api = database_api login_api
track-account-range = ["yourexchangeid", "yourexchangeid"]
```
Do not add other APIs or plugins unless you know what you are doing.

### Resources usage

Please make sure that you have enough resources available.
Check `shared-file-size =` in your `config.ini` to reflect your needs.
Set it to at least 20% more than current size.

Provided values are expected to grow significantly over time.

Blockchain data takes over **12GB** of storage space.

#### Full node
Shared memory file for full node uses over **45GB**

#### Seed node
Shared memory file for seed node uses over **3GB**

#### Other use cases
Shared memory file size varies, depends on your specific configuration but it is expected to be somewhere between "seed node" and "full node" usage.
11 changes: 2 additions & 9 deletions doc/seednodes.txt
Original file line number Diff line number Diff line change
@@ -1,36 +1,29 @@
seed.riversteem.com:2001 # riverhead
steem-seed1.abit-more.com:2001 # abit
52.74.152.79:2001 # smooth.witness
seed.steemd.com:34191 # roadscape
steemwitness.matthewniemerg.com:2001 # complexring
steemd.pharesim.me:2001 # pharesim
seed.jesta.us:2001 # jesta
seed.liondani.com:2016 # liondani
anyx.co:2001 # anyx
seed.xeldal.com:12150 # xeldal
seed.steemnodes.com:2001 # wackou
steem.clawmap.com:2001 # steempty
gtg.steem.house:2001 # gtg
192.99.3.29:2001 # joseph
5.9.18.213:2001 # pfunk
lafonasteem.com:2001 # lafona
seed.rossco99.com:2001 # rossco99
212.47.249.84:40696 # ihashfury
steem-seed.altcap.io:40696 # ihashfury
seed.steemfeeder.com:2001 # au1nethyb1
52.175.211.168:2001 # aizensou
seed.roelandp.nl:2001 # roelandp
81.89.101.133:2001 # cyrano.witness
steem.global:2001 # klye
seed.esteem.ws:2001 # good-karma
176.31.126.187:2001 # timcliff
seed.royaltiffany.me:2001 # royaltiffany
seed.thecryptodrive.com:2001 # thecryptodrive
steem-id.altexplorer.xyz:2001 # steem-id
seed.bitcoiner.me:2001 # bitcoiner
104.199.118.92:2001 # clayop
192.99.4.226:2001 # dele-puppy
89.36.26.82:2001 # dragosroua
104.198.222.18:2001 # bitcoinparadise
138.197.17.188:2001 # chitty
88.99.33.113:2001 # cervantes
seed.bhuz.info:2001 # bhuz
78.46.95.157:2001 # pcste
2 changes: 1 addition & 1 deletion libraries/app/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -970,7 +970,7 @@ void application::set_program_options(boost::program_options::options_descriptio
("seed-node,s", bpo::value<vector<string>>()->composing(), "P2P nodes to connect to on startup (may specify multiple times)")
("checkpoint,c", bpo::value<vector<string>>()->composing(), "Pairs of [BLOCK_NUM,BLOCK_ID] that should be enforced as checkpoints.")
("shared-file-dir", bpo::value<string>(), "Location of the shared memory file. Defaults to data_dir/blockchain")
("shared-file-size", bpo::value<string>()->default_value("32G"), "Size of the shared memory file. Default: 32G")
("shared-file-size", bpo::value<string>()->default_value("54G"), "Size of the shared memory file. Default: 54G")
("rpc-endpoint", bpo::value<string>()->implicit_value("127.0.0.1:8090"), "Endpoint for websocket RPC to listen on")
("rpc-tls-endpoint", bpo::value<string>()->implicit_value("127.0.0.1:8089"), "Endpoint for TLS websocket RPC to listen on")
("read-forward-rpc", bpo::value<string>(), "Endpoint to forward write API calls to for a read node" )
Expand Down
2 changes: 1 addition & 1 deletion libraries/app/database_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1145,7 +1145,7 @@ void database_api::set_pending_payout( discussion& d )const
vshares = d.net_rshares.value > 0 ? steemit::chain::util::evaluate_reward_curve( d.net_rshares.value, rf.author_reward_curve, rf.content_constant ) : 0;
}
else
vshares = steemit::chain::util::evaluate_reward_curve( d.net_rshares.value > 0 ? d.net_rshares.value : 0 );
vshares = d.net_rshares.value > 0 ? steemit::chain::util::evaluate_reward_curve( d.net_rshares.value ) : 0;

u256 r2 = to256(vshares); //to256(abs_net_rshares);
r2 *= pot.amount.value;
Expand Down
27 changes: 19 additions & 8 deletions libraries/chain/database.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ void database::open( const fc::path& data_dir, const fc::path& shared_mem_dir, u
undo_all();
FC_ASSERT( revision() == head_block_num(), "Chainbase revision does not match head block num",
("rev", revision())("head_block", head_block_num()) );
validate_invariants();
});

if( head_block_num() )
Expand Down Expand Up @@ -1150,7 +1151,8 @@ void database::clear_witness_votes( const account_object& a )
remove(current);
}

if( has_hardfork( STEEMIT_HARDFORK_0_6__104 ) ) // TODO: this check can be removed after hard fork
#warning( "TODO: Remove this check after HF 19" )
if( has_hardfork( STEEMIT_HARDFORK_0_6__104 ) )
modify( a, [&](account_object& acc )
{
acc.witnesses_voted_for = 0;
Expand Down Expand Up @@ -1621,7 +1623,7 @@ void database::process_comment_cashout()
{
fc::microseconds decay_rate;

// TODO: Remove temp fund after HF 19
#warning( "TODO: Remove temp reward fund after HF 19" )
if( rfo.name == STEEMIT_TEMP_LINEAR_REWARD_FUND_NAME || has_hardfork( STEEMIT_HARDFORK_0_19__1051 ) )
decay_rate = STEEMIT_RECENT_RSHARES_DECAY_RATE_HF19;
else
Expand Down Expand Up @@ -3086,7 +3088,7 @@ void database::update_last_irreversible_block()
witness_time_pairs.push_back( std::make_pair( b->data.witness, b->data.timestamp ) );
}

ilog( "Encountered a block num collision due to a fork. Walking the current fork to determine the correct block. block_num:${n}", ("n", log_head_num + 1) ); // TODO: Delete when we know this code works as intended
ilog( "Encountered a block num collision due to a fork. Walking the current fork to determine the correct block. block_num:${n}", ("n", log_head_num + 1) );
ilog( "Colliding blocks produced by witnesses at times: ${w}", ("w", witness_time_pairs) );

auto next = _fork_db.head();
Expand Down Expand Up @@ -3747,8 +3749,8 @@ void database::apply_hardfork( uint32_t hardfork )
case STEEMIT_HARDFORK_0_17:
{
static_assert(
STEEMIT_MAX_VOTED_WITNESSES_HF0 + STEEMIT_MAX_MINER_WITNESSES_HF0 + STEEMIT_MAX_RUNNER_WITNESSES_HF0 == STEEMIT_MAX_WITNESSES,
"HF0 witness counts must add up to STEEMIT_MAX_WITNESSES" );
STEEMIT_MAX_VOTED_WITNESSES_HF0 + STEEMIT_MAX_MINER_WITNESSES_HF0 + STEEMIT_MAX_RUNNER_WITNESSES_HF0 == STEEMIT_MAX_WITNESSES,
"HF0 witness counts must add up to STEEMIT_MAX_WITNESSES" );
static_assert(
STEEMIT_MAX_VOTED_WITNESSES_HF17 + STEEMIT_MAX_MINER_WITNESSES_HF17 + STEEMIT_MAX_RUNNER_WITNESSES_HF17 == STEEMIT_MAX_WITNESSES,
"HF17 witness counts must add up to STEEMIT_MAX_WITNESSES" );
Expand Down Expand Up @@ -3793,7 +3795,7 @@ void database::apply_hardfork( uint32_t hardfork )
// As a shortcut in payout processing, we use the id as an array index.
// The IDs must be assigned this way. The assertion is a dummy check to ensure this happens.
FC_ASSERT( post_rf.id._id == 0 );
FC_ASSERT( linear_rf.id._id == 1 );
FC_ASSERT( linear_rf.id._id == STEEMIT_TEMP_LINEAR_REWARD_FUND_ID );

modify( gpo, [&]( dynamic_global_property_object& g )
{
Expand Down Expand Up @@ -3859,14 +3861,21 @@ void database::apply_hardfork( uint32_t hardfork )
const auto& linear = get< reward_fund_object, by_name >( STEEMIT_TEMP_LINEAR_REWARD_FUND_NAME );
modify( get< reward_fund_object, by_name >( STEEMIT_POST_REWARD_FUND_NAME ), [&]( reward_fund_object &rfo )
{
#warning( "TODO: Replace with constant after HF 19" )
rfo.recent_claims = linear.recent_claims;
rfo.author_reward_curve = curve_id::linear;
rfo.curation_reward_curve = curve_id::square_root;
});

#warning( "TODO: Remove weight conversion after HF 19" )
const auto& cidx = get_index< comment_index, by_cashout_time >();
const auto& vidx = get_index< comment_vote_index, by_comment_voter >();
for( auto c_itr = cidx.begin(); c_itr != cidx.end() && c_itr->cashout_time != fc::time_point_sec::maximum(); ++c_itr )

/*
* Iterator through all comments that have not yet been paid, setting their total vote weight to the sqrt weight
* and update their votes as well.
*/
for( auto c_itr = cidx.begin(); c_itr != cidx.end() && c_itr->cashout_time < fc::time_point_sec::maximum(); ++c_itr )
{
modify( *c_itr, [&]( comment_object& c )
{
Expand All @@ -3882,6 +3891,8 @@ void database::apply_hardfork( uint32_t hardfork )
}
}

#warning( "TODO: Remove if 0 delegation opjects are not created in pre HF19 consensus" )
/* Remove all 0 delegation objects */
vector< const vesting_delegation_object* > to_remove;
const auto& delegation_idx = get_index< vesting_delegation_index, by_id >();
auto delegation_itr = delegation_idx.begin();
Expand Down Expand Up @@ -3945,7 +3956,7 @@ void database::validate_invariants()const
/// verify no witness has too many votes
const auto& witness_idx = get_index< witness_index >().indices();
for( auto itr = witness_idx.begin(); itr != witness_idx.end(); ++itr )
FC_ASSERT( itr->votes < gpo.total_vesting_shares.amount, "", ("itr",*itr) );
FC_ASSERT( itr->votes <= gpo.total_vesting_shares.amount, "", ("itr",*itr) );

for( auto itr = account_idx.begin(); itr != account_idx.end(); ++itr )
{
Expand Down
4 changes: 4 additions & 0 deletions libraries/chain/hardfork.d/0_6.hf
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@

// Fri Jun 24 14:00:00 UTC 2016
// Fri Jun 24 10:00:00 EDT 2016
#ifdef IS_TEST_NET
#define STEEMIT_HARDFORK_0_6_REVERSE_AUCTION_TIME (0)
#else
#define STEEMIT_HARDFORK_0_6_REVERSE_AUCTION_TIME (1467295200-(60*60*24*6))
#endif
#define STEEMIT_HARDFORK_0_6_VERSION hardfork_version( 0, 6 )
#endif
2 changes: 2 additions & 0 deletions libraries/chain/include/steemit/chain/comment_object.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ namespace steemit { namespace chain {
time_point_sec cashout_time; /// 24 hours from the weighted average of vote time
time_point_sec max_cashout_time;
uint64_t total_vote_weight = 0; /// the total weight of voting rewards, used to calculate pro-rata share of curation payouts
#warning( "Remove total_sqrt_vote_weight after HF 19" )
uint64_t total_sqrt_vote_weight = 0; /// Temporary total weight of votes for post hf19 curation reward curve

uint16_t reward_weight = 0;
Expand Down Expand Up @@ -121,6 +122,7 @@ namespace steemit { namespace chain {
account_id_type voter;
comment_id_type comment;
uint64_t weight = 0; ///< defines the score this vote receives, used by vote payout calc. 0 if a negative vote or changed votes.
#warning( "Remove sqrt_weight after HF 19. It is a temporary field" )
uint64_t sqrt_weight = 0; ///< Temporary vote weight for post hf19 curation curve
int64_t rshares = 0; ///< The number of rshares this vote is responsible for
int16_t vote_percent = 0; ///< The percent weight of the vote
Expand Down

This file was deleted.

Loading

0 comments on commit 914c3f9

Please sign in to comment.