@4everlink/cli 中文文档教程

发布于 4年前 浏览 25 项目主页 更新于 3年前

A command line tool for upload file to IPFS Cluster use the IPFS Cluster HTTP API.

NPM VersionInstall SizeLicense

Read this in other languages: English | 简体中文

install

npm install -g @4everlink/cli

Command

Usage: 4everlink [options] [command]

Options:
  -V, --version         output the version number
  -h, --help            output usage information

Commands:
  config <arg> [value]  set or show config for host
  add [options] <file>  upload file

add

$ 4everlink add --help

Usage: 4everlink [options] <file>

upload file

Options:
  -V, --version        output the version number
  -d, --debug          output extra debugging
  -p, --path <path>    wrapper dir (default: "/")
  --host <host>        ipfs cluster api host (default: "")
  --port <port>        ipfs cluster api port (default: "")
  --showAll            show all file cid
  -t, --token <token>  ipfs cluster api base auth token (default: "")
  -r, --recursive      recursive all sub dir
  -a, --all            include hidden file
  -h, --help           output usage information

output data:

{
  path: 'web',
  hash: 'QmdiRp2QU1pYb4r1Hmbfah3Ckqq2p56vDSBarm4VWHSdWg',
  size: 1042
}

or use --showAll

[
  {
    path: 'web/index.html',
    hash: 'QmZJZG6WuiKMgXw4YANsgJQE98hmahBN7icxPtx4RoDR4M',
    size: 430
  },
  {
    path: 'web/main.css',
    hash: 'QmbFMke1KXqnYyBBWxB74N4c5SBnJMVAiMNRcGu6x1AwQH',
    size: 6
  },
  {
    path: 'web/main.js',
    hash: 'QmbFMke1KXqnYyBBWxB74N4c5SBnJMVAiMNRcGu6x1AwQH',
    size: 6
  },
  {
    path: 'web/sub.html',
    hash: 'QmY3Gn49Dx4ybPwZ8AQ9kFjjWRhr7Y1vVVYp5N9yyYMSg6',
    size: 393
  },
  {
    path: 'web',
    hash: 'QmdiRp2QU1pYb4r1Hmbfah3Ckqq2p56vDSBarm4VWHSdWg',
    size: 1042
  }
]

host, port, token support load from config file, default config file is ~/.4everlink/conf.yaml, for example:

host: "127.0.0.1"
port: 9094
token: ""

The env _4EVERLINKCONF set custom config file path, for example: export _4EVERLINKCONF=/custom/path, the config file is /custom/path/conf.yaml.

config

$ 4everlink config --help
Usage: 4everlink config [options] <arg> [value]

set or show config for host

Arguments:

  arg         the params to set, maybe host、port or token
  value       the value to set

Options:
  -h, --help  output usage information

for example, set host: 4everlink config host "127.0.0.1"; get current host: 4everlink config host

License

MIT

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文