Storage DFMS

Storage DFMS

  • Getting Started
  • CLI
  • Guides
  • API Endpoints
  • Help

›Storade Director Node

Storade Director Node

  • dfms-client (base command)
  • dfms-client drive
  • dfms-client contract
  • dfms-client sc
  • dfms-client net
  • dfms-client version

Storage Replicator Node

  • dfms-replicator (base command)
  • dfms-replicator contract
  • dfms-replicator net
  • dfms-replicator version

Supercontracts

  • Create a .wasm File
  • Create a .wat File
  • Build and Deploy SuperContracts

Interface with Drive file system.

DriveFS is an API which implements Unix like file system over Drive to manipulate over the content of any Drive in the network with an ability to alter it with write access.

Subcommands

CommandDescription
dfms-client drive addAdd a file or directory to a Drive.
dfms-client drive getGet a file or directory from any Drive.
dfms-client drive fileGet a file by its cid.
dfms-client drive rmRemove a file or directory from a Drive.
dfms-client drive mvMove and/or rename a file or directory in a Drive.
dfms-client drive cpCopy a file or directory in a Drive.
dfms-client drive mkdirMake directory in a Drive.
dfms-client drive lsList files under directory in a Drive.
dfms-client drive statShow stats about a file or directory in a Drive.
dfms-client drive flushUpload local changes from cache to Storage Replicator Nodes of a Drive.
dfms-client drive clearClear a local Drive.

dfms-client drive add

Adds a file or directory under src to dst of a specific drive. Forms a reference to new content in the Drive and copies data to a local cache. Does not upload, thus to replicate content and reference should be followed with flushing.

Use --recursive(r) to add sub/directories.
Use --flush(f) to flush after execution immediately.

Arguments

NameDescription
driveDrive ID.
srcThe file to be added to Drive.
dstThe destination in Drive of the file to be added. Defaults to root.

Options

NameDescription
recursive(r)Add directory paths recursively.
flush(f)Upload local changes from cache to Storage Replicator Nodes of a Drive.

Examples

  • Add a file from pwd to a root directory in a Drive with the same name:

    $ dfms-client drive baegbeibondkkrhxfprzwrlgxxltavqhweh2ylhu4hgo5lxjxpqbpfsw2lu add image.jpg
    
  • Add a directory from $HOME to a subdirectory in a Drive with the same name:

    $ dfms-client drive baegbeibondkkrhxfprzwrlgxxltavqhweh2ylhu4hgo5lxjxpqbpfsw2lu add ~/kittens /images/ -r
    

    NOTE:
    'images' - is not created automatically and should be created before addition. The '/' right after the 'images' is required to show that a file or a directory should be put inside.

  • Add a web file to a subdirectory in a Drive with a custom name:

    $ dfms-client drive baegbeibondkkrhxfprzwrlgxxltavqhweh2ylhu4hgo5lxjxpqbpfsw2lu add http://placekitten.com/200/300 /images/kitten.jpg
    
  • Add a file from stdin to a root directory in a Drive with a custom name:

    $ curl http://placekitten.com/200/300 | dfms-client drive baegbeibondkkrhxfprzwrlgxxltavqhweh2ylhu4hgo5lxjxpqbpfsw2lu add - /kitten.jpg
    

dfms-client drive get

Gets a referenced file or directory under src to dst of any drive. If some or all requested content is not cached locally, get retrieves it from Storage Replicator Nodes, caches locally and saves to dst. In the opposite case, copies cached content from Drive to dst.

Arguments

NameDescription
driveDrive ID.
srcThe source path of the file to be gotten from Drive.
dstThe destination path for the file to be outputted. Defaults to '/'.

Examples

  • Get a file from root directory in a Drive to pwd with a same name:

    $ dfms-client drive baegbeibondkkrhxfprzwrlgxxltavqhweh2ylhu4hgo5lxjxpqbpfsw2lu get image.jpg
    
  • Get a directory from sub directory in a Drive to $HOME with a custom name:

    $ dfms-client drive baegbeibondkkrhxfprzwrlgxxltavqhweh2ylhu4hgo5lxjxpqbpfsw2lu get images/kittens ~/kitten_images
    

dfms-client drive file

File gets a referenced file or directory by it'd cid to dst of any drive. If some or all requested content is not cached locally, drive file retrieves it from replicators, caches locally and saves to dst. In the opposite case, copies cached content from Drive to dst.

dst takes absolute path but if prefixed with '~' or '.', it is extended with home directory or pwd, respectively.

Arguments

NameDescription
driveDrive ID.
cidThe source cid of the file to be gotten from Drive.
dstThe destination path for the file to be outputted. Defaults to '/'.

Examples

  • Get a file from a Drive to pwd with a same name:

    $ dfms-client drive baegbeibondkkrhxfprzwrlgxxltavqhweh2ylhu4hgo5lxjxpqbpfsw2lu file bafybeihnpekq72dk75zpkhlgoh6lsjlxcygu4vrtclaqartyxqqqys5c7m ./image.jpg
    

dfms-client drive rm

Removes a file or directory under path from a specific drive. Cleans the reference locally along with cached data. Should be forward with flushing to upload reference changes.

Use --flush(f) to flush after execution immediately.

Arguments

NameDescription
driveDrive ID.
pathThe path of the file in a Drive to be removed.

Options

NameDescription
flush(f)Upload local changes from cache to Storage Replicator Nodes of a Drive.

Examples

  • Remove file reference and clean data from cache:

    $ dfms-client drive baegbeibondkkrhxfprzwrlgxxltavqhweh2ylhu4hgo5lxjxpqbpfsw2lu ls
    image.jpg
    kitten.jpg
    $ dfms-client drive baegbeibondkkrhxfprzwrlgxxltavqhweh2ylhu4hgo5lxjxpqbpfsw2lu rm kitten.jpg
    $ dfms-client drive baegbeibondkkrhxfprzwrlgxxltavqhweh2ylhu4hgo5lxjxpqbpfsw2lu ls
    image.jpg
    

    NOTE:
    In this case file fully removed locally and could not be got.

  • Remove directory and everything inside only from the local cache, while keeping reference.

    $ dfms-client drive baegbeibondkkrhxfprzwrlgxxltavqhweh2ylhu4hgo5lxjxpqbpfsw2lu ls /images
    image.jpg
    kitten.jpg
    $ dfms-client drive baegbeibondkkrhxfprzwrlgxxltavqhweh2ylhu4hgo5lxjxpqbpfsw2lu rm /images -l
    $ dfms-client drive baegbeibondkkrhxfprzwrlgxxltavqhweh2ylhu4hgo5lxjxpqbpfsw2lu ls /images
    image.jpg
    kitten.jpg
    

    NOTE:
    Files are removed from a local cache, but they still can be accessed from Storage Replicator Nodes as if their content is stored locally.


dfms-client drive mv

Move and/or rename a file or directory under src to dst in a specific drive. Should be forward with flushing to upload reference changes.

Use --flush(f) to flush after execution immediately.

Arguments

NameDescription
driveDrive ID.
srcThe source path of the file to be moved/renamed.
dstThe destination path of the file to be moved/renamed.

Options

NameDescription
flush(f)Upload local changes from cache to Storage Replicator Nodes of a Drive.

Examples

  • Move file from root directory to subdirectory:

    $ dfms-client drive baegbeibondkkrhxfprzwrlgxxltavqhweh2ylhu4hgo5lxjxpqbpfsw2lu ls
    images/
    kitten.jpg
    $ dfms-client drive baegbeibondkkrhxfprzwrlgxxltavqhweh2ylhu4hgo5lxjxpqbpfsw2lu mv kitten.jpg images/
    $ dfms-client drive baegbeibondkkrhxfprzwrlgxxltavqhweh2ylhu4hgo5lxjxpqbpfsw2lu ls images
    kitten.jpg
    
  • Rename directory:

    $ dfms-client drive baegbeibondkkrhxfprzwrlgxxltavqhweh2ylhu4hgo5lxjxpqbpfsw2lu ls
    images/
    $ dfms-client drive baegbeibondkkrhxfprzwrlgxxltavqhweh2ylhu4hgo5lxjxpqbpfsw2lu mv images kitten_images
    $ dfms-client drive baegbeibondkkrhxfprzwrlgxxltavqhweh2ylhu4hgo5lxjxpqbpfsw2lu ls
    kitten_images/
    

dfms-client drive cp

Copies a reference of a file or directory under src to dst in a specific drive. Does not copy actual data and makes it accessible from different places, like symlink. Should be forward with flushing to upload reference changes.

Use --flush(f) to flush after execution immediately.

Arguments

NameDescription
driveDrive ID.
srcThe source path of the file to be copied.
dstThe destination path of the file to be copied.

Options

NameDescription
flush(f)Upload local changes from cache to Storage Replicator Nodes of a Drive.

Examples

  • Copy file from root directory to subdirectory with the a same name:

    $ dfms-client drive baegbeibondkkrhxfprzwrlgxxltavqhweh2ylhu4hgo5lxjxpqbpfsw2lu ls
    images/
    kitten.jpg
    $ dfms-client drive baegbeibondkkrhxfprzwrlgxxltavqhweh2ylhu4hgo5lxjxpqbpfsw2lu cp kitten.jpg images/
    $ dfms-client drive baegbeibondkkrhxfprzwrlgxxltavqhweh2ylhu4hgo5lxjxpqbpfsw2lu ls images
    kitten.jpg
    $ dfms-client drive baegbeibondkkrhxfprzwrlgxxltavqhweh2ylhu4hgo5lxjxpqbpfsw2lu ls
    images/
    kitten.jpg
    
  • Copy directory with a custom name:

    $ dfms-client drive baegbeibondkkrhxfprzwrlgxxltavqhweh2ylhu4hgo5lxjxpqbpfsw2lu ls
    images/
    $ dfms-client drive baegbeibondkkrhxfprzwrlgxxltavqhweh2ylhu4hgo5lxjxpqbpfsw2lu cp images kitten_images
    $ dfms-client drive baegbeibondkkrhxfprzwrlgxxltavqhweh2ylhu4hgo5lxjxpqbpfsw2lu ls
    images/
    kitten_images/
    

dfms-client drive mkdir

Makes a directory under path in a specific drive. Should be forward with flushing to upload reference changes.

Use --flush(f) to flush after execution immediately.

Arguments

NameDescription
driveDrive ID.
pathThe path to the directory to be created.

Options

NameDescription
flush(f)Upload local changes from cache to Storage Replicator Nodes of a Drive.

Example

$ dfms-client drive baegbeibondkkrhxfprzwrlgxxltavqhweh2ylhu4hgo5lxjxpqbpfsw2lu ls
image.jpg
$ dfms-client drive baegbeibondkkrhxfprzwrlgxxltavqhweh2ylhu4hgo5lxjxpqbpfsw2lu mkdir images
$ dfms-client drive baegbeibondkkrhxfprzwrlgxxltavqhweh2ylhu4hgo5lxjxpqbpfsw2lu ls
images/
image.jpg

dfms-client drive ls

Lists content of a directory under path in a specific drive.

Use --verbose(v) to show additional details.
Use --sort(s) to sort list lexicographically.

Arguments

NameDescription
driveDrive ID.
pathThe path to a directory to be listed. Defaults to '/'.

Options

NameDescription
verbose(v)Use long listing format.
sort(s)Sort list entries.

dfms-client drive stat

Shows stats about a file or directory under path in a specific drive.

Arguments

NameDescription
driveDrive ID.
pathThe path of the file to get stats about.

dfms-client drive flush

Uploads all local reference changes with data to Storage Replicator Nodes of drive. Require write access.

NOTE:
Flushing is not done automatically to aggregate multiple changes in the cache allowing uploading them at once and to make that behavior default. Use --flush flag with any Drive state-changing command to upload immediately after any change.

Arguments

NameDescription
driveDrive ID.

dfms-client drive clear

Clears all file from a drive locally to free disk space. Requires write access.

NOTE:
Flushing is not done automatically after flush

Arguments

NameDescription
driveDrive ID.
← dfms-client (base command)dfms-client contract →
  • Subcommands
  • dfms-client drive add
    • Arguments
    • Options
    • Examples
  • dfms-client drive get
    • Arguments
    • Examples
  • dfms-client drive file
    • Arguments
    • Examples
  • dfms-client drive rm
    • Arguments
    • Options
    • Examples
  • dfms-client drive mv
    • Arguments
    • Options
    • Examples
  • dfms-client drive cp
    • Arguments
    • Options
    • Examples
  • dfms-client drive mkdir
    • Arguments
    • Options
    • Example
  • dfms-client drive ls
    • Arguments
    • Options
  • dfms-client drive stat
    • Arguments
  • dfms-client drive flush
    • Arguments
  • dfms-client drive clear
    • Arguments
Storage DFMS
Roles
SDNSRNVerifierSC Executor
Built-in Features
DriveSuperContractChallengeRewards
Protocols
Cross-block protocolFair streaming
Algorithms
VerificationConsensus
CLI
dfms-clientdfms-replicatorsupercontracts
Giudes
ContractDriveSupercontractsNetwork
Copyright © 2021 ProximaX