0

I created a testnet environment, successfully created the genesis block, however don't see it reflected in the wallet-cli with the correct genesis wallet.

Is there perhaps a unlock time on the genesis block?

unlock time (varint, height, 60 here)
3c

I loaded up a little test blockexplorer and checked that the genesis block was created successfully.

12
  • What method did you use to create the output public key that you put into the genesis block?
    – knaccc
    Commented Jun 26, 2018 at 0:05
  • @knaccc I created a transaction on the Monero Mainnet and used the TX id of that transaction to extract the tx public key and output key + nonce, applied it to the my testnet genesis tx.
    – W. Kadou
    Commented Jun 26, 2018 at 8:22
  • Note that output public keys have the output index as part of their construction, so you can't take the second output from one transaction and use it as the first output of another transaction and expect it to work. Yes there is an unlock time on the genesis block and on all coinbase transactions, which is 60 blocks.
    – knaccc
    Commented Jun 26, 2018 at 10:24
  • Monero Mainnet xmrchain.net/tx/… we can see the Tx public key: 7767aafcde9be00dcfd098715ebcf7f410daebc582fda69d24a28e9d0bc890d1 and the Output key 9b2e4c0281c0b02e7c53291a94d1d0cbff8883f8024f5142ee494ffbbd088071 from the Genesis TX in github.com/monero-project/monero/blob/master/src/… -- I basically did a transaction on Mainnet to my personal wallet address. Found the transaction on blockexplorer and used the Tx public key and output key of my own transaction from the Monero Mainnet in my testnet.
    – W. Kadou
    Commented Jun 26, 2018 at 10:45
  • 1
    It sounds like you've done it right. What you should do is debug the CLI wallet and see what stage it specifically it gets to when it examines the genesis block transaction and then rejects the transaction as being destined for the wallet and decides to ignore it. Then report back here and link us to the line of code in github where it fails
    – knaccc
    Commented Jun 26, 2018 at 19:04

1 Answer 1

1

i had the same problem. The thing is that the wallet does not process the genesis coinbase tx.

To process it, edit the src/wallet/wallet2.cpp after line #2131.

add

if ((m_blockchain.size() == 1) && (start_height == 0)) { cryptonote::block genesis; generate_genesis(genesis); if (m_blockchain[0] == get_block_hash(genesis)) { LOG_PRINT_L2("Processing genesis transaction: " << string_tools::pod_to_hex(get_transaction_hash(genesis.miner_tx))); std::vector o_indices_genesis = {0}; //genesis transaction output process_new_transaction(get_transaction_hash(genesis.miner_tx), genesis.miner_tx, o_indices_genesis, 0, genesis.timestamp, true, false, false, {}); } else { LOG_ERROR("Skip processing of genesis transaction, genesis block hash does not match: " << string_tools::pod_to_hex(get_block_hash(genesis))); } }

reference : gist.github.com/atanmarko/63815fc18a936d8a985a37e64d84b06d

make sure the one-time pub key at the genesis-hex-tx is well generated. if it is so , with this code you should see the reward on your wallet.

if it not so see

Monero Genesis transaction & nonce - clarification

hope this helps you

4
  • You should explain what that code addition does and why you need to add it.
    – cialu
    Commented Dec 28, 2018 at 7:42
  • That code force processing the génesis transacción.
    – jszwako
    Commented Dec 28, 2018 at 11:12
  • and he needs to add it, like i needed, if he wants to see the genesis reward of his monero fork on his wallet.
    – jszwako
    Commented Dec 28, 2018 at 12:13
  • i did exactly the above steps and create keys like this monero.stackexchange.com/questions/1409/… but unfortunately i have compile errors "[ 85%] Building CXX object src/wallet/CMakeFiles/obj_wallet.dir/wallet2.cpp.o monero-gui/monero/src/wallet/wallet2.cpp: In member function ‘void tools::wallet2::process_parsed_blocks(uint64_t, const std::vector<cryptonote::block_complete_entry>&, const std::vector<tools::wallet2::parsed_block>&, uint64_t&, std::map<std::pair<long unsigned int, long unsigned int>, long unsigned int>*)’: monero-gui/monero/src/walle
    – zdrt
    Commented Jun 3, 2019 at 7:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.