SLPDB
SLPDB copied to clipboard
`/?useUnifiedTopology=true` should be in db_url!
Line 37 of config.ts can be set to
url: process.env.db_url ? process.env.db_url : 'mongodb://127.0.0.1:27017/?useUnifiedTopology=true',
Update: now (passed block# 727k) I'm trying equivalent of:
url: process.env.db_url ? process.env.db_url : 'mongodb://127.0.0.1:27017/?useNewUrlParser=true&useUnifiedTopology=true&connectTimeoutMS=3600000',
i.e. my db_url is mongodb://tinos.ml:27017/?useNewUrlParser=true&useUnifiedTopology=true&connectTimeoutMS=3600000
.
connectTimeout of 1 hr could work, but there's another timeout which occurred when I was asleep.
Without useUnifiedTopology=true
I keep getting warning:
[INFO] gRPC: getBlockchainInfo
(node:2224) [MONGODB DRIVER] Warning: Current Server Discovery and Monitoring engine is deprecated, and will be removed in a future version. To use the new Server Discover and Monitoring engine, pass option { useUnifiedTopology: true } to the MongoClient constructor.
(Use `node --trace-warnings ...` to show where the warning was created)
As of block 726303 in my syncing process I've been getting lots of unexpected MongoDB timeouts & I'm hoping this solves the problem, but maybe not. I might have to pursue another update. Update: I still got another timeout, but now I'm trying
mongodb://tinos.ml:27017/?useUnifiedTopology=true&connectTimeoutMS=3000000
Default connectTimeoutMS
is only 10000
, however I suspect 10 seconds isn't long enough. 360000
would've been a more elegant choice, to match the socketTimeoutMS
default.
I'm aware db.ts line 22 already specifies useUnifiedTopology
, which is why it took me so long to figure out the url!
Today I'm trying WSL2 for the 1st time, so I've learned to use nano
, or else it's a lot more effort to set up VcXsrv & GUI. WSL1 maybe not as fast for some reason, & I've used KDiskMark to verify WSL2 is faster (SSD speed) than Hyper-V (which itself is much faster than VirtualBox). In WSL2 it's 172.29.160.1
, or in my case tinos.ml
, instead of 127.0.0.1
(it took me ages to realize mongod.exe needs to bind to a different IP, e.g. by restarting, & Windows Firewall is problematic too). Btw I still like VBox for testing, but not doing all the work.
All these WSL technicalities are relevant because the fountainhead-core
module doesn't work in Windows due to a ./
cmd error.