• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

ipfs-shipyard/ipfs-npm-registry-mirror: Clone the NPM registry into IPFS

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

ipfs-shipyard/ipfs-npm-registry-mirror

开源软件地址:

https://github.com/ipfs-shipyard/ipfs-npm-registry-mirror

开源编程语言:

JavaScript 97.5%

开源软件介绍:

npm on IPFS logo

ipfs-npm-registry-mirror

Build Status Code Coverage Dependency Status

A npm mirror that adds files to IPFS and makes them available over the distributed web!

Usage

# with docker installed
$ git clone https://github.com/ipfs-shipyard/ipfs-npm-registry-mirror.git
$ cd ipfs-npm-registry-mirror
$ ./deploy.sh

Overview

There are two docker images, a replication-master which continually syncs the npm registry and all of its packages and a registry-mirror which serves files to clients.

The replication-master publishes notifications of new packages to the mirrors via pubsub, they then save the CIDs of newly published modules and use them to resolve them on the IPFS network.

You can can either use the public http mirror with npm/yarn (e.g. pass --registry=https://registry.js.ipfs.io to npm or yarn) or use the ipfs-npm client directly.

Lead Maintainer

Alex Potsides

Deployment

Requirements:

  • Docker
  • docker-compose v1.24.0-rc1 or later.
$ git clone https://github.com/ipfs-shipyard/ipfs-npm-registry-mirror.git
$ cd ipfs-npm-registry-mirror
$ echo NODE_ENV=production > .env
$ ./deploy.sh
version: '2'

services:

  proxy:
    image: jwilder/nginx-proxy:alpine
    mem_limit: 1024m
    links:
      - replicate
      - registry
    ports:
      - '80:80'
      - '443:443'
    logging:
      driver: "json-file"
      options:
        max-size: "1m"
        max-file: "3"
    volumes:
      - /var/run/docker.sock:/tmp/docker.sock:ro
      - /etc/nginx/vhost.d
      - /usr/share/nginx/html
      - /etc/nginx/certs
      - ./conf/proxy.conf:/etc/nginx/proxy.conf
    restart: 'always'

  replicate:
    build:
      context: .
      dockerfile: packages/replication-master/Dockerfile
    restart: 'always'
    env_file: .env
    mem_limit: 4608m
    environment:
      - VIRTUAL_HOST=replication.rig.home
      - VIRTUAL_PORT=8080
      - NODE_ENV=${NODE_ENV}
      - EXTERNAL_PROTOCOL=http
      - EXTERNAL_HOST=rig.home
      - EXTERNAL_PORT=80
      - EXTERNAL_IP=192.168.1.112
      - IPFS_STORE_TYPE=fs
      - IPFS_REPO=/usr/local/ipfs-npm-registry-mirror/replication-master
      - FOLLOW_SEQ_FILE=/usr/local/ipfs-npm-registry-mirror/seq.txt
      - CLONE_DELAY=30000
      - FOLLOW_CONCURRENCY=5
      - REQUEST_CONCURRENCY=5
    volumes:
      - /var/run/docker.sock:/tmp/docker.sock:ro
      - /usr/local/ipfs-npm-registry-mirror:/usr/local/ipfs-npm-registry-mirror
    logging:
      driver: "json-file"
      options:
        max-size: "100m"
        max-file: "3"

  registry:
    build:
      context: .
      dockerfile: packages/registry-mirror/Dockerfile
    restart: 'always'
    env_file: .env
    mem_limit: 2048m
    volumes:
      - /var/run/docker.sock:/tmp/docker.sock:ro
    environment:
      - VIRTUAL_HOST=rig.home
      - VIRTUAL_PORT=8080
      - NODE_ENV=${NODE_ENV}
      - EXTERNAL_PROTOCOL=http
      - EXTERNAL_HOST=rig.home
      - EXTERNAL_PORT=80
      - EXTERNAL_IP=192.168.1.112
      - IPFS_STORE_TYPE=fs
      - IPFS_REPO=/usr/local/ipfs-npm-registry-mirror/worker
      - PUBSUB_MASTER=http://replicate:8080
      - REQUEST_MAX_SOCKETS=20
    volumes:
      - /var/run/docker.sock:/tmp/docker.sock:ro
      - /usr/local/ipfs-npm-registry-mirror:/usr/local/ipfs-npm-registry-mirror
    links:
      - replicate
    ports:
      - "10000:10000"
      - "10001:10001"
      - "10002:10002"
      - "10003:10003"
      - "10004:10004"
      - "10005:10005"
      - "10006:10006"
      - "10007:10007"
      - "10008:10008"
      - "10009:10009"
    logging:
      driver: "json-file"
      options:
        max-size: "100m"
        max-file: "3"



鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
wiberlin/ipfs-crawler: A crawler for the IPFS network, code for our paper (https ...发布时间:2022-06-22
下一篇:
larsks/git-remote-ipfs发布时间:2022-06-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap