@fairdatasociety/fdp-cli v0.1.0
Fair Data Protocol CLI
Warning: This project is in beta state. There might (and most probably will) be changes in the future to its API and working. Also, no guarantees can be made about its stability, efficiency, and security at this stage.
Table of Contents
Installation
From npm
To install globally (requires npm root --global to be writable):
npm install --global @fairdatasociety/fdp-cliUsage
Create FDP account. The account will only be stored on your device.
fdp-cli account create ACCOUNT_NAMEOr import an account using mnemonic phrase.
fdp-cli account import "MNEMONIC_PHRASE"Export your account in plain text.
fdp-cli account exportExport your account as a text file.
fdp-cli account export --out-file MY_FILENAMEMake your account portable between devices.
This action will upload the encrypted account to Ethereum Swarm and you will be able to use your username and password to access your account. The username will be registered in ENS. To perform this action, your wallet must be topped up with at least 0.01 token of the current network.
This action is optional and you can manage your account information without registering.
fdp-cli account register YOUR_USERNAMELogin to portable account with storing account's seed to local machine.
fdp-cli account login YOUR_USERNAMEPods management
Create a pod.
fdp-cli pod create YOUR_POD_NAMEDelete a pod.
fdp-cli pod delete YOUR_POD_NAMEShow list of pods.
fdp-cli pod listDirectories management
Create a directory.
fdp-cli directory create "/YOUR_DIRECTORY" --pod YOUR_POD_NAMEGet list of files and directories in the root.
fdp-cli directory read "/" --pod YOUR_POD_NAMEGet list of files in subdirectory.
fdp-cli directory read "/YOUR_SUBDIR" --pod YOUR_POD_NAMEDelete a directory.
fdp-cli directory delete "/YOUR_DIRECTORY" --pod YOUR_POD_NAMEFiles management
Upload a file.
fdp-cli file upload "YOUR_SOURCE_PATH" "/DESTINATION_PATH" --pod YOUR_POD_NAMEDownload a file.
fdp-cli file download "/YOUR_SOURCE_PATH" "DESTINATION_PATH" --pod YOUR_POD_NAMEDelete a file.
fdp-cli file delete "/YOUR_SOURCE_PATH" --pod YOUR_POD_NAMEDevelopment
After the project has been cloned, the dependencies must be installed. Run the following in the project folder:
npm ciThen you need to compile the TypeScript code:
npm run compileTo make the local fdp-cli files in the dist/ directory available as a global package:
npm linkIf all went well you should be able to run fdp-cli.
If npm link fails, or you don't want to install anything, then you
can use node dist/index.js to run fdp-cli from the checked out
directory.
System environment
With specific system environment variables you can alter the behaviour of the CLI
ENS_NETWORK- name of the configuration that defines blockchain RPC and smart contract addresses. Allowed values:goerliandfdp-play. Default isgoerliENS_DOMAIN- domain name of the ENS. It is not necessary to define for built-in networks, but it can be helpful for custom networksENS_RPC_URL- RPC url for interacting with ENSBEE_API_URL- API URL of Bee clientBEE_BATCH_ID- batch id for Bee clientBEE_DEBUG_API_URL- debug API URL of Bee clientFDP_CLI_CONFIG_FOLDER- full path to a configuration folderFDP_CLI_CONFIG_FILE- configuration file name, defaults to config.json
Contribute
There are some ways you can make this module better:
- Consult our open issues and take on one of them
- Help our tests reach 100% coverage!
License
3 years ago