You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<!-- While 0.4.0 doesn't get released [](https://travis-ci.org/diasdavid/registry-mirror) -->
12
14
13
-
> registry-mirror sets a mirror the the whole NPM registry, using IPFS for the discovery and transport of modules.
15
+
> **Install your modules through IPFS!!** This CLI utility enables you to clone the npm registry into IPFS and/or mirror the registry from IPFS.
14
16
15
17
# Resources
16
18
17
19
-[Demo video](https://vimeo.com/147968322)
18
20
-[Lengthy introduction in a blog post](http://blog.daviddias.me/2015/12/08/stellar-module-management)
To install IPFS dev0.4.0, you will need go installed, to install go in your machine, go to https://golang.org/dl and then run:
26
-
27
-
```bash
28
-
$ go get -u github.com/ipfs/go-ipfs
29
-
$ ipfs version
30
-
ipfs version 0.4.0-dev
31
-
```
32
-
33
-
## Run IPFS daemon
34
-
35
-
```bash
36
-
$ ipfs daemon
37
-
Initializing daemon...
38
-
Swarm listening on /ip4/127.0.0.1/tcp/4001
39
-
Swarm listening on /ip4/192.168.1.64/tcp/4001
40
-
Swarm listening on /ip4/192.168.10.172/tcp/4001
41
-
Swarm listening on /ip6/2001:8a0:7ac5:4201:4816:fd56:bea7:eaf3/tcp/4001
42
-
Swarm listening on /ip6/2001:8a0:7ac5:4201:ae87:a3ff:fe19:def1/tcp/4001
43
-
Swarm listening on /ip6/::1/tcp/4001
44
-
API server listening on /ip4/127.0.0.1/tcp/5001
45
-
Gateway (readonly) server listening on /ip4/127.0.0.1/tcp/8080
46
-
Daemon is ready
47
-
```
48
-
49
-
## Install registry-mirror
50
-
51
-
```bash
52
-
$ npm i registry-mirror -g
53
-
```
54
-
55
-
# Usage
56
-
57
-
Wait for the `Updated directory listing` log.
58
-
59
-
```bash
60
-
$ registry-mirror daemon
61
-
registry-mirror [info] using output directory /npm-registry/
62
-
registry-mirror [info] listening on 127.0.0.1:50321
63
-
registry-mirror [info] Cloning NPM OFF
64
-
registry-mirror [info] Updated directory listing, good to go :)
65
-
```
66
-
67
-
Port `50321` is default and can be set with `--port`.
68
-
69
-
## Configure npm
70
-
71
-
Set up your npm to use `registry-mirror` with the default port through:
23
+
# Installation
72
24
73
25
```bash
74
-
$ npm config set registry http://localhost:50321
26
+
> npm install ipfs-npm --global
75
27
```
76
28
77
-
If you picked another `--port` you need to adjust accordingly.
78
-
79
-
Good to npm install away! :)
29
+
This will make the `ipfs-npm` CLI tool available globally and an alias, `ipnpm`. We will use the alias for examples and API documentation, as it is shorter.
80
30
81
31
# Usage
82
32
83
-
## CLI
84
-
85
-
```bash
86
-
$ registry-mirror
87
-
Usage: registry-mirror COMMAND [OPTIONS]
88
-
89
-
Available commands:
90
-
91
-
daemon Mirror npm registry
92
-
ls Check modules available in the mirror
93
-
npm publish Publish an IPNS record with your current npm list
94
-
npm update Update your npm list of modules from IPNS
95
-
```
96
-
97
-
## Commands
98
-
99
-
### daemon
100
-
101
-
> starts the registry-mirror daemon
33
+
> **WIP**
102
34
103
-
`$ registry-mirror daemon`
35
+
### Examples
104
36
105
-
Options:
106
-
-`--clone` - Download the entire npm (Otherwise it just tries to read)
107
-
-`--port=<port>` Listen on the specified port
108
-
-`--host=<host>` Listen on the specified port
37
+
### API
109
38
110
-
###ls
39
+
#### `ipnpm registry` commands
111
40
112
-
> lists all the modules available on the IPFS accessible registry and their respective hashes
41
+
##### `ipnpm registry clone` - Download and store the entire npm repository into IPFS
113
42
114
-
`$ registry-mirror ls`
43
+
options
44
+
seq number
45
+
ipfs=
115
46
116
-
###npm update
47
+
##### `ipnpm registry index publish` - Publishes the current index we know as an IPNS name
117
48
118
-
> update your local registry cache
49
+
##### `ipnpm registry index fetch` - Fetches the latest known index from the IPFS network
119
50
120
-
`$ registry npm update`
51
+
#### `ipnpm daemon` - Starts an ipfs-npm daemon, so that we can point our npm cli to it
121
52
122
-
###npm publish
53
+
#### `ipnpm install <module>` - Similar to `npm install`, however it tries first to download the module from npm and then falls back into the regular registry
123
54
124
-
> publish the version of the cache you have from npm
125
55
126
-
`$ registry npm publish`
127
56
128
-
## Important
57
+
## Important: Getting 502 errors?
129
58
130
59
If you are on Mac OS X, make sure to increase the limit of files open (with `ulimit -Sn 4096`), otherwise the ipfs daemon will be sad and throw 502 replies.
0 commit comments