Jianping Wu
6 years ago
12 changed files with 348 additions and 137 deletions
@ -0,0 +1,113 @@
@@ -0,0 +1,113 @@
|
||||
# =========================================================================== |
||||
# https://www.gnu.org/software/autoconf-archive/ax_boost_date_time.html |
||||
# =========================================================================== |
||||
# |
||||
# SYNOPSIS |
||||
# |
||||
# AX_BOOST_DATE_TIME |
||||
# |
||||
# DESCRIPTION |
||||
# |
||||
# Test for Date_Time library from the Boost C++ libraries. The macro |
||||
# requires a preceding call to AX_BOOST_BASE. Further documentation is |
||||
# available at <http://randspringer.de/boost/index.html>. |
||||
# |
||||
# This macro calls: |
||||
# |
||||
# AC_SUBST(BOOST_DATE_TIME_LIB) |
||||
# |
||||
# And sets: |
||||
# |
||||
# HAVE_BOOST_DATE_TIME |
||||
# |
||||
# LICENSE |
||||
# |
||||
# Copyright (c) 2008 Thomas Porschberg <thomas@randspringer.de> |
||||
# Copyright (c) 2008 Michael Tindal |
||||
# |
||||
# Copying and distribution of this file, with or without modification, are |
||||
# permitted in any medium without royalty provided the copyright notice |
||||
# and this notice are preserved. This file is offered as-is, without any |
||||
# warranty. |
||||
|
||||
#serial 22 |
||||
|
||||
AC_DEFUN([AX_BOOST_DATE_TIME], |
||||
[ |
||||
AC_ARG_WITH([boost-date-time], |
||||
AS_HELP_STRING([--with-boost-date-time@<:@=special-lib@:>@], |
||||
[use the Date_Time library from boost - it is possible to specify a certain library for the linker |
||||
e.g. --with-boost-date-time=boost_date_time-gcc-mt-d-1_33_1 ]), |
||||
[ |
||||
if test "$withval" = "no"; then |
||||
want_boost="no" |
||||
elif test "$withval" = "yes"; then |
||||
want_boost="yes" |
||||
ax_boost_user_date_time_lib="" |
||||
else |
||||
want_boost="yes" |
||||
ax_boost_user_date_time_lib="$withval" |
||||
fi |
||||
], |
||||
[want_boost="yes"] |
||||
) |
||||
|
||||
if test "x$want_boost" = "xyes"; then |
||||
AC_REQUIRE([AC_PROG_CC]) |
||||
CPPFLAGS_SAVED="$CPPFLAGS" |
||||
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" |
||||
export CPPFLAGS |
||||
|
||||
LDFLAGS_SAVED="$LDFLAGS" |
||||
LDFLAGS="$LDFLAGS $BOOST_LDFLAGS" |
||||
export LDFLAGS |
||||
|
||||
AC_CACHE_CHECK(whether the Boost::Date_Time library is available, |
||||
ax_cv_boost_date_time, |
||||
[AC_LANG_PUSH([C++]) |
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include <boost/date_time/gregorian/gregorian_types.hpp>]], |
||||
[[using namespace boost::gregorian; date d(2002,Jan,10); |
||||
return 0; |
||||
]])], |
||||
ax_cv_boost_date_time=yes, ax_cv_boost_date_time=no) |
||||
AC_LANG_POP([C++]) |
||||
]) |
||||
if test "x$ax_cv_boost_date_time" = "xyes"; then |
||||
AC_DEFINE(HAVE_BOOST_DATE_TIME,,[define if the Boost::Date_Time library is available]) |
||||
BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'` |
||||
if test "x$ax_boost_user_date_time_lib" = "x"; then |
||||
for libextension in `ls $BOOSTLIBDIR/libboost_date_time*.so* $BOOSTLIBDIR/libboost_date_time*.dylib* $BOOSTLIBDIR/libboost_date_time*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_date_time.*\)\.so.*$;\1;' -e 's;^lib\(boost_date_time.*\)\.dylib.*$;\1;' -e 's;^lib\(boost_date_time.*\)\.a*$;\1;'` ; do |
||||
ax_lib=${libextension} |
||||
AC_CHECK_LIB($ax_lib, exit, |
||||
[BOOST_DATE_TIME_LIB="-l$ax_lib"; AC_SUBST(BOOST_DATE_TIME_LIB) link_date_time="yes"; break], |
||||
[link_date_time="no"]) |
||||
done |
||||
if test "x$link_date_time" != "xyes"; then |
||||
for libextension in `ls $BOOSTLIBDIR/boost_date_time*.dll* $BOOSTLIBDIR/boost_date_time*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_date_time.*\)\.dll.*$;\1;' -e 's;^\(boost_date_time.*\)\.a.*$;\1;'` ; do |
||||
ax_lib=${libextension} |
||||
AC_CHECK_LIB($ax_lib, exit, |
||||
[BOOST_DATE_TIME_LIB="-l$ax_lib"; AC_SUBST(BOOST_DATE_TIME_LIB) link_date_time="yes"; break], |
||||
[link_date_time="no"]) |
||||
done |
||||
fi |
||||
|
||||
else |
||||
for ax_lib in $ax_boost_user_date_time_lib boost_date_time-$ax_boost_user_date_time_lib; do |
||||
AC_CHECK_LIB($ax_lib, main, |
||||
[BOOST_DATE_TIME_LIB="-l$ax_lib"; AC_SUBST(BOOST_DATE_TIME_LIB) link_date_time="yes"; break], |
||||
[link_date_time="no"]) |
||||
done |
||||
|
||||
fi |
||||
if test "x$ax_lib" = "x"; then |
||||
AC_MSG_ERROR(Could not find a version of the library!) |
||||
fi |
||||
if test "x$link_date_time" != "xyes"; then |
||||
AC_MSG_ERROR(Could not link against $ax_lib !) |
||||
fi |
||||
fi |
||||
|
||||
CPPFLAGS="$CPPFLAGS_SAVED" |
||||
LDFLAGS="$LDFLAGS_SAVED" |
||||
fi |
||||
]) |
@ -1,16 +1,140 @@
@@ -1,16 +1,140 @@
|
||||
// Copyright (c) 2014, The Monero Project
|
||||
//
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without modification, are
|
||||
// permitted provided that the following conditions are met:
|
||||
//
|
||||
// 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
// conditions and the following disclaimer.
|
||||
//
|
||||
// 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
// of conditions and the following disclaimer in the documentation and/or other
|
||||
// materials provided with the distribution.
|
||||
//
|
||||
// 3. Neither the name of the copyright holder nor the names of its contributors may be
|
||||
// used to endorse or promote products derived from this software without specific
|
||||
// prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
||||
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
|
||||
// THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
|
||||
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers
|
||||
|
||||
#pragma once |
||||
|
||||
#include <string> |
||||
#include <boost/uuid/uuid.hpp> |
||||
|
||||
#define CRYPTONOTE_MAX_BLOCK_NUMBER 500000000 |
||||
#define CRYPTONOTE_MAX_BLOCK_SIZE 500000000 // block header blob limit, never used!
|
||||
#define CRYPTONOTE_GETBLOCKTEMPLATE_MAX_BLOCK_SIZE 196608 //size of block (bytes) that is the maximum that miners will produce
|
||||
#define CRYPTONOTE_MAX_TX_SIZE 1000000000 |
||||
#define CRYPTONOTE_PUBLIC_ADDRESS_TEXTBLOB_VER 0 |
||||
#define CURRENT_TRANSACTION_VERSION 2 |
||||
#define CRYPTONOTE_MINED_MONEY_UNLOCK_WINDOW 60 |
||||
#define CURRENT_TRANSACTION_VERSION 1 |
||||
#define CURRENT_BLOCK_MAJOR_VERSION 1 |
||||
#define CURRENT_BLOCK_MINOR_VERSION 0 |
||||
#define CRYPTONOTE_BLOCK_FUTURE_TIME_LIMIT 60*60*2 |
||||
|
||||
#define BLOCK_MAJOR_VERSION_1 1 |
||||
#define BLOCK_MAJOR_VERSION_2 3 |
||||
|
||||
#define COIN ((uint64_t)100000000) // pow(10, 8)
|
||||
#define DEFAULT_FEE ((uint64_t)1000000) // pow(10, 6)
|
||||
#define BLOCKCHAIN_TIMESTAMP_CHECK_WINDOW 60 |
||||
|
||||
// MONEY_SUPPLY - total number coins to be generated
|
||||
#define MONEY_SUPPLY ((uint64_t)(-1)) |
||||
#define EMISSION_SPEED_FACTOR (20) |
||||
|
||||
#define CRYPTONOTE_MINED_MONEY_UNLOCK_WINDOW 60 |
||||
#define CRYPTONOTE_REWARD_BLOCKS_WINDOW 100 |
||||
#define CRYPTONOTE_BLOCK_GRANTED_FULL_REWARD_ZONE 20000 //size of block (bytes) after which reward for block calculated using block size
|
||||
#define CRYPTONOTE_COINBASE_BLOB_RESERVED_SIZE 600 |
||||
#define CRYPTONOTE_DISPLAY_DECIMAL_POINT 12 |
||||
// COIN - number of smallest units in one coin
|
||||
#define COIN ((uint64_t)1000000000000) // pow(10, 12)
|
||||
#define DEFAULT_FEE ((uint64_t)100000000000) // 5 * pow(10, 11)
|
||||
|
||||
|
||||
#define ORPHANED_BLOCKS_MAX_COUNT 100 |
||||
|
||||
|
||||
#define DIFFICULTY_TARGET 60 // seconds
|
||||
#define DIFFICULTY_WINDOW 720 // blocks
|
||||
#define DIFFICULTY_LAG 15 // !!!
|
||||
#define DIFFICULTY_CUT 60 // timestamps to cut after sorting
|
||||
#define DIFFICULTY_BLOCKS_COUNT DIFFICULTY_WINDOW + DIFFICULTY_LAG |
||||
|
||||
|
||||
#define CRYPTONOTE_LOCKED_TX_ALLOWED_DELTA_SECONDS DIFFICULTY_TARGET * CRYPTONOTE_LOCKED_TX_ALLOWED_DELTA_BLOCKS |
||||
#define CRYPTONOTE_LOCKED_TX_ALLOWED_DELTA_BLOCKS 1 |
||||
|
||||
|
||||
#define DIFFICULTY_BLOCKS_ESTIMATE_TIMESPAN DIFFICULTY_TARGET //just alias
|
||||
|
||||
|
||||
#define BLOCKS_IDS_SYNCHRONIZING_DEFAULT_COUNT 10000 //by default, blocks ids count in synchronizing
|
||||
#define BLOCKS_SYNCHRONIZING_DEFAULT_COUNT 200 //by default, blocks count in blocks downloading
|
||||
#define CRYPTONOTE_PROTOCOL_HOP_RELAX_COUNT 3 //value of hop, after which we use only announce of new block
|
||||
|
||||
#define CRYPTONOTE_MEMPOOL_TX_LIVETIME 86400 //seconds, one day
|
||||
#define CRYPTONOTE_MEMPOOL_TX_FROM_ALT_BLOCK_LIVETIME 604800 //seconds, one week
|
||||
|
||||
#define COMMAND_RPC_GET_BLOCKS_FAST_MAX_COUNT 1000 |
||||
|
||||
#define P2P_LOCAL_WHITE_PEERLIST_LIMIT 1000 |
||||
#define P2P_LOCAL_GRAY_PEERLIST_LIMIT 5000 |
||||
|
||||
#define P2P_DEFAULT_CONNECTIONS_COUNT 12 |
||||
#define P2P_DEFAULT_HANDSHAKE_INTERVAL 60 //secondes
|
||||
#define P2P_DEFAULT_PACKET_MAX_SIZE 50000000 //50000000 bytes maximum packet size
|
||||
#define P2P_DEFAULT_PEERS_IN_HANDSHAKE 250 |
||||
#define P2P_DEFAULT_CONNECTION_TIMEOUT 5000 //5 seconds
|
||||
#define P2P_DEFAULT_PING_CONNECTION_TIMEOUT 2000 //2 seconds
|
||||
#define P2P_DEFAULT_INVOKE_TIMEOUT 60*2*1000 //2 minutes
|
||||
#define P2P_DEFAULT_HANDSHAKE_INVOKE_TIMEOUT 5000 //5 seconds
|
||||
#define P2P_DEFAULT_WHITELIST_CONNECTIONS_PERCENT 70 |
||||
|
||||
#define ALLOW_DEBUG_COMMANDS |
||||
|
||||
#define CRYPTONOTE_NAME "bitmonero" |
||||
#define CRYPTONOTE_POOLDATA_FILENAME "poolstate.bin" |
||||
#define CRYPTONOTE_BLOCKCHAINDATA_FILENAME "blockchain.bin" |
||||
#define CRYPTONOTE_BLOCKCHAINDATA_TEMP_FILENAME "blockchain.bin.tmp" |
||||
#define P2P_NET_DATA_FILENAME "p2pstate.bin" |
||||
#define MINER_CONFIG_FILE_NAME "miner_conf.json" |
||||
|
||||
#define THREAD_STACK_SIZE 5 * 1024 * 1024 |
||||
|
||||
// New constants are intended to go here
|
||||
namespace config |
||||
{ |
||||
uint64_t const DEFAULT_FEE_ATOMIC_XMR_PER_KB = 500; // Just a placeholder! Change me!
|
||||
uint8_t const FEE_CALCULATION_MAX_RETRIES = 10; |
||||
uint64_t const DEFAULT_DUST_THRESHOLD = 5000000000; // 5 * 10^9
|
||||
std::string const P2P_REMOTE_DEBUG_TRUSTED_PUB_KEY = "0000000000000000000000000000000000000000000000000000000000000000"; |
||||
|
||||
uint64_t const CRYPTONOTE_PUBLIC_ADDRESS_BASE58_PREFIX = 18; |
||||
uint16_t const P2P_DEFAULT_PORT = 18080; |
||||
uint16_t const RPC_DEFAULT_PORT = 18081; |
||||
boost::uuids::uuid const NETWORK_ID = { { |
||||
0x12 ,0x30, 0xF1, 0x71 , 0x61, 0x04 , 0x41, 0x61, 0x17, 0x31, 0x00, 0x82, 0x16, 0xA1, 0xA1, 0x10 |
||||
} }; // Bender's nightmare
|
||||
std::string const GENESIS_TX = "013c01ff0001ffffffffffff03029b2e4c0281c0b02e7c53291a94d1d0cbff8883f8024f5142ee494ffbbd08807121017767aafcde9be00dcfd098715ebcf7f410daebc582fda69d24a28e9d0bc890d1"; |
||||
uint32_t const GENESIS_NONCE = 10000; |
||||
|
||||
namespace testnet |
||||
{ |
||||
uint64_t const CRYPTONOTE_PUBLIC_ADDRESS_BASE58_PREFIX = 53; |
||||
uint16_t const P2P_DEFAULT_PORT = 28080; |
||||
uint16_t const RPC_DEFAULT_PORT = 28081; |
||||
boost::uuids::uuid const NETWORK_ID = { { |
||||
0x12 ,0x30, 0xF1, 0x71 , 0x61, 0x04 , 0x41, 0x61, 0x17, 0x31, 0x00, 0x82, 0x16, 0xA1, 0xA1, 0x11 |
||||
} }; // Bender's daydream
|
||||
std::string const GENESIS_TX = "013c01ff0001ffffffffffff0f029b2e4c0281c0b02e7c53291a94d1d0cbff8883f8024f5142ee494ffbbd0880712101168d0c4ca86fb55a4cf6a36d31431be1c53a3bd7411bb24e8832410289fa6f3b"; |
||||
uint32_t const GENESIS_NONCE = 10001; |
||||
} |
||||
} |
Loading…
Reference in new issue