Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: jscode017 on February 01, 2019, 09:56:12 AM



Title: regtest specific port don't seems to work
Post by: jscode017 on February 01, 2019, 09:56:12 AM
regtest=1 rpcuser=rpc rpcpassword=rpc port=8335 rpcport=8336

this is what I write in my bitcoin.conf (which is in .bitcoin)
after bitcoind -daemon
I type netstat -pant
However instead of getting it listen at port 8335 and 8336, it listen at 18444 18332 (the default)
seems that the port and rpcport do not work
Any help please

ps I'm using ubuntu virtualbox maybe there's something block it?


Title: Re: regtest specific port don't seems to work
Post by: domob on February 01, 2019, 10:20:29 AM
For certain options to take effect on non-mainnet (including port and rpcport), you need to put them into a "[regtest]" section in your config file.

I.e., something like this:

Code:
regtest = 1

[regtest]
port = 8335
rpcport = 8336


Title: Re: regtest specific port don't seems to work
Post by: jscode017 on February 02, 2019, 01:21:21 AM
thanks but still not work
still get
tcp6       0      0 ::1:18332               :::*                    LISTEN      27578/bitcoind  
tcp6       0      0 :::18444                :::*                    LISTEN      27578/bitcoind  
 though i can make it work by typing command bitcoind -daemon -port=8333


Title: Re: regtest specific port don't seems to work
Post by: chameleon123 on February 04, 2019, 03:19:49 PM
thanks but still not work
still get
tcp6       0      0 ::1:18332               :::*                    LISTEN      27578/bitcoind  
tcp6       0      0 :::18444                :::*                    LISTEN      27578/bitcoind  
 though i can make it work by typing command bitcoind -daemon -port=8333

I did the same way but got :

Code:
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 0.0.0.0:8335            0.0.0.0:*               LISTEN      2452/bitcoind      
tcp        0      0 127.0.0.1:8336          0.0.0.0:*               LISTEN      2452/bitcoind      
tcp        0      0 127.0.0.53:53           0.0.0.0:*               LISTEN      -                  
tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN      -                  
tcp        0      0 127.0.0.1:16443         0.0.0.0:*               LISTEN      15741/bitcoind      
tcp        0      0 0.0.0.0:16444           0.0.0.0:*               LISTEN      15741/bitcoind      
tcp6       0      0 :::8335                 :::*                    LISTEN      2452/bitcoind      
tcp6       0      0 ::1:8336                :::*                    LISTEN      2452/bitcoind      
tcp6       0      0 ::1:631                 :::*                    LISTEN      -                  
tcp6       0      0 ::1:16443               :::*                    LISTEN      15741/bitcoind      
tcp6       0      0 :::16444                :::*                    LISTEN      15741/bitcoind    

in my bitcoin.conf :
Code:
dns=0
dnsseed=0
regtest=1
port=8335
rpcport=8336
It worked fine. Which version you're using? Mine is 0.17.1.
I disabled DNS for some reasons but It doesn't play a part here.
By the way, I changed some default port numbers but the two that I set in bitcoin.conf work fine.


Title: Re: regtest specific port don't seems to work
Post by: jscode017 on February 05, 2019, 05:50:16 AM
It seems is the problem of my editor or something
Seems like it just read the eof so do not execute the port and rpcport command


Title: Re: regtest specific port don't seems to work
Post by: darosior on February 05, 2019, 06:19:25 AM
It seems is the problem of my editor or something
Seems like it just read the eof so do not execute the port and rpcport command

Hi,

What is your OS ? Where is located your conf file ?


Title: Re: regtest specific port don't seems to work
Post by: chameleon123 on February 05, 2019, 07:12:38 AM
It seems is the problem of my editor or something
Seems like it just read the eof so do not execute the port and rpcport command

Hi,

What is your OS ? Where is located your conf file ?

I use Ubuntu in virtual box like you. Make sure that your .bitcoin directory is in /home/<os_username>.  Otherwise if it not here specify it with :
Code:
bitcoind -datadir=<data_directory>
For the editor I'm not sure but try it with gedit which is on Ubuntu. There are way better editors but test with it if you think the problem is because of your editor.


Title: Re: regtest specific port don't seems to work
Post by: darosior on February 05, 2019, 10:22:26 AM
It seems is the problem of my editor or something
Seems like it just read the eof so do not execute the port and rpcport command

Hi,

What is your OS ? Where is located your conf file ?

I use Ubuntu in virtual box like you.
???
I haven't seen his PS ^^'.


Title: Re: regtest specific port don't seems to work
Post by: jscode017 on February 06, 2019, 02:05:24 PM
I use getedit too and specify datadir but still get the problem
But thanks for all the helps
Since I could solve this problem by adding command line (i.e -port) I think that is okay now

If I find out why i will post it here
Thanks again  :D