Skip to content

holochain backend for sharing budgets #2

@RyanHow

Description

@RyanHow

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.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions