bitcore
bitcore copied to clipboard
Bitcore in WSL (window subsystem) can't connect to bitcoin node that install on Window 10
Hi,
I am new to this, I manage to successfully install Bitcore Node to WSL (window subsystem for Linux).
Just in case for those who are using WSL and fail to install Bitcore, here is the installation instruction
git clone https://github.com/bitpay/bitcore.git
cd bitcore
nvm install v8.17.0 (Latest Node got problem with the installation, after downgrade to v8.17.0, installation will be fine)
npm install
npm run node
However when I execute
npm run node
this message was shown in the console
{"message":"2022-04-30 19:57:58.707 GMT+8 | Not connected to peer: 127.0.0.1:8332 | Chain: BTC | Network: testnet","level":"warn"}
here is my bitcore.config.json
{
"bitcoreNode": {
"modules": ["./bitcoin"],
"services": {
"api": {
"wallets": {
"allowCreationBeforeCompleteSync": true
}
}
},
"chains": {
"BTC": {
"testnet": {
"chainSource": "p2p",
"trustedPeers": [
{
"host": "127.0.0.1",
"port": 8332
}
],
"rpc": {
"host": "127.0.0.1",
"port": 8333,
"username": "user",
"password": "pass"
}
}
}
}
}
}
Here is the bitcoin.conf for the bitcoin node that install on window 10 environment
server=1
testnet=1
[test]
rpcuser=user
rpcpassword=pass
rpcallowip=127.0.0.1
bind=127.0.0.1
port=8332
rpcport=8333
rpcthreads=10
Will it be the bitcore that run in the WSL couldn't connect to the bitcoin that run in the window environment? Please advice. Thanks!
I am not a Windows user, but I think WSL uses a virtual machine, so when your browser runs (outside that VM) it's trying to connect to 127.0.0.1, which in that context refers to the system running the browser, not the VM running your bitcoin node in WSL.
To solve this, I think you might need to identify the IP address of your WSL VM and access it directly.
In any case this is probably more of a WSL question than a bitcore issue so I think this issue could be closed.