ChluNetwork / chlu-ipfs-support

Support libs to talk to IPFS
MIT License
1 stars 1 forks source link

getDID waitUntilPresent=true does not seem to work right on the deployed marketplace #129

Open fazo96 opened 6 years ago

fazo96 commented 6 years ago
69|chlu-ma | [DEBUG][Thu Aug 23 2018 14:31:00 GMT+0000 (UTC)] Verifying signature by did:chlu:GhjHnwijZRXBE8k3jzL87TnvJF8nb928ghErexx92NPc on QmYpKcvmMhbvzr8mdmzR7oEocw98AYSpUsjHxMKBTKGdwf: 787231131D86986BB10B7C81B256BCC222A1667EEA29BB62D9F343046FB398A9301347A36096F2A6FAF7D9DB92D4DDA2EC34888318097F42497E9B21E82DCE09
69|chlu-ma | [DEBUG][Thu Aug 23 2018 14:31:00 GMT+0000 (UTC)] GetDID did:chlu:GhjHnwijZRXBE8k3jzL87TnvJF8nb928ghErexx92NPc => ...
69|chlu-ma | [DEBUG][Thu Aug 23 2018 14:31:00 GMT+0000 (UTC)] GetDID did:chlu:GhjHnwijZRXBE8k3jzL87TnvJF8nb928ghErexx92NPc: calling OrbitDB , Waiting until present
69|chlu-ma | [INFO][Thu Aug 23 2018 14:31:00 GMT+0000 (UTC)] getDID (OrbitDB) did:chlu:GhjHnwijZRXBE8k3jzL87TnvJF8nb928ghErexx92NPc => ...
69|chlu-ma | [DEBUG][Thu Aug 23 2018 14:31:00 GMT+0000 (UTC)] [SQL] Executing (default): SELECT "id", "publicDidDocument", "didDocumentMultihash", "previousVersions", "chluNetwork", "createdAt", "updatedAt" FROM "dids" AS "did" WHERE "did"."chluNetwork" = 'staging' AND ("did"."publicDidDocument"#>>'{id}') = 'did:chlu:GhjHnwijZRXBE8k3jzL87TnvJF8nb928ghErexx92NPc' LIMIT 1; [object Object]
69|chlu-ma | [INFO][Thu Aug 23 2018 14:31:00 GMT+0000 (UTC)] getDID did:chlu:GhjHnwijZRXBE8k3jzL87TnvJF8nb928ghErexx92NPc waiting (not in OrbitDB)...
69|chlu-ma | [DEBUG][Thu Aug 23 2018 14:31:08 GMT+0000 (UTC)] Handling PubSub message from QmUiC2cxyYYpSaE64Fd6XV7H44AUWsLMTnvbg81TWiFzcj: {"type":"REPLICATED","address":"/orbitdb/QmVpUTptT58zmz56Nkm8uHveVjNot1SGVw8D1GUZKMTkZF/chlu-staging"}
69|chlu-ma | [DEBUG][Thu Aug 23 2018 14:31:08 GMT+0000 (UTC)] Handling PubSub message from QmUiC2cxyYYpSaE64Fd6XV7H44AUWsLMTnvbg81TWiFzcj: {"type":"REPLICATED","address":"/orbitdb/QmVpUTptT58zmz56Nkm8uHveVjNot1SGVw8D1GUZKMTkZF/chlu-staging"}
69|chlu-ma | [DEBUG][Thu Aug 23 2018 14:31:08 GMT+0000 (UTC)] Handling PubSub message from QmUiC2cxyYYpSaE64Fd6XV7H44AUWsLMTnvbg81TWiFzcj: {"type":"PINNING","multihash":"QmZUxVHzH43dX8Zh67us5MEmwxr9EU8ZFHZMwYmm191CSB"}
69|chlu-ma | [DEBUG][Thu Aug 23 2018 14:31:08 GMT+0000 (UTC)] Handling PubSub message from QmUiC2cxyYYpSaE64Fd6XV7H44AUWsLMTnvbg81TWiFzcj: {"type":"PINNING","multihash":"QmZUxVHzH43dX8Zh67us5MEmwxr9EU8ZFHZMwYmm191CSB"}
69|chlu-ma | [DEBUG][Thu Aug 23 2018 14:31:08 GMT+0000 (UTC)] Handling PubSub message from QmUiC2cxyYYpSaE64Fd6XV7H44AUWsLMTnvbg81TWiFzcj: {"type":"REPLICATED","address":"/orbitdb/QmVpUTptT58zmz56Nkm8uHveVjNot1SGVw8D1GUZKMTkZF/chlu-staging"}
69|chlu-ma | [DEBUG][Thu Aug 23 2018 14:31:08 GMT+0000 (UTC)] Handling PubSub message from QmUiC2cxyYYpSaE64Fd6XV7H44AUWsLMTnvbg81TWiFzcj: {"type":"REPLICATED","address":"/orbitdb/QmVpUTptT58zmz56Nkm8uHveVjNot1SGVw8D1GUZKMTkZF/chlu-staging"}
69|chlu-ma | [DEBUG][Thu Aug 23 2018 14:31:08 GMT+0000 (UTC)] Handling PubSub message from QmUiC2cxyYYpSaE64Fd6XV7H44AUWsLMTnvbg81TWiFzcj: {"type":"PINNED","multihash":"QmZUxVHzH43dX8Zh67us5MEmwxr9EU8ZFHZMwYmm191CSB"}
69|chlu-ma | [DEBUG][Thu Aug 23 2018 14:31:08 GMT+0000 (UTC)] Handling PubSub message from QmUiC2cxyYYpSaE64Fd6XV7H44AUWsLMTnvbg81TWiFzcj: {"type":"PINNED","multihash":"QmZUxVHzH43dX8Zh67us5MEmwxr9EU8ZFHZMwYmm191CSB"}

69|chlu-ma | ::ffff:127.0.0.1 - - [23/Aug/2018:14:32:00 +0000] "POST /vendors/did:chlu:GhjHnwijZRXBE8k3jzL87TnvJF8nb928ghErexx92NPc/profile HTTP/1.1" - - "http://localhost:3000/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36"

Eventually, the DB replicated so the status of the DID was supposed to be checked again, but this did not happen.

The problem might be that the SQL DB is not written to by the marketplace but by the collector. The marketplace had already replicated the change, but the collector did not so the getDID function found nothing.

We should figure out how to get the getDID function to recheck if this service is not the one that writes to SQL.