Giter Site home page Giter Site logo

as's People

Contributors

arcaneshift avatar bgunson avatar bhodrolok avatar klarshin avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

bhodrolok qooky

as's Issues

ad crud & replication triggers

Calls to peer handler #uploadAd() results in:

  • fs.write ...
  • replication to other peers

Calls to peer handler #deletaAd() results in:

  • #37
  • replication to other peers

replication to other peers on upload/delete could be gossip or partial (subset of peers)

implement ad ledger

Implement a ledger containing peer id and/or handshake address, ad name, etc of those peers who won the ad race. This should be stored in memory or dumped to a .log file on the proxy and synced to connected peers. Connected peers should have the latest copy in the case that a proxy dies, so the connected peers can update the proxy instance with the latest version of the ledger.

Kinks:

  • if no connected peers are online and the proxy crashes, we have no way to guarentee the ledger will not be lost (this is why dumping to a .log file on the disc may be required - but if a backup proxy takes over with an out-of-date ledger we will have to accomodate that. Perhaps we need to implement coms between primary proxy and backups but this would just add complexity which we may not need to do).

Rename `diagrams` folder to `docs`

  • change diagrams folder to docs
  • move index.html from example client to docs folder
  • configure gh-pages to deploy from docs to everyone can make changes to the example client

p2p proof of concept

  • add p2p messaging (will need to be through socketio events through the proxy - so not true p2p). Maybe small replication or trading of images.

fix index picking for ad file

  • fix index picking in peer/main.js line 29. If length files is 0, then files[Math.floor(Math.random() * files.length)] == files[0] == undefined

passive ad consitency

I think we could achieve some sort of passive and eventual consistency for ad files across peers by using interaction with the system by clients (GET '/ad') to trigger replication.

So, if the ad endpoint is hit, we know multiple connected peers will try to respond. They might have ad files that are mutually exclusive from one another. As it stands we are only setting up a one time event listener within the ad route so slower peers to respond will have their ads thrown out, or potentially buffered on the proxy and served next call to '/ad'.

If we use the giveAd handler to update an observable representing a single ad, we can use the latest incoming ad to be served in the /ad endpoint, as well as intruduce logic within the 'give-ad' handler to emit back to other peers with said ad and it can be uploaded to their disc if they do not already have it.

remove file caching on proxy

Have the proxy not have to cache the ad file from a peer in the tmp folder and instead just forward the buffer as a file itself. This should make the proxy's responses faster and reduce the need for disk space on the proxy itself.

ignore empty last lines of ledgers

the npm package read-last-lines is handy but when we have an extra newline character at the end of the ledgers, parsing the last line fails and returns an empty string as the assumed latest time stamp

Docker workflow w/ Actions

  • On push to main, build, tag and publish latest Peer and Proxy Docker images to Docker Hub.
    • End-user convenience, just pull latest image and run container.
  • Split workflows for Peer and Proxy.
  • Fix peer Dockerfile and Docker Compose file
    • Peer: set build_args for image tagging with latest git commit hash, expose port based on env without hardcoding

Ad tracking lists

We need to track ad ids on a blacklist/whitelist so,

  • when a user uploads their own ad, a gossip message for deletion will not reuslt in it being removed from thir fs (add to whitelist).
  • when a user deletes an ad (from GUI), they will not have that ad replicated to their fs at a later time (check if on blacklist)

In peer/src/adlist.js implement:

  • AdList.add
  • AdList.remove
  • Addlist.#update

Arbitrary peer image choice

  • Make peers choose random image from their local fule system when asked for an ad. At lines 24-30 in 'get-ad' handler in peer/main.js.

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.