0

I am trying to run a private Bitcoin network for testing. I tried to run a RegTest network, but I need the addresses to be in the format of the ainnet. Can I configure the RegTest to run with Mainnet addresses?

Thanks!

6
  • Why do you "need" to do this? Mixing up addresses from different networks is a really bad idea. They have distinct formatting for a reason. – pinhead Apr 27 '20 at 13:43
  • I want to test a product that is interaction with the node. I have no way to change the code of this product, so I cant make it work with the testnet addresses. And I prefer not to spent hundreds of dollars on tests and fees :( – Danny Cohen Apr 27 '20 at 15:16
  • Well I suppose you could run bitcoin in mainnet mode, but prevent it from actually finding any peers except local nodes you control. You should be able to generate blocks at the low difficulty of the genesis block and send transactions. You would need to be responsible for the keys and addresses you use and make absolutely certain that no one loses any real money. – pinhead Apr 27 '20 at 15:22
  • Are you getting addresses from Core or using Core RPCs that take addresses (e.g. sendtoaddress)? – Andrew Chow Apr 27 '20 at 16:15
  • I am using the Core RPC only. I am not using the built in wallet – Danny Cohen Apr 27 '20 at 16:53
1

Solved it!

I downloaded the bitcoin core source code, changed the regtest node address parameters to be like the mainnet in the file src/chainparams.cpp.

Then compiled it, run the node on regtest and it worked like magic!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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