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

Feature: implement DatArchive API #66

Open
chrisekelley opened this issue Oct 30, 2018 · 10 comments
Open

Feature: implement DatArchive API #66

chrisekelley opened this issue Oct 30, 2018 · 10 comments

Comments

@chrisekelley
Copy link
Contributor

chrisekelley commented Oct 30, 2018

Bunsen should provide access to all of the DatArchive API as well as tests and examples.

@chrisekelley
Copy link
Contributor Author

Here's what we have so far:

So far there's create, getInfo, mkdir, and writeFile in this commit.

@RangerMauve
Copy link

I think @pfrazee was looking into standardizing an HTTP API for accessing Dat Archives.

Not sure if he had something you could work off of.

@pfrazee
Copy link

pfrazee commented Oct 30, 2018

I'm not focusing on that right now so I wouldnt wait for me.

@chrisekelley
Copy link
Contributor Author

chrisekelley commented Nov 13, 2018

Collecting some resources to implement the DatArchive API in Bunsen. So far there's create, getInfo, mkdir, and writeFile in www/nodejs-project/index.js

What others do we need to implement?

Some resources:

@RangerMauve
Copy link

Don't forget dat-archive-web 😀

@chrisekelley
Copy link
Contributor Author

@RangerMauve ahhh yes, thanks! added to list.

@chrisekelley
Copy link
Contributor Author

chrisekelley commented Nov 13, 2018

List of DatArchive functions to consider for implementation. Most of these are from node-dat-archive, but also note ones from dat-archive-web.

  • static async create ({localPath, datOptions, netOptions, title, description, type, author})
  • static async load ({localPath, datOptions, netOptions})
  • async configure (settings)
  • async getInfo (url, opts = {})
  • async history (opts = {})
  • async stat (filepath, opts = {})
  • async readFile (filepath, opts = {})
  • async writeFile (filepath, data, opts = {})
  • async unlink (filepath)
  • async download (filepath, opts = {})
  • async readdir (filepath, opts = {})
  • async mkdir (filepath)
  • async rmdir (filepath, opts = {})
  • async copy (path, dstPath, opts) - dat-archive-web
  • async rename(filepath, dstpath, opts) - dat-archive-web
  • watch (pathSpec = null, onInvalidated = null)
  • createNetworkActivityStream ()
  • static async resolveName (name)
  • static async fork (url, opts)
  • static async selectArchive (options) - dat-archive-web

@chrisekelley
Copy link
Contributor Author

I just made a new release of Bunsen which exposes some of these DatArchive API methods. It's now on the Play Store.

Check out Using the DatArchive API in Bunsen to create dat applications for dev info, and https://github.com/bunsenbrowser/bunsen/releases/tag/1.1.3 for info about this release.

You can test out this DatArchive support using the Bunsen Play dat:

dat://bunsen-play.hashbase.io

Next big step is to confirm if sharing is working - Some some modifications to dat-gateway may be needed to recognise and share new dats.

@RangerMauve
Copy link

This is so awesome! Great job! 😀💜

@chrisekelley
Copy link
Contributor Author

RJ contributed the implementations of watch and load!

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

No branches or pull requests

3 participants