Coder Social home page Coder Social logo

ndnfs-port's Introduction

NDNFS

Port of NDN file system based on work by Wentao and Qiuhan.

See the file INSTALL.md for build and install instructions.

Report bug to Zhehao. [email protected]

Usage

NDNFS is an NDN-friendly file system. When mounted, data in the file system can be fetched via NDN through NDNFS-server.

To run:

    $ mkdir /tmp/ndnfs
    $ mkdir /tmp/dir
    $ ./build/ndnfs -s [actual folder path] [mount point path]

[Actual folder path] is where files are actually stored on the local file system; while [mount point path] is the mount point.

'-s' flag tells fuse to run single threaded.

Use '-d' flag to see all debug output of ndnfs:

    $ ./build/ndnfs -d /tmp/dir /tmp/ndnfs

Use '-f' flag to run in foreground and see debug info:

    $ ./build/ndnfs -s -f /tmp/dir /tmp/ndnfs

If '-f' is used, NDNFS is unmounted automatically when you kill 'ndnfs' process.

To unmount NDNFS, type:

    $ umount /tmp/ndnfs

To force unmount, use '-f' flag:

    $ umount -f /tmp/ndnfs

To configure ndnfs files prefix, use '-o prefix=<prefix>'; to configure log file path, use '-o log=<log file path>'; to configure database file path , use '-o db=<database file path>'.

For example,

    $ ./build/ndnfs /tmp/dir /tmp/ndnfs -o prefix=/ndn/broadcast/ndnfs -o log=ndnfs.log -o db=/home/zhehao/ndnfs.db

will mount /tmp/dir as /tmp/ndnfs, using prefix "/ndn/broadcast/ndnfs", writing logs to ndnfs.log in running directory, and using /home/zhehao/ndnfs.db as database file. (Please use absolute path for db file at the moment)

Please note that current implementation does not scan files that already exists in actual path, before running ndnfs.

For files to become available via NDNFS-server, please put them into mount point after running NDNFS

NDNFS-server

NDNFS-server supports read access of NDNFS by remote through NDN.

To run:

Install and configure NFD before running the FS server.

Run:

    $ ./build/ndnfs-server

Use '-p' flag to configure prefix, '-d' flag to select db file, and '-f' flag to identify file system root (these should be the same with NDNFS configuration). Use '-l' flag to configure log file path.

For example,

    $ ./build/ndnfs-server -p /ndn/broadcast/ndnfs -l ndnfs-server.log -f /tmp/ndnfs -d /tmp/ndnfs.db

will serve content in mount point /tmp/ndnfs, using prefix "/ndn/broadcast/ndnfs", writing logs to ndnfs-server.log, and using ndnfs.db as database file in running directory.

For a quick test, please make sure that you have NFD, NDNFS-server and NDNFS running. Assuming that the default configuration is used, you can do

    $ echo "Hello, world!" > /tmp/ndnfs/test.txt
    $ ndnpeek -pfPv /ndn/broadcast/ndnfs/test.txt

to see the file test.txt being served over NDN. (ndnpeek requires ndntools to be installed)

NDNFS-client

To access NDNFS data remotely, please use NDN-JS Firefox addon in NDN-JS library; Or the built-in client in tests. (We recommend using the Firefox addon client to test NDNFS.)

Instructions for Firefox addon:

  • Run nfd locally;
  • Set the Firefox addon's hub to localhost if it's not already localhost;
  • nfdc to the host of ndnfs-server or ndn testbed (can be localhost as well, in which case nfdc won't be needed);
  • Type in a "<prefix>/<file or folder>" path as URI and fetch.

Right now, Firefox addon will try to infer the mimetype of the file based on extension, and invoke default behavior for the given mimetype. (.pdf being an exception: Download dialogue is called, instead of pdf.js)

Default behavior For NDNFS content with unknown mimetype is save as file.

Instructions for client application:

  • Run nfd locally;
  • nfdc to the host of ndnfs-server or ndn testbed (not needed if ndnfs server runs locally);
  • Run client application;
    $ ./build/test-client
  • To browse the metadata of a certain file or directory, in the running client, type in "show <prefix>/<file or folder>";
  • To fetch a certain file and save it locally, in the running client, type in "fetch <prefix>/<file or folder> <local save path>".

New features

  • Instead of the network-ready data packets, store only the signature in sqlite3 database, and assemble NDN data packets when requested;
  • Publish mime_type in a new meta-info branch;
  • Updated to work with NDNJS Firefox addon, and latest version of NDN-CPP;
  • Sign asynchronously (experimental, and still in local branch).

ndnfs-port's People

Contributors

zhehaowang avatar jefft0 avatar zjkmxy avatar cawka avatar

Watchers

James Cloos avatar  avatar  avatar

ndnfs-port's Issues

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.