Skip to content

Commit 71ce99b

Browse files
committed
feat: clone
1 parent 8047029 commit 71ce99b

File tree

10 files changed

+312
-333
lines changed

10 files changed

+312
-333
lines changed

src/ipfs-npm/config.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
const ipfsAPI = require('ipfs-api')
21
const debug = require('debug')
32
const path = require('path')
43
const os = require('os')
@@ -9,7 +8,6 @@ const tmp = os.tmpdir()
98

109
module.exports = {
1110
log: log,
12-
apiCtl: ipfsAPI('/ip4/127.0.0.1/tcp/5001'),
1311
nodes: {
1412
biham: '/ip4/188.40.114.11/tcp/8801/ipfs/QmToeN85brexqyXUnWnKfHFqhvucJPViw9AxQQkjLoULy4'
1513
},
@@ -18,7 +16,7 @@ module.exports = {
1816
port: '9876',
1917
host: '127.0.0.1'
2018
},
21-
limit: 10,
19+
writeLimit: 10,
2220
registry: 'http://registry.npmjs.org/',
2321
tmp: tmp,
2422
error: path.join(__dirname, '../defaults', '404.json'),

src/ipfs-npm/ipfs-client.js

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
const ipfsAPI = require('ipfs-api')
2+
3+
module.exports = ipfs
4+
5+
function ipfs (options) {
6+
if (!options || !options.url) {
7+
options = {
8+
url: '/ip4/127.0.0.1/tcp/5001'
9+
}
10+
}
11+
12+
// TODO
13+
// 1. check if there is a node running (through IPFS_PATH)
14+
// if not, spawn one
15+
16+
return ipfsAPI(options.url)
17+
}

src/ipfs-npm/registry-clone/clone.js

-146
This file was deleted.

src/ipfs-npm/registry-clone/files.js

-84
This file was deleted.

src/ipfs-npm/registry-clone/hooks.js

-15
This file was deleted.

src/ipfs-npm/registry-clone/ibs.js

-4
This file was deleted.

0 commit comments

Comments
 (0)