09:24:57 Hello everyone. As I'm trying to run a local for-developers in-docker monero network, I start two nodes in --regtest mode. When I make them exclusive p2p nodes for each other, one of them says "genesis block mismatch" in the logs: 09:24:58 2024-01-17 08:14:12.500 [RPC0] ERROR net.p2p src/cryptonote_core/blockchain.cpp:2436 Client sent wrong NOTIFY_REQUEST_CHAIN: genesis block mismatch: 09:24:58 2024-01-17 08:14:12.501 [RPC0] ERROR net.p2p src/cryptonote_core/blockchain.cpp:2436 id: <48ca7cd3c8de5b6a4d53d2861fbdaedca141553559f9be9520068053cda8430b>, 09:24:59 2024-01-17 08:14:12.503 [RPC0] ERROR net.p2p src/cryptonote_core/blockchain.cpp:2436 expected: <418015bb9ae982a1975da7d79277c2705727a56894ba0fb246adaabb1f4632e3>, 09:24:59 I can see that one of the block hash it mentions is for the testnet, but the other one is for the mainnet. I'm not sure why mainnet genesis block pops up here at all. 09:59:25 regtest is based off mainnet. 10:00:07 That is, it does not have its own genesis block, etc. 11:12:15 That's interesting. In the Monero codebase, I can see: 11:12:15 mainnet_genesis_hex = "418015bb9ae982a1975da7d79277c2705727a56894ba0fb246adaabb1f4632e3" 11:12:16 and then get_info() returns "top_block_hash":"418015bb9ae982a1975da7d79277c2705727a56894ba0fb246adaabb1f4632e3" 11:12:16 So now the question is, where does "genesis block mismatch" error come from when running two regtest nodes? 11:18:19 A related issue is why I went to run two nodes instead of one, is that when I run only one node and try to generateblocks, it returns status="BUSY" instead of "OK". Then I found someone with a similar problem who worked around it by running two nodes, details here: https://monero.stackexchange.com/a/13370/16802 11:18:20 That's what I'm trying to do - I just need a working generateblocks(). 13:22:14 Run with --offline, don't run with --testnet, don't connect to testnet nodes. 13:23:08 When not offline, a node will want to peer with the network before allowing mining. This is to prevent wastefully mining on presumably bullshit data. 13:24:21 Tangentially, I also usually run with --fixed-difficulty 1, to bypass waiting for blocks. 13:36:10 m-relay: So, that is exactly what I am doing, the command for my supervisord service is: 13:36:10 `monerod --non-interactive --regtest --log-file=/monero/logs/monerod0.log --config-file=/bitmonero.daemon.conf -p2p-bind-ip=127.0.0.1 --p2p-bind-port=28080 --add-exclusive-node=127.0.0.1:28081 --rpc-bind-port=18550 --data-dir=/monero/data0` 13:36:11 And then the conf file is the following (it does have the offline configuration): 13:36:11 ``` 13:36:12 # Documentation and examples: 13:36:12 # https://monerodocs.org/interacting/monero-config-file/ 13:36:13 regtest=1 13:36:13 keep-fakechain=1 # keep the regtest blockchain, do not remove it after restarting the daemon 13:36:14 no-sync=1 13:36:14 offline=1 # ensures that the node does not connect to the main network and learn of its latest chaintip 13:36:15 fixed-difficulty=1 # keeps the difficulty constant, allowing a large number of blocks to be generated quickly 13:36:15 # Default is 0 = minimal logging; max is 4 - detailed tracing. 13:36:16 log-level=4 13:36:16 max-connections-per-ip=5 13:36:17 #data-dir=/monero/data 13:36:17 # RPC open node 13:36:18 rpc-bind-ip=0.0.0.0 13:36:18 # rpc-bind-port=18551 13:36:21 please use paste.debian.net 13:39:12 So, that is exactly what I am doing, the command for my supervisord service is: `monerod --non-interactive --regtest --log-file=/monero/logs/monerod0.log --config-file=/bitmonero.daemon.conf -p2p-bind-ip=127.0.0.1 --p2p-bind-port=28080 --add-exclusive-node=127.0.0.1:28081 --rpc-bind-port=18550 --data-dir=/monero/data0` 13:39:12 And then the conf file is the following (it does have the offline configuration): https://paste.debian.net/1304398 13:43:07 I'd remove the --add-exclusive-node, not needed for you (since offline) and there's always a chance you're hitting a testnet node there. Log level 4 is pretty violent too. It's part of the reason why I added log categories. 13:43:37 With those logs, you should also see where it's pulling that testnet genesis block from. Though you'll be swimming in log spam. 13:44:28 Only set log lever 4 in an attempt to understand what is going on. At the end of the day, can I successfully generate blocks while running only a single regtest node, or do I need a network of two? 13:45:03 Either works. I routinely use generateblocks on offline nodes. 13:45:42 And the functional tests do so on networked ones. 13:48:43 okay, to exclude possible conflicts between the command line arguments and the config file, I removed the config file and put all options in command line. Does this look right / similar to what you have for your node for which you routinely generate blocks? 13:48:44 `command=monerod --non-interactive --regtest --keep-fakechain --no-sync --offline --log-level=4 --log-file=/monero/logs/monerod.log --rpc-bind-port=18551 --data-dir=/monero/data --rpc-bind-ip=0.0.0.0 --confirm-external-bind=1 --restricted-rpc=0 --no-igd --hide-my-port --rpc-login=monero:monero --disable-rpc-ban --db-sync-mode=safe --no-zmq=1` 13:50:05 I do not use --non-interactive (unlikely to make a difference though), nor no-sync, not restricted-rpc, nor hide-my-port, nor rpc login, nor disable-rpc-ban, nor db-sync-node. 13:50:29 I do not use config files either. But, if you want to try this, it should work: 13:50:49 monerod --regtest --offline --fixed-difficulty 1 --data-dir /tmp/monerod-tmp 13:50:59 * moneromooo tries 13:53:05 Yes, works. 13:53:26 >>> daemon.generateblocks('TF1MMEY5v2dN49XKNCKCdBqmTMM6GdZZA5UBbDgTewaUd3c2jDazN5yKrG1BBHX3UyPqKD9hrh3DpPTDmWiCmsuRpePT1MTaPxm', 1) 13:53:29 {u'status': u'OK', u'untrusted': False, u'blocks': [u'59700fd0ee8c41127dff75e468cff4701a84881cf584cec458c601fe92617f60'], u'height': 1} 13:53:33 (that's the python RPC console) 13:54:13 (very useful for easily calling RPC on monerod, recommended) 13:54:49 (run with: utils/python-rpc/console RPCPORTGOESHERE) 13:55:01 thanks will give it a try now; I have to call it from the code since it's part of a big project that I'm integrating with Monero. 13:55:02 I remember adding no-sync because my node was actively downloading mainnet blockchain after starting, and I wanted to stop it. 13:55:07 (or run with: utils/python-rpc/console RPCPORTGOESHERE WALLETPORTGOESHERE if you want to run wallet and node RPC at once) 13:55:27 --offline will moot this. 14:26:27 Following your hints, I ran a few test and found out the issue! The `--no-sync` causes generateblocks to return status: BUSY 14:34:12 duno if anyone here is interested. my monerodirect domains expire in 5 days and I will not be renewing them. 14:37:40 Thanks. Might be worth filing a bug, I don't see a use for that behaviour, maybe it wasn't intended. 14:46:56 Now that I can generate blocks, could you clarify one more thing please. Do I use mainnet addresses or testnet addresses with this regtest blockchain? 14:50:55 Mainnet. 15:01:06 Thanks for your help. Filed an issue in Monero repo too. 17:28:43 Do the core_proxy tests actually test anything useful since we have the core_tests ? 17:29:08 It looks like it just spins up a p2p instance with a fake core, does nothing, then turns it off 21:12:27 I never worked out what this was for.