oceanprotocol / ocean-node

Apache License 2.0
22 stars 8 forks source link

Missing info: Indexer will not be enabled #630

Open alexcos20 opened 3 weeks ago

alexcos20 commented 3 weeks ago
2024-08-19T08:52:59.018Z warn: CONFIG:   ️ Invalid or missing "UNSAFE_URLS" env variable...
2024-08-19T08:52:59.227Z info: OCEANNODE:       Codebase hash: c4075ecbc67fdb1d1c398e10015ff8f8d98ab95c30c36f5f58d5315055b06b78
2024-08-19T08:52:59.227Z warn: DATABASE:        Property "LOG_DB" is set to "false". This means logs will NOT be saved to database!
2024-08-19T08:52:59.228Z warn: DATABASE:         Typesense not available, falling back to SQLite
2024-08-19T08:52:59.230Z info: DATABASE:        Typesense URL is not valid, falling back to SQLite for nonce database. Other DBs will not be available.
2024-08-19T08:52:59.231Z info: P2P:     Enabling P2P Transports: websockets, tcp
2024-08-19T08:52:59.358Z debug: OCEANNODE:      OCEANNODE:      HTTP port: 8000

As you can see from above, there is no DB_URI and we say that "Property "LOG_DB" is set to "false". This means logs will NOT be saved to database!"

But we should add "Property "LOG_DB" is set to "false". This means indexer module will not be enabled"

paulo-ocean commented 2 weeks ago

I can take this one... There is something weird here... The log message about missing DB_URL & not having Indexer should be done right at startup (on index.js) The message about "LOG_DB" only happens inside the Database() constructor ... so it means we should have a DB URL OR taht we are calling the constructor without a proper DB_URL config check first (probably) the message about "Typesense URL is not valid" is done inside NonceDatabase constructor, where we check for valid DB_URL, as this is the one that can run on SQLLite as fallback