Closed yusefnapora closed 7 years ago
okay, I think this is in decent shape, although maybe we should merge #146 first, since this branches off of it. I could also do a bit of squashing to sand off some of the edges in the commit history 😄
The last commit adds an ingestSimpleStatement
method to the aleph MediachainNode
class - it's not as fancy as the mcclient publish in that it doesn't try to do any id extraction, etc. It just takes a namespace, "body" object, refs (and optionally tags + deps). Then adds the serialized object to the datastore and makes + signs a statement and adds it to the DB. It's used in integration_test/push_test.js
and seems to be working.
The node's publisher id is currently optional, which isn't ideal... it needs to be generated asynchronously, so you can't make one in the constructor. And I didn't want to make it mandatory since we'll need to update existing usages. The ingest command will fail with an error if it's not set.
OK is this ready for final review?
I think so; although I realized I don't have a test for a partially-successful push (some valid results + error). I think I'll add that real quick; hopefully it'll work as expected :)
quick summary: