<p>It works with following configuration files (on different machines):</p>
<p><strong>Main PC:</strong></p>
<pre><code>regtest=1  
server=1

[regtest] 
port=18332 
rpcport = 18333  
rpcuser=bitcoinrpc 
rpcpassword=password 
rpcallowip=0.0.0.0/0
</code></pre>
<p><strong>Other Nodes:</strong></p>
<pre><code>regtest=1 
server=1

[regtest]
#edit ip-address and port number according to network config 
connect=192.168.xx.xx:18332
</code></pre>
<p>This way each PC (node) connects to the main computer (so each student only connects to the teacher's PC.) Each student could post his IP-address with a different Port Number in a Teams/Discord channel and add more nodes to the conf file.
I also tested with <em>addnode=x.x.x.x:18332</em> for the second PC and that also works.</p>

CC BY-SA 4.0
2024-04-03T14:25:39.487Z
Cool, I hope your students and you have a blast!
Murch
CC BY-SA 4.0
2024-03-28T10:29:31.340Z
2024-04-03T14:20:43.657Z
2024-04-03T14:20:43.657Z
Bart DV
<p>You could consider using a <a href="https://en.bitcoin.it/wiki/Signet#Custom_Signet" rel="nofollow noreferrer">custom <em>signet</em></a> instead. Other than regtest, it’s not a sandbox environment, but an actual network. I think you should for example not need to change ports for signet. You’d still need a way to get the initial connection to the network, though. A key difference would be that only the signet operator with the signing key can sign new blocks into existence, whereas anyone can generate blocks on regtest, if that is an important point.</p>

CC BY-SA 4.0
2024-03-28T12:41:12.647Z
Thanks for the input. I could try it but first I have to learn about signet though. After googling I've found: "Why run Signet?
You are an Instructor, and want to run a controlled Bitcoin network environment for teaching purposes." -> Should try in that case. Many thanks!
Bart DV
CC BY-SA 4.0
2024-03-28T12:49:44.487Z
I think you might have been looking at the same page already, but trying to find instructions on how to set up a custom signet, I found: https://en.bitcoin.it/wiki/Signet#Custom_Signet
Murch
CC BY-SA 4.0
2024-03-28T13:01:09.900Z
Yes, same page but very challenging for me. I'm not good in terminal windows and the example is a Linux one I see.
Bart DV
CC BY-SA 4.0
2024-03-28T13:20:38.537Z
If you want, you could ask a "How do I set up my own custom signet?" question here on BSE. I was surprised we didn’t have it yet.
Murch
CC BY-SA 4.0
2024-03-28T12:17:10.083Z
2024-03-28T12:49:58.610Z
2024-03-28T12:49:58.610Z
Murch
<p>I'm looking for a way to use Bitcoin Core in Regtest in a WiFi network (educational purposes in classroom).</p>
<p>The goal is that students install Bitcoin Core, activate Regtest, generate coins and send them to each other.</p>
<p>The problem is, in my tests (on two separate laptops), the nodes don't find each other.
When I want to use the console command <em>addnode</em> I assume I have to use an IPv4 address with port number but I can nowhere find the port number that is currently used for each machine.</p>
<p>Also, I don't know what de conf file should contain for this purpose. I hope someone can shed a light on this? Thank you.</p>

CC BY-SA 4.0
2024-03-28T09:03:15.503Z
This [post](https://bitcointalk.org/index.php?topic=3122333.0) from 2018 seems to have a .conf example for what you want to do.
polespinasa
CC BY-SA 4.0
2024-03-28T09:32:28.173Z
Thank you I think it was really useful. In my home network test with 2 laptops, the nodes are "seeing" each other. 
These are the config files I used:

'Main PC:

regtest=1
server=1

[regtest]
port=18332
rpcport = 18333
rpcuser=bitcoinrpc
rpcpassword=password
rpcallowip=0.0.0.0/0

Other Nodes:

regtest=1
server=1

[regtest]
#change port number and rpcport for each machine in the network
port=18443
rpcport = 18444
#edit ip-address and port number according to network config
connect=192.168.xx.xx:18332 '

Generated coins are still immature though.
Bart DV
CC BY-SA 4.0
2024-03-28T09:40:39.797Z
You can use something like `bitcoin-cli generate 101` and be able to spend the first coins
polespinasa
CC BY-SA 4.0
2024-03-28T09:46:19.023Z
Yes, I found out that they become mature after 100 blocks. So it's best to mine 101 blocks directly I guess. When we send tx to each other, I also guess I have to mine a block now and then via generatetoaddress...
Bart DV
<bitcoin-core><network><regtest>
Using Bitcoin Core Regtest in classroom
Bart DV
# Using Bitcoin Core Regtest in classroom

(Asked by: username_0 on 2024-03-28)

I'm looking for a way to use Bitcoin Core in Regtest in a WiFi network (educational purposes in classroom).

The goal is that students install Bitcoin Core, activate Regtest, generate coins and send them to each other.

The problem is, in my tests (on two separate laptops), the nodes don't find each other.
When I want to use the console command *addnode* I assume I have to use an IPv4 address with port number but I can nowhere find the port number that is currently used for each machine.

Also, I don't know what de conf file should contain for this purpose. I hope someone can shed a light on this? Thank you.

**Tags:** bitcoin-core, network, regtest

> **Comments:**
> **username_1**: This [post](https://bitcointalk.org/index.php?topic=3122333.0) from 2018 seems to have a .conf example for what you want to do.  
> **username_0**: Thank you I think it was really useful. In my home network test with 2 laptops, the nodes are "seeing" each other.  These are the config files I used:  'Main PC:  regtest=1 server=1  [regtest] port=18332 rpcport = 18333 rpcuser=bitcoinrpc rpcpassword=password rpcallowip=0.0.0.0/0  Other Nodes:  regtest=1 server=1  [regtest] #change port number and rpcport for each machine in the network port=18443 rpcport = 18444 #edit ip-address and port number according to network config connect=192.168.xx.xx:18332 '  Generated coins are still immature though.  
> **username_1**: You can use something like `bitcoin-cli generate 101` and be able to spend the first coins  
> **username_0**: Yes, I found out that they become mature after 100 blocks. So it's best to mine 101 blocks directly I guess. When we send tx to each other, I also guess I have to mine a block now and then via generatetoaddress...  

---

## 2 answers

### Answer by username_0 on 2024-03-28. Score: 2

It works with following configuration files (on different machines):
Main PC:
regtest=1  
server=1

[regtest] 
port=18332 
rpcport = 18333  
rpcuser=bitcoinrpc 
rpcpassword=password 
rpcallowip=0.0.0.0/0

Other Nodes:
regtest=1 
server=1

[regtest]
#edit ip-address and port number according to network config 
connect=192.168.xx.xx:18332

This way each PC (node) connects to the main computer (so each student only connects to the teacher's PC.) Each student could post his IP-address with a different Port Number in a Teams/Discord channel and add more nodes to the conf file.
I also tested with addnode=x.x.x.x:18332 for the second PC and that also works.

> **Comments:**
> **username_2**: Cool, I hope your students and you have a blast!  

---

### Answer by username_2 on 2024-03-28. Score: 2

You could consider using a [custom *signet*](https://en.bitcoin.it/wiki/Signet#Custom_Signet) instead. Other than regtest, it’s not a sandbox environment, but an actual network. I think you should for example not need to change ports for signet. You’d still need a way to get the initial connection to the network, though. A key difference would be that only the signet operator with the signing key can sign new blocks into existence, whereas anyone can generate blocks on regtest, if that is an important point.

> **Comments:**
> **username_0**: Thanks for the input. I could try it but first I have to learn about signet though. After googling I've found: "Why run Signet? You are an Instructor, and want to run a controlled Bitcoin network environment for teaching purposes." -> Should try in that case. Many thanks!  
> **username_2**: I think you might have been looking at the same page already, but trying to find instructions on how to set up a custom signet, I found: https://en.bitcoin.it/wiki/Signet#Custom_Signet  
> **username_0**: Yes, same page but very challenging for me. I'm not good in terminal windows and the example is a Linux one I see.  
> **username_2**: If you want, you could ask a "How do I set up my own custom signet?" question here on BSE. I was surprised we didn’t have it yet.  

---

