diff --git a/src/common/ObserverManager.h b/src/common/ObserverManager.h index 02b59d9f..68ed0e91 100644 --- a/src/common/ObserverManager.h +++ b/src/common/ObserverManager.h @@ -1,9 +1,10 @@ -// Copyright (c) 2012-2013 The Cryptonote developers +// Copyright (c) 2011-2014 The Cryptonote developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #pragma once +#include #include #include diff --git a/src/cryptonote_config.h b/src/cryptonote_config.h index 6035288c..405ef672 100644 --- a/src/cryptonote_config.h +++ b/src/cryptonote_config.h @@ -90,3 +90,5 @@ #define THREAD_STACK_SIZE 5 * 1024 * 1024 +#define GENESIS_COINBASE_TX_HEX "" + diff --git a/src/cryptonote_core/cryptonote_format_utils.cpp b/src/cryptonote_core/cryptonote_format_utils.cpp index a44b060d..e50d7b23 100644 --- a/src/cryptonote_core/cryptonote_format_utils.cpp +++ b/src/cryptonote_core/cryptonote_format_utils.cpp @@ -617,25 +617,30 @@ namespace cryptonote return p; } //--------------------------------------------------------------- + void generate_genesis_tx(transaction& tx) { + account_public_address ac = boost::value_initialized(); + std::vector sz; + construct_miner_tx(0, 0, 0, 0, 0, ac, tx); // zero fee in genesis + blobdata txb = tx_to_blob(tx); + } + + std::string get_genesis_tx_hex() { + transaction tx; + + generate_genesis_tx(tx); + blobdata txb = tx_to_blob(tx); + std::string hex_tx_represent = string_tools::buff_to_hex_nodelimer(txb); + + return hex_tx_represent; + } + bool generateGenesisBlock(block& bl) { //genesis block bl = boost::value_initialized(); - //TODO Uncomment this code block on the first network launch. It will generate and print you genesis block's hash. - //TODO Then you must copy it and put to genesis_coinbase_tx_hex variable - /* - account_public_address ac = boost::value_initialized(); - std::vector sz; - construct_miner_tx(0, 0, 0, 0, 0, ac, bl.miner_tx); // zero fee in genesis - blobdata txb = tx_to_blob(bl.miner_tx); - std::string hex_tx_represent = string_tools::buff_to_hex_nodelimer(txb); - std::cout << "Genesis coinbase tx hex: " << hex_tx_represent << std::endl; - */ - - //hard code coinbase tx in genesis block, because "true" generating tx use random, but genesis should be always the same - //TODO After you obtain hash of the genesis block put it here and recompile sources! - std::string genesis_coinbase_tx_hex = ""; + //hard code coinbase tx in genesis block, because "tru" generating tx use random, but genesis should be always the same + std::string genesis_coinbase_tx_hex = GENESIS_COINBASE_TX_HEX; blobdata tx_bl; string_tools::parse_hexstr_to_binbuff(genesis_coinbase_tx_hex, tx_bl); diff --git a/src/cryptonote_core/cryptonote_format_utils.h b/src/cryptonote_core/cryptonote_format_utils.h index 9477e1a6..c70d920d 100644 --- a/src/cryptonote_core/cryptonote_format_utils.h +++ b/src/cryptonote_core/cryptonote_format_utils.h @@ -81,6 +81,7 @@ namespace cryptonote crypto::hash get_block_longhash(crypto::cn_context &context, const block& b, uint64_t height); bool generateGenesisBlock(block& bl); bool generateTestnetGenesisBlock(block& bl); + std::string get_genesis_tx_hex(); bool parse_and_validate_block_from_blob(const blobdata& b_blob, block& b); bool get_inputs_money_amount(const transaction& tx, uint64_t& money); uint64_t get_outs_money_amount(const transaction& tx); diff --git a/src/daemon/daemon.cpp b/src/daemon/daemon.cpp index 660cb784..d731ada9 100644 --- a/src/daemon/daemon.cpp +++ b/src/daemon/daemon.cpp @@ -38,10 +38,20 @@ namespace const command_line::arg_descriptor arg_console = {"no-console", "Disable daemon console commands"}; const command_line::arg_descriptor arg_testnet_on = {"testnet", "Used to deploy test nets. Checkpoints and hardcoded seeds are ignored, " "network id is changed. Use it with --data-dir flag. The wallet must be launched with --testnet flag.", false}; + const command_line::arg_descriptor arg_print_genesis_tx = {"print-genesis-tx", "Prints genesis' block tx hex to insert it to config and exits"}; } bool command_line_preprocessor(const boost::program_options::variables_map& vm); +void print_genesis_tx_hex() { + std::string tx_hex = cryptonote::get_genesis_tx_hex(); + + std::cout << "Insert this line into your coin configuration file as is: " << std::endl; + std::cout << "#define GENESIS_COINBASE_TX_HEX \"" << tx_hex << "\"" << std::endl; + + return; +} + int main(int argc, char* argv[]) { @@ -69,6 +79,7 @@ int main(int argc, char* argv[]) command_line::add_arg(desc_cmd_sett, arg_log_level); command_line::add_arg(desc_cmd_sett, arg_console); command_line::add_arg(desc_cmd_sett, arg_testnet_on); + command_line::add_arg(desc_cmd_sett, arg_print_genesis_tx); cryptonote::core::init_options(desc_cmd_sett); cryptonote::core_rpc_server::init_options(desc_cmd_sett); @@ -90,6 +101,11 @@ int main(int argc, char* argv[]) return false; } + if (command_line::get_arg(vm, arg_print_genesis_tx)) { + print_genesis_tx_hex(); + return false; + } + std::string data_dir = command_line::get_arg(vm, command_line::arg_data_dir); std::string config = command_line::get_arg(vm, arg_config_file); diff --git a/src/version.h.in b/src/version.h.in index 7812a19d..ae6accfa 100644 --- a/src/version.h.in +++ b/src/version.h.in @@ -1,4 +1,4 @@ #define BUILD_COMMIT_ID "@VERSION@" -#define PROJECT_VERSION "1.0.0" +#define PROJECT_VERSION "1.0.1" #define PROJECT_VERSION_BUILD_NO "1" #define PROJECT_VERSION_LONG PROJECT_VERSION "." PROJECT_VERSION_BUILD_NO "(" BUILD_COMMIT_ID ")" diff --git a/src/wallet/Wallet.cpp b/src/wallet/Wallet.cpp index 15e790cd..984d8156 100644 --- a/src/wallet/Wallet.cpp +++ b/src/wallet/Wallet.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2012-2013 The Cryptonote developers +// Copyright (c) 2011-2014 The Cryptonote developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/wallet/Wallet.h b/src/wallet/Wallet.h index 6ca795d3..cf3e6bf3 100644 --- a/src/wallet/Wallet.h +++ b/src/wallet/Wallet.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012-2013 The Cryptonote developers +// Copyright (c) 2011-2014 The Cryptonote developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/wallet/WalletAsyncContextCounter.cpp b/src/wallet/WalletAsyncContextCounter.cpp index 752933b6..8ec39b45 100644 --- a/src/wallet/WalletAsyncContextCounter.cpp +++ b/src/wallet/WalletAsyncContextCounter.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2012-2013 The Cryptonote developers +// Copyright (c) 2011-2014 The Cryptonote developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/wallet/WalletAsyncContextCounter.h b/src/wallet/WalletAsyncContextCounter.h index c7acd662..322551b3 100644 --- a/src/wallet/WalletAsyncContextCounter.h +++ b/src/wallet/WalletAsyncContextCounter.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012-2013 The Cryptonote developers +// Copyright (c) 2011-2014 The Cryptonote developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/wallet/WalletErrors.cpp b/src/wallet/WalletErrors.cpp index 792c046d..6e3f3756 100644 --- a/src/wallet/WalletErrors.cpp +++ b/src/wallet/WalletErrors.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2012-2013 The Cryptonote developers +// Copyright (c) 2011-2014 The Cryptonote developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/wallet/WalletErrors.h b/src/wallet/WalletErrors.h index e62617f2..2d79f928 100644 --- a/src/wallet/WalletErrors.h +++ b/src/wallet/WalletErrors.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012-2013 The Cryptonote developers +// Copyright (c) 2011-2014 The Cryptonote developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/wallet/WalletEvent.h b/src/wallet/WalletEvent.h index 10bc210a..3e7d51aa 100644 --- a/src/wallet/WalletEvent.h +++ b/src/wallet/WalletEvent.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012-2013 The Cryptonote developers +// Copyright (c) 2011-2014 The Cryptonote developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/wallet/WalletRequest.h b/src/wallet/WalletRequest.h index d3b43df7..c5ae6bff 100644 --- a/src/wallet/WalletRequest.h +++ b/src/wallet/WalletRequest.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012-2013 The Cryptonote developers +// Copyright (c) 2011-2014 The Cryptonote developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/wallet/WalletSendTransactionContext.h b/src/wallet/WalletSendTransactionContext.h index 796d5573..ff117d6c 100644 --- a/src/wallet/WalletSendTransactionContext.h +++ b/src/wallet/WalletSendTransactionContext.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012-2013 The Cryptonote developers +// Copyright (c) 2011-2014 The Cryptonote developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/wallet/WalletSerialization.h b/src/wallet/WalletSerialization.h index 5d8e2a1a..0e970f2e 100644 --- a/src/wallet/WalletSerialization.h +++ b/src/wallet/WalletSerialization.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012-2013 The Cryptonote developers +// Copyright (c) 2011-2014 The Cryptonote developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/wallet/WalletSynchronizationContext.h b/src/wallet/WalletSynchronizationContext.h index 423da494..de4abe85 100644 --- a/src/wallet/WalletSynchronizationContext.h +++ b/src/wallet/WalletSynchronizationContext.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012-2013 The Cryptonote developers +// Copyright (c) 2011-2014 The Cryptonote developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/wallet/WalletSynchronizer.cpp b/src/wallet/WalletSynchronizer.cpp index 9b948156..04be48c6 100644 --- a/src/wallet/WalletSynchronizer.cpp +++ b/src/wallet/WalletSynchronizer.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2012-2013 The Cryptonote developers +// Copyright (c) 2011-2014 The Cryptonote developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/wallet/WalletSynchronizer.h b/src/wallet/WalletSynchronizer.h index c86ee131..8e1e61dd 100644 --- a/src/wallet/WalletSynchronizer.h +++ b/src/wallet/WalletSynchronizer.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012-2013 The Cryptonote developers +// Copyright (c) 2011-2014 The Cryptonote developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/wallet/WalletTransactionSender.cpp b/src/wallet/WalletTransactionSender.cpp index 737a769c..53d3df4f 100644 --- a/src/wallet/WalletTransactionSender.cpp +++ b/src/wallet/WalletTransactionSender.cpp @@ -1,9 +1,7 @@ -/* - * WalletTransactionSender.cpp - * - * Created on: 18 июня 2014 г. - * Author: milo - */ +// Copyright (c) 2011-2014 The Cryptonote developers +// Distributed under the MIT/X11 software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + #include "WalletTransactionSender.h" #include "WalletUtils.h" diff --git a/src/wallet/WalletTransactionSender.h b/src/wallet/WalletTransactionSender.h index 9a51190c..0a51d892 100644 --- a/src/wallet/WalletTransactionSender.h +++ b/src/wallet/WalletTransactionSender.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012-2013 The Cryptonote developers +// Copyright (c) 2011-2014 The Cryptonote developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/wallet/WalletTransferDetails.cpp b/src/wallet/WalletTransferDetails.cpp index 8c05ce8b..36350f9c 100644 --- a/src/wallet/WalletTransferDetails.cpp +++ b/src/wallet/WalletTransferDetails.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2012-2013 The Cryptonote developers +// Copyright (c) 2011-2014 The Cryptonote developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/wallet/WalletTransferDetails.h b/src/wallet/WalletTransferDetails.h index 7dbdae12..5658f1ee 100644 --- a/src/wallet/WalletTransferDetails.h +++ b/src/wallet/WalletTransferDetails.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012-2013 The Cryptonote developers +// Copyright (c) 2011-2014 The Cryptonote developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/wallet/WalletTxSendingState.cpp b/src/wallet/WalletTxSendingState.cpp index fe1fda6c..d371b070 100644 --- a/src/wallet/WalletTxSendingState.cpp +++ b/src/wallet/WalletTxSendingState.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2012-2013 The Cryptonote developers +// Copyright (c) 2011-2014 The Cryptonote developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/wallet/WalletTxSendingState.h b/src/wallet/WalletTxSendingState.h index 65ba7d30..0ea36264 100644 --- a/src/wallet/WalletTxSendingState.h +++ b/src/wallet/WalletTxSendingState.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012-2013 The Cryptonote developers +// Copyright (c) 2011-2014 The Cryptonote developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/wallet/WalletUnconfirmedTransactions.cpp b/src/wallet/WalletUnconfirmedTransactions.cpp index 53a632cb..7fb0d578 100644 --- a/src/wallet/WalletUnconfirmedTransactions.cpp +++ b/src/wallet/WalletUnconfirmedTransactions.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2012-2013 The Cryptonote developers +// Copyright (c) 2011-2014 The Cryptonote developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/wallet/WalletUnconfirmedTransactions.h b/src/wallet/WalletUnconfirmedTransactions.h index bfd99634..7341688f 100644 --- a/src/wallet/WalletUnconfirmedTransactions.h +++ b/src/wallet/WalletUnconfirmedTransactions.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012-2013 The Cryptonote developers +// Copyright (c) 2011-2014 The Cryptonote developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/wallet/WalletUserTransactionsCache.cpp b/src/wallet/WalletUserTransactionsCache.cpp index f0adbc98..989f1c85 100644 --- a/src/wallet/WalletUserTransactionsCache.cpp +++ b/src/wallet/WalletUserTransactionsCache.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2012-2013 The Cryptonote developers +// Copyright (c) 2011-2014 The Cryptonote developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/wallet/WalletUserTransactionsCache.h b/src/wallet/WalletUserTransactionsCache.h index 48971bfd..a21cc869 100644 --- a/src/wallet/WalletUserTransactionsCache.h +++ b/src/wallet/WalletUserTransactionsCache.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012-2013 The Cryptonote developers +// Copyright (c) 2011-2014 The Cryptonote developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/wallet/WalletUtils.h b/src/wallet/WalletUtils.h index 46d57793..4074f609 100644 --- a/src/wallet/WalletUtils.h +++ b/src/wallet/WalletUtils.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012-2013 The Cryptonote developers +// Copyright (c) 2011-2014 The Cryptonote developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php.