The correct sequence is:
start bitcoind as a daemon:
bitcoind -daemon
Wait untill it's running, if you're unsure wait 5 minutes then look at the debug.log
tail -f ~/.bitcoin/debug.log
press ctrl+c if you're sure bitcoind is running
nbxplorer connects to bitcoind. It builds a database of unspent outputs and lets other services query this database.
nbxlorer needs to be running so btcpayserver can use it's services!
in order to do this, you'll eventually make a service, but for now, open a screen session (it's possible you'll need to install screen first)
screen
within this screen session, start nbxplorer... Without killing nbxplorer, leave your screen session by pressing cltr-a, release ctrl-a, then press the letter d
now, wait another 5 minutes to make sure nbxplorer is properly running, then check if it's listening on port 24445 like we configured
lsof -i :24445
here's what i see when looking at my server:
lsof -i :24445
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
BTCPaySer 5092 root 278u IPv4 18588382 0t0 TCP localhost:41210->localhost:24445 (ESTABLISHED)
BTCPaySer 5092 root 282u IPv4 18587254 0t0 TCP localhost:41220->localhost:24445 (ESTABLISHED)
dotnet 11889 root 156u IPv4 1753666419 0t0 TCP localhost:24445 (LISTEN)
dotnet 11889 root 188u IPv4 18590828 0t0 TCP localhost:24445->localhost:41210 (ESTABLISHED)
dotnet 11889 root 191u IPv4 18587256 0t0 TCP localhost:24445->localhost:41220 (ESTABLISHED)
without starting btcpayserver you won't see these connections, but you should see some output... If you don't get any return, nbxplorer is not listening on the correct port
now, open a second screen session
screen
and run btcpayserver in this screen session
you don't need to do anything with the run.sh bash script. The only thing this script contains is the command you're running right now:
dotnet run --no-launch-profile --no-build -c Release -p ~/source/btcpayserver/BTCPayServer/BTCPayServer.csproj --@
for shutting down, it's exactly the opposite order:
take over the btcpayserver screen by finding out the pid of the 2 screen sessions:
screen -r
then take over the screen session of btcpayserver
screen -r [pid from previous command]
ctrl-c
you can stop this screen session by giving the following command withing the screen session
exit
then stop the nbxplorer in the same way as you stopped btcpayserver
then stop bitcoin daemon by entering
bitcoin-cli stop