setup-ipfs:安装和初始化IPFS的GitHub操作

  • B5_662187
    了解作者
  • 118.8KB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • VIP专享
    资源类型
  • 0
    下载次数
  • 2022-04-04 10:32
    上传日期
IPFS设置操作 GitHub动作,用于安装和初始化以在所有受支持的运行器平台上运行行的实例。 该操作旨在提供一个环境来测试依赖IPFS的DApp。 输入项 此操作将自动检测运行程序平台功能,例如操作系统和处理器体系结构。 ipfs_version IPFS版本,根据自动解析为最匹配的(默认值: 0.6 )。 run_daemon 安装和初始化后是否启动IPFS服务守护程序(默认值: false )。 产出 设置过程将设置一些输出变量,以在随后的任何步骤中使用。 resolved_ipfs_version 安装了最新的匹配SemVer IPFS版本。 ipfs_download_url 使用的IPFS分发下载URL。 peer_id 初始化时报告的对等方身份。 welcome_ref 包含readme文件, help和其他文件的Welcome对象的哈希。 用法示例 在jobs.<job>.steps使用简单的默认IPFS最新版本: - uses : ibnesayeed/setup-ipfs@master 设置自定义IPFS版本(例如,最新的IPFS 0.4.x补
setup-ipfs-master.zip
  • setup-ipfs-master
  • .github
  • workflows
  • test.yml
    1.1KB
  • dependabot.yml
    106B
  • dist
  • index.js
    241.1KB
  • .eslintrc.json
    302B
  • action.yml
    838B
  • index.test.js
    445B
  • LICENSE
    1KB
  • README.md
    2.6KB
  • .gitignore
    1.6KB
  • index.js
    3KB
  • package-lock.json
    211.7KB
  • package.json
    941B
内容介绍
# IPFS Setup Action A GitHub Action to install and initialize [go-ipfs](https://github.com/ipfs/go-ipfs) to run an instance of [InterPlanetary File System (IPFS)](https://ipfs.io/) in all supported runner platforms. This action aims to provide an environment to test DApps that rely on IPFS. ## Inputs This action automatically detects runner platform features like the operating system and the processor architecture. ### `ipfs_version` IPFS version, automatically resolved to the best matching [released binary](https://dist.ipfs.io/go-ipfs/versions) as per the [SemVer format](https://semver.org/) (default: `0.6`). ### `run_daemon` Whether to start IPFS service daemon after installation and initialization (default: `false`). ## Outputs The setup process sets some output variables to be utilized in any succeeding steps. ### `resolved_ipfs_version` Latest matching SemVer IPFS version installed. ### `ipfs_download_url` Utilized IPFS distribution download URL. ### `peer_id` Identity of the peer as reported on initialization. ### `welcome_ref` Hash of the Welcome object containing `readme`, `help`, and other files. ## Example usage A simple usage in `jobs.<job_id>.steps` with default latest IPFS version: ```yml - uses: ibnesayeed/setup-ipfs@master ``` Setting up a custom IPFS version (e.g., latest patch of IPFS `0.4.x`): ```yml - uses: ibnesayeed/setup-ipfs@master with: ipfs_version: ^0.4 ``` Automatically booting the IPFS API service after installation and initialization: ```yml - uses: ibnesayeed/setup-ipfs@master with: run_daemon: true ``` A comprehensive example with matrix setup to test against various virsions of IPFS on various platforms: ```yml jobs: test-in-matrix: strategy: matrix: os: - ubuntu-latest - macos-latest - windows-latest ipfs: - 0.4 - 0.5 - 0.6 runs-on: ${{ matrix.os }} name: Test on ${{ matrix.os }} with IPFS ${{ matrix.ipfs }} steps: - name: Set up IPFS ${{ matrix.ipfs }} uses: ibnesayeed/setup-ipfs@master id: ipfs_setup with: ipfs_version: ${{ matrix.ipfs }} run_daemon: true - name: Test IPFS ${{ steps.ipfs_setup.outputs.resolved_ipfs_version }} CLI and API shell: bash run: | set -o pipefail ipfs cat ${{ steps.ipfs_setup.outputs.welcome_ref }}/readme curl -sX POST http://localhost:5001/api/v0/version | jq -e '(.Version=="${{ steps.ipfs_setup.outputs.resolved_ipfs_version }}")' ``` [See this example in action](https://github.com/ibnesayeed/setup-ipfs/blob/master/.github/workflows/test.yml).
评论
    相关推荐