New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sync db via ipfs pubsub #19
Conversation
0c91444
to
e85e04e
Compare
Following the pattern I set up in #18, I made |
This looks interesting: mafintosh/hyperlog#17 |
I have been having difficulties making this work like yesterday; some researching led me to find that I am looking into running our own server to see if this helps with |
src/database/index.js
Outdated
if (this.ipfsNode) resolve(this._nodeInfo()) | ||
if (this.ipfsNode) { | ||
resolve(this._nodeInfo()) | ||
return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, good call. What happens if we put this all on the same line?
if (this.ipfsNode) return resolve(this._nodeInfo())
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure. It returns the return value from the resolve
method (another promise?), if we are dismissing it then this doesn't really matter. Go ahead if you'd rather have it that way.
Is this due to my changes? |
No, no, your changes are awesome, thank you for adding structure to my |
5cfbedf
to
b9d6a60
Compare
This is working as I originally developed it. I added a first commit with vanilla IPFS pubsub and then added the room abstraction which adds a couple of events that I use to send data to new peers. |
Looks great! I added one small missing thing. Merging! |
Ref: #25
This is a very simple implementation that we can use as base to improve.
This listens to updates from any client and updates local data with anything sent to it via the update.
It does not solve conflicts, it does not check anything.
Data is updated via p2p! Yay!