Skip to content
This repository was archived by the owner on Mar 17, 2021. It is now read-only.
This repository was archived by the owner on Mar 17, 2021. It is now read-only.

Users can set the amount of storage they want to offer to the network #37

@WilfredTA

Description

@WilfredTA
  1. Users can set the amount of storage their Batnode offers
  2. Batnode tracks max storage (which is set by the user)
  3. On Batnode initialization, current storage is set as a property to Batnode object
  4. When a user tries to store a file on a host candidate, the candidate's available storage is calculated and compared: shard size <= max storage - available storage
  5. Optimization challenge: checking available storage without reading each file and adding up the data it uses
  6. Optimization challenge: if two nodes contact a host node at the same time, asking if it has enough storage for their shard, the host node will say yes to both of them because it has stored neither, but by saying yes to both, it agrees to store more data than it has the capacity to store. There needs to be an in-memory data structure of available storage that can be updated immediately when a node agrees to store a shard even if it hasn't already stored that shard.
  • An edge case to this, though, is that this data structure may be rendered inaccurate if the shard it agreed to store never made it over the wire!

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions