Skip to content
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

holochain backend for sharing budgets #2

Open
RyanHow opened this issue Jan 12, 2019 · 0 comments
Open

holochain backend for sharing budgets #2

RyanHow opened this issue Jan 12, 2019 · 0 comments

Comments

@RyanHow
Copy link
Owner

RyanHow commented Jan 12, 2019

Creation of a holochain backend for sharing a budget.

The current sharing implementation can be found in replication.ts.

This could be adapted to use a holochain backend (An active sharing implementation could be selected on a per budget basis).

Most of the processing is done in the frontend, so the replication only needs to track a few fields for conflict resolution and tracking the replicated / still to replicate data.

The replication data structure that needs to be ported to holochain looks like

export class Repl {
    id: number; // A unique number used to ID and order records
    timestamp: number; // Timestamp of the transaction (used for conflict resolution)
    deviceReplId: string; // Unique ID for each device (In holochain this could just be the agent hash)
    checksum: number; // Data checksum (This is really a double check to ensure data hasn't been tampered with and can probably be removed for holochain)
    data: any; // Data being replicated
}

Note that it is fine to use locally generated IDs and timestamps for this application. Budgets that are shared as read/write will only be shared with trusted peers who have no intent to destroy the replication data structure. In the worst case event, the local budget will be able to be rolled back to a consistent state and then re-shared with other peers.

The functionality of the backend only needs to be very simple.

  • A simple write for new repl records
  • Query all deviceIds
  • Query repl.id > last downloaded repl.id for each deviceId

The frontend would need the ability to spin up a new private DHT for each budget so sharing of that budget can remain private and only between those given the share code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant