Code Monkey home page Code Monkey logo

ddeep-port's Introduction

Porting GUN

Please see the docs and watch the 30min NordicJS tech talk first.

Note: This folder is currently missing a package.json , if you want to run the NodeJS samples you'll need to install ws and likely a few other packages.

Implementation order, follow along with the video:

  1. Port /com into your language of choice, test that it is working against the browser.
  2. Then port the changes in /ad-hoc into your system, including the deduplication code, test against the browser.
  3. Then port the changes in /graph, test against browser, etc.
  4. Port /resolution, including the CRDT conflict resolution algorithm, etc., test multiple times against browser, etc.
  5. Port /key, etc. its in-memory lookup, etc. test against browser.

Now you're done! You have an in-memory, websocket+JSON port of GUN in your language! Any existing GUN app* (note: see batching comment below) should be able to point to your peer and things will work, except for long term storage.

If you decide to port /storage please note two things:

  1. Use the latest Radix Storage Engine code from GUN's main repo.
  2. It is still currently work-in-progress and thus maintain bugs.

Feel free to watch the NordicJS follow-up talk on doing distributed load testing against your server. Note that /test contains a duplicate of the code, you can ignore these duplicates.

Any questions? Hit me up on https://gitter.im/amark/gun !

Note: This does not implement an API for whatever language you port GUN to. The javascript API so far has been the hardest thing to build, not GUN itself. (The API is considered separate from GUN's wire spec protocol.)

*Batching Note: Wire spec sends JSON messages as msg however most existing adapters have a batching mechanism that sounds JSON as [msg, msg, msg], this is trivial to fix with something like this:

onSocketReceive(data) {
  if('[' === data[0]){
    return JSON.parse(data).forEach(msg => onSocketReceive(msg));
  }
  var msg = JSON.parse(data);
  // ... continue as normal
}

ddeep-port's People

Contributors

amark avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.