From 52d0d997e925afbe71bf279227467deede6ae5fb Mon Sep 17 00:00:00 2001 From: David Dias Date: Fri, 8 Jan 2016 15:41:28 +0100 Subject: [PATCH 1/8] placeholder --- src/ipfs-core/index.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/ipfs-core/index.js b/src/ipfs-core/index.js index 6f4da49bc6..ead1829bd9 100644 --- a/src/ipfs-core/index.js +++ b/src/ipfs-core/index.js @@ -76,4 +76,10 @@ function IPFS () { gc: function () {} } + + this.bootstrap = { + list: () => {}, + add: () => {}, + rm: () => {} + } } From ad9594998ce1aa1e729e7296483baf385659c621 Mon Sep 17 00:00:00 2001 From: David Dias Date: Sat, 9 Jan 2016 22:51:33 +0100 Subject: [PATCH 2/8] add bootstrap list and bootstrap list core test --- src/ipfs-core/index.js | 7 +++++- tests/test-core/test-bootstrap.js | 38 +++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 tests/test-core/test-bootstrap.js diff --git a/src/ipfs-core/index.js b/src/ipfs-core/index.js index ead1829bd9..3aa81e25b7 100644 --- a/src/ipfs-core/index.js +++ b/src/ipfs-core/index.js @@ -78,7 +78,12 @@ function IPFS () { } this.bootstrap = { - list: () => {}, + list: (callback) => { + repo.config.get((err, config) => { + if (err) { return callback(err) } + callback(null, config.Bootstrap) + }) + }, add: () => {}, rm: () => {} } diff --git a/tests/test-core/test-bootstrap.js b/tests/test-core/test-bootstrap.js new file mode 100644 index 0000000000..2a0043c5a7 --- /dev/null +++ b/tests/test-core/test-bootstrap.js @@ -0,0 +1,38 @@ +/* globals describe, it */ + +'use strict' + +const expect = require('chai').expect + +process.env.IPFS_PATH = process.cwd() + '/tests/repo-example' +const IPFS = require('../../src/ipfs-core') + +describe('bootstrap', () => { + it('get bootstrap list', done => { + let ipfs = new IPFS() + ipfs.bootstrap.list((err, list) => { + expect(err).to.not.exist + let defaultList = [ + '/ip4/104.131.131.82/tcp/4001/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ', + '/ip4/104.236.176.52/tcp/4001/ipfs/QmSoLnSGccFuZQJzRadHn95W2CrSFmZuTdDWP8HXaHca9z', + '/ip4/104.236.179.241/tcp/4001/ipfs/QmSoLPppuBtQSGwKDZT2M73ULpjvfd3aZ6ha4oFGL1KrGM', + '/ip4/162.243.248.213/tcp/4001/ipfs/QmSoLueR4xBeUbY9WZ9xGUUxunbKWcrNFTDAadQJmocnWm', + '/ip4/128.199.219.111/tcp/4001/ipfs/QmSoLSafTMBsPKadTEgaXctDQVcqN88CNLHXMkTNwMKPnu', + '/ip4/104.236.76.40/tcp/4001/ipfs/QmSoLV4Bbm51jM9C4gDYZQ9Cy3U6aXMJDAbzgu2fzaDs64', + '/ip4/178.62.158.247/tcp/4001/ipfs/QmSoLer265NRgSp2LA3dPaeykiS1J6DifTC88f5uVQKNAd', + '/ip4/178.62.61.185/tcp/4001/ipfs/QmSoLMeWqB7YGVLJN3pNLQpmmEk35v6wYtsMGLzSr5QBU3', + '/ip4/104.236.151.122/tcp/4001/ipfs/QmSoLju6m7xTh3DuokvT3886QRYqxAzb1kShaanJgW36yx' + ] + expect(list).to.deep.equal(defaultList) + done() + }) + }) + + it.skip('add a peer to the bootstrap list', done => { + done() + }) + + it.skip('remove a peer from the bootstrap list', done => { + done() + }) +}) From 52b89b01b69409dd6eb3cbb27e25b4bf2302d52b Mon Sep 17 00:00:00 2001 From: David Dias Date: Sat, 9 Jan 2016 23:07:26 +0100 Subject: [PATCH 3/8] add bootstrap add and rm and bootstrap add and rm tests --- src/ipfs-core/index.js | 26 ++++++++- tests/repo-example/config | 89 +------------------------------ tests/test-core/test-bootstrap.js | 61 +++++++++++++++------ 3 files changed, 70 insertions(+), 106 deletions(-) diff --git a/src/ipfs-core/index.js b/src/ipfs-core/index.js index 3aa81e25b7..abd0d2ed95 100644 --- a/src/ipfs-core/index.js +++ b/src/ipfs-core/index.js @@ -84,7 +84,29 @@ function IPFS () { callback(null, config.Bootstrap) }) }, - add: () => {}, - rm: () => {} + add: (multiaddr, callback) => { + repo.config.get((err, config) => { + if (err) { return callback(err) } + config.Bootstrap.push(multiaddr) + repo.config.set(config, err => { + if (err) { return callback(err) } + callback() + }) + }) + }, + rm: (multiaddr, callback) => { + repo.config.get((err, config) => { + if (err) { return callback(err) } + config.Bootstrap = config.Bootstrap.filter(mh => { + if (mh === multiaddr) { + return false + } else { return true } + }) + repo.config.set(config, err => { + if (err) { return callback(err) } + callback() + }) + }) + } } } diff --git a/tests/repo-example/config b/tests/repo-example/config index 5811699b32..cbcdfe3b6e 100644 --- a/tests/repo-example/config +++ b/tests/repo-example/config @@ -1,88 +1 @@ -{ - "Identity": { - "PeerID": "QmQ2zigjQikYnyYUSXZydNXrDRhBut2mubwJBaLXobMt3A", - "PrivKey": "CAASpgkwggSiAgEAAoIBAQC2SKo/HMFZeBml1AF3XijzrxrfQXdJzjePBZAbdxqKR1Mc6juRHXij6HXYPjlAk01BhF1S3Ll4Lwi0cAHhggf457sMg55UWyeGKeUv0ucgvCpBwlR5cQ020i0MgzjPWOLWq1rtvSbNcAi2ZEVn6+Q2EcHo3wUvWRtLeKz+DZSZfw2PEDC+DGPJPl7f8g7zl56YymmmzH9liZLNrzg/qidokUv5u1pdGrcpLuPNeTODk0cqKB+OUbuKj9GShYECCEjaybJDl9276oalL9ghBtSeEv20kugatTvYy590wFlJkkvyl+nPxIH0EEYMKK9XRWlu9XYnoSfboiwcv8M3SlsjAgMBAAECggEAZtju/bcKvKFPz0mkHiaJcpycy9STKphorpCT83srBVQi59CdFU6Mj+aL/xt0kCPMVigJw8P3/YCEJ9J+rS8BsoWE+xWUEsJvtXoT7vzPHaAtM3ci1HZd302Mz1+GgS8Epdx+7F5p80XAFLDUnELzOzKftvWGZmWfSeDnslwVONkL/1VAzwKy7Ce6hk4SxRE7l2NE2OklSHOzCGU1f78ZzVYKSnS5Ag9YrGjOAmTOXDbKNKN/qIorAQ1bovzGoCwx3iGIatQKFOxyVCyO1PsJYT7JO+kZbhBWRRE+L7l+ppPER9bdLFxs1t5CrKc078h+wuUr05S1P1JjXk68pk3+kQKBgQDeK8AR11373Mzib6uzpjGzgNRMzdYNuExWjxyxAzz53NAR7zrPHvXvfIqjDScLJ4NcRO2TddhXAfZoOPVH5k4PJHKLBPKuXZpWlookCAyENY7+Pd55S8r+a+MusrMagYNljb5WbVTgN8cgdpim9lbbIFlpN6SZaVjLQL3J8TWH6wKBgQDSChzItkqWX11CNstJ9zJyUE20I7LrpyBJNgG1gtvz3ZMUQCn3PxxHtQzN9n1P0mSSYs+jBKPuoSyYLt1wwe10/lpgL4rkKWU3/m1Myt0tveJ9WcqHh6tzcAbb/fXpUFT/o4SWDimWkPkuCb+8j//2yiXk0a/T2f36zKMuZvujqQKBgC6B7BAQDG2H2B/ijofp12ejJU36nL98gAZyqOfpLJ+FeMz4TlBDQ+phIMhnHXA5UkdDapQ+zA3SrFk+6yGk9Vw4Hf46B+82SvOrSbmnMa+PYqKYIvUzR4gg34rL/7AhwnbEyD5hXq4dHwMNsIDq+l2elPjwm/U9V0gdAl2+r50HAoGALtsKqMvhv8HucAMBPrLikhXP/8um8mMKFMrzfqZ+otxfHzlhI0L08Bo3jQrb0Z7ByNY6M8epOmbCKADsbWcVre/AAY0ZkuSZK/CaOXNX/AhMKmKJh8qAOPRY02LIJRBCpfS4czEdnfUhYV/TYiFNnKRj57PPYZdTzUsxa/yVTmECgYBr7slQEjb5Onn5mZnGDh+72BxLNdgwBkhO0OCdpdISqk0F0Pxby22DFOKXZEpiyI9XYP1C8wPiJsShGm2yEwBPWXnrrZNWczaVuCbXHrZkWQogBDG3HGXNdU4MAWCyiYlyinIBpPpoAJZSzpGLmWbMWh28+RJS6AQX6KHrK1o2uw==" - }, - "Datastore": { - "Type": "", - "Path": "", - "StorageMax": "", - "StorageGCWatermark": 0, - "GCPeriod": "", - "Params": null, - "NoSync": false - }, - "Addresses": { - "Swarm": [ - "/ip4/0.0.0.0/tcp/4001", - "/ip6/::/tcp/4001" - ], - "API": "/ip4/127.0.0.1/tcp/5001", - "Gateway": "/ip4/127.0.0.1/tcp/8080" - }, - "Mounts": { - "IPFS": "/ipfs", - "IPNS": "/ipns", - "FuseAllowOther": false - }, - "Version": { - "Current": "0.4.0-dev", - "Check": "error", - "CheckDate": "0001-01-01T00:00:00Z", - "CheckPeriod": "172800000000000", - "AutoUpdate": "minor" - }, - "Discovery": { - "MDNS": { - "Enabled": true, - "Interval": 10 - } - }, - "Ipns": { - "RepublishPeriod": "", - "RecordLifetime": "", - "ResolveCacheSize": 128 - }, - "Bootstrap": [ - "/ip4/104.131.131.82/tcp/4001/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ", - "/ip4/104.236.176.52/tcp/4001/ipfs/QmSoLnSGccFuZQJzRadHn95W2CrSFmZuTdDWP8HXaHca9z", - "/ip4/104.236.179.241/tcp/4001/ipfs/QmSoLPppuBtQSGwKDZT2M73ULpjvfd3aZ6ha4oFGL1KrGM", - "/ip4/162.243.248.213/tcp/4001/ipfs/QmSoLueR4xBeUbY9WZ9xGUUxunbKWcrNFTDAadQJmocnWm", - "/ip4/128.199.219.111/tcp/4001/ipfs/QmSoLSafTMBsPKadTEgaXctDQVcqN88CNLHXMkTNwMKPnu", - "/ip4/104.236.76.40/tcp/4001/ipfs/QmSoLV4Bbm51jM9C4gDYZQ9Cy3U6aXMJDAbzgu2fzaDs64", - "/ip4/178.62.158.247/tcp/4001/ipfs/QmSoLer265NRgSp2LA3dPaeykiS1J6DifTC88f5uVQKNAd", - "/ip4/178.62.61.185/tcp/4001/ipfs/QmSoLMeWqB7YGVLJN3pNLQpmmEk35v6wYtsMGLzSr5QBU3", - "/ip4/104.236.151.122/tcp/4001/ipfs/QmSoLju6m7xTh3DuokvT3886QRYqxAzb1kShaanJgW36yx" - ], - "Tour": { - "Last": "" - }, - "Gateway": { - "HTTPHeaders": null, - "RootRedirect": "", - "Writable": false - }, - "SupernodeRouting": { - "Servers": [ - "/ip4/104.236.176.52/tcp/4002/ipfs/QmXdb7tWTxdFEQEFgWBqkuYSrZd3mXrC7HxkD4krGNYx2U", - "/ip4/104.236.179.241/tcp/4002/ipfs/QmVRqViDByUxjUMoPnjurjKvZhaEMFDtK35FJXHAM4Lkj6", - "/ip4/104.236.151.122/tcp/4002/ipfs/QmSZwGx8Tn8tmcM4PtDJaMeUQNRhNFdBLVGPzRiNaRJtFH", - "/ip4/162.243.248.213/tcp/4002/ipfs/QmbHVEEepCi7rn7VL7Exxpd2Ci9NNB6ifvqwhsrbRMgQFP", - "/ip4/128.199.219.111/tcp/4002/ipfs/Qmb3brdCYmKG1ycwqCbo6LUwWxTuo3FisnJV2yir7oN92R", - "/ip4/104.236.76.40/tcp/4002/ipfs/QmdRBCV8Cz2dGhoKLkD3YjPwVFECmqADQkx5ZteF2c6Fy4", - "/ip4/178.62.158.247/tcp/4002/ipfs/QmUdiMPci7YoEUBkyFZAh2pAbjqcPr7LezyiPD2artLw3v", - "/ip4/178.62.61.185/tcp/4002/ipfs/QmVw6fGNqBixZE4bewRLT2VXX7fAHUHs8JyidDiJ1P7RUN" - ] - }, - "API": { - "HTTPHeaders": null - }, - "Swarm": { - "AddrFilters": null - }, - "Log": { - "MaxSizeMB": 250, - "MaxBackups": 1, - "MaxAgeDays": 0 - } -} \ No newline at end of file +{"Identity":{"PeerID":"QmQ2zigjQikYnyYUSXZydNXrDRhBut2mubwJBaLXobMt3A","PrivKey":"CAASpgkwggSiAgEAAoIBAQC2SKo/HMFZeBml1AF3XijzrxrfQXdJzjePBZAbdxqKR1Mc6juRHXij6HXYPjlAk01BhF1S3Ll4Lwi0cAHhggf457sMg55UWyeGKeUv0ucgvCpBwlR5cQ020i0MgzjPWOLWq1rtvSbNcAi2ZEVn6+Q2EcHo3wUvWRtLeKz+DZSZfw2PEDC+DGPJPl7f8g7zl56YymmmzH9liZLNrzg/qidokUv5u1pdGrcpLuPNeTODk0cqKB+OUbuKj9GShYECCEjaybJDl9276oalL9ghBtSeEv20kugatTvYy590wFlJkkvyl+nPxIH0EEYMKK9XRWlu9XYnoSfboiwcv8M3SlsjAgMBAAECggEAZtju/bcKvKFPz0mkHiaJcpycy9STKphorpCT83srBVQi59CdFU6Mj+aL/xt0kCPMVigJw8P3/YCEJ9J+rS8BsoWE+xWUEsJvtXoT7vzPHaAtM3ci1HZd302Mz1+GgS8Epdx+7F5p80XAFLDUnELzOzKftvWGZmWfSeDnslwVONkL/1VAzwKy7Ce6hk4SxRE7l2NE2OklSHOzCGU1f78ZzVYKSnS5Ag9YrGjOAmTOXDbKNKN/qIorAQ1bovzGoCwx3iGIatQKFOxyVCyO1PsJYT7JO+kZbhBWRRE+L7l+ppPER9bdLFxs1t5CrKc078h+wuUr05S1P1JjXk68pk3+kQKBgQDeK8AR11373Mzib6uzpjGzgNRMzdYNuExWjxyxAzz53NAR7zrPHvXvfIqjDScLJ4NcRO2TddhXAfZoOPVH5k4PJHKLBPKuXZpWlookCAyENY7+Pd55S8r+a+MusrMagYNljb5WbVTgN8cgdpim9lbbIFlpN6SZaVjLQL3J8TWH6wKBgQDSChzItkqWX11CNstJ9zJyUE20I7LrpyBJNgG1gtvz3ZMUQCn3PxxHtQzN9n1P0mSSYs+jBKPuoSyYLt1wwe10/lpgL4rkKWU3/m1Myt0tveJ9WcqHh6tzcAbb/fXpUFT/o4SWDimWkPkuCb+8j//2yiXk0a/T2f36zKMuZvujqQKBgC6B7BAQDG2H2B/ijofp12ejJU36nL98gAZyqOfpLJ+FeMz4TlBDQ+phIMhnHXA5UkdDapQ+zA3SrFk+6yGk9Vw4Hf46B+82SvOrSbmnMa+PYqKYIvUzR4gg34rL/7AhwnbEyD5hXq4dHwMNsIDq+l2elPjwm/U9V0gdAl2+r50HAoGALtsKqMvhv8HucAMBPrLikhXP/8um8mMKFMrzfqZ+otxfHzlhI0L08Bo3jQrb0Z7ByNY6M8epOmbCKADsbWcVre/AAY0ZkuSZK/CaOXNX/AhMKmKJh8qAOPRY02LIJRBCpfS4czEdnfUhYV/TYiFNnKRj57PPYZdTzUsxa/yVTmECgYBr7slQEjb5Onn5mZnGDh+72BxLNdgwBkhO0OCdpdISqk0F0Pxby22DFOKXZEpiyI9XYP1C8wPiJsShGm2yEwBPWXnrrZNWczaVuCbXHrZkWQogBDG3HGXNdU4MAWCyiYlyinIBpPpoAJZSzpGLmWbMWh28+RJS6AQX6KHrK1o2uw=="},"Datastore":{"Type":"","Path":"","StorageMax":"","StorageGCWatermark":0,"GCPeriod":"","Params":null,"NoSync":false},"Addresses":{"Swarm":["/ip4/0.0.0.0/tcp/4001","/ip6/::/tcp/4001"],"API":"/ip4/127.0.0.1/tcp/5001","Gateway":"/ip4/127.0.0.1/tcp/8080"},"Mounts":{"IPFS":"/ipfs","IPNS":"/ipns","FuseAllowOther":false},"Version":{"Current":"0.4.0-dev","Check":"error","CheckDate":"0001-01-01T00:00:00Z","CheckPeriod":"172800000000000","AutoUpdate":"minor"},"Discovery":{"MDNS":{"Enabled":true,"Interval":10}},"Ipns":{"RepublishPeriod":"","RecordLifetime":"","ResolveCacheSize":128},"Bootstrap":["/ip4/104.131.131.82/tcp/4001/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ","/ip4/104.236.176.52/tcp/4001/ipfs/QmSoLnSGccFuZQJzRadHn95W2CrSFmZuTdDWP8HXaHca9z","/ip4/104.236.179.241/tcp/4001/ipfs/QmSoLPppuBtQSGwKDZT2M73ULpjvfd3aZ6ha4oFGL1KrGM","/ip4/162.243.248.213/tcp/4001/ipfs/QmSoLueR4xBeUbY9WZ9xGUUxunbKWcrNFTDAadQJmocnWm","/ip4/128.199.219.111/tcp/4001/ipfs/QmSoLSafTMBsPKadTEgaXctDQVcqN88CNLHXMkTNwMKPnu","/ip4/104.236.76.40/tcp/4001/ipfs/QmSoLV4Bbm51jM9C4gDYZQ9Cy3U6aXMJDAbzgu2fzaDs64","/ip4/178.62.158.247/tcp/4001/ipfs/QmSoLer265NRgSp2LA3dPaeykiS1J6DifTC88f5uVQKNAd","/ip4/178.62.61.185/tcp/4001/ipfs/QmSoLMeWqB7YGVLJN3pNLQpmmEk35v6wYtsMGLzSr5QBU3","/ip4/104.236.151.122/tcp/4001/ipfs/QmSoLju6m7xTh3DuokvT3886QRYqxAzb1kShaanJgW36yx"],"Tour":{"Last":""},"Gateway":{"HTTPHeaders":null,"RootRedirect":"","Writable":false},"SupernodeRouting":{"Servers":["/ip4/104.236.176.52/tcp/4002/ipfs/QmXdb7tWTxdFEQEFgWBqkuYSrZd3mXrC7HxkD4krGNYx2U","/ip4/104.236.179.241/tcp/4002/ipfs/QmVRqViDByUxjUMoPnjurjKvZhaEMFDtK35FJXHAM4Lkj6","/ip4/104.236.151.122/tcp/4002/ipfs/QmSZwGx8Tn8tmcM4PtDJaMeUQNRhNFdBLVGPzRiNaRJtFH","/ip4/162.243.248.213/tcp/4002/ipfs/QmbHVEEepCi7rn7VL7Exxpd2Ci9NNB6ifvqwhsrbRMgQFP","/ip4/128.199.219.111/tcp/4002/ipfs/Qmb3brdCYmKG1ycwqCbo6LUwWxTuo3FisnJV2yir7oN92R","/ip4/104.236.76.40/tcp/4002/ipfs/QmdRBCV8Cz2dGhoKLkD3YjPwVFECmqADQkx5ZteF2c6Fy4","/ip4/178.62.158.247/tcp/4002/ipfs/QmUdiMPci7YoEUBkyFZAh2pAbjqcPr7LezyiPD2artLw3v","/ip4/178.62.61.185/tcp/4002/ipfs/QmVw6fGNqBixZE4bewRLT2VXX7fAHUHs8JyidDiJ1P7RUN"]},"API":{"HTTPHeaders":null},"Swarm":{"AddrFilters":null},"Log":{"MaxSizeMB":250,"MaxBackups":1,"MaxAgeDays":0}} \ No newline at end of file diff --git a/tests/test-core/test-bootstrap.js b/tests/test-core/test-bootstrap.js index 2a0043c5a7..9566401b15 100644 --- a/tests/test-core/test-bootstrap.js +++ b/tests/test-core/test-bootstrap.js @@ -8,31 +8,60 @@ process.env.IPFS_PATH = process.cwd() + '/tests/repo-example' const IPFS = require('../../src/ipfs-core') describe('bootstrap', () => { + const ipfs = new IPFS() + + const defaultList = [ + '/ip4/104.131.131.82/tcp/4001/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ', + '/ip4/104.236.176.52/tcp/4001/ipfs/QmSoLnSGccFuZQJzRadHn95W2CrSFmZuTdDWP8HXaHca9z', + '/ip4/104.236.179.241/tcp/4001/ipfs/QmSoLPppuBtQSGwKDZT2M73ULpjvfd3aZ6ha4oFGL1KrGM', + '/ip4/162.243.248.213/tcp/4001/ipfs/QmSoLueR4xBeUbY9WZ9xGUUxunbKWcrNFTDAadQJmocnWm', + '/ip4/128.199.219.111/tcp/4001/ipfs/QmSoLSafTMBsPKadTEgaXctDQVcqN88CNLHXMkTNwMKPnu', + '/ip4/104.236.76.40/tcp/4001/ipfs/QmSoLV4Bbm51jM9C4gDYZQ9Cy3U6aXMJDAbzgu2fzaDs64', + '/ip4/178.62.158.247/tcp/4001/ipfs/QmSoLer265NRgSp2LA3dPaeykiS1J6DifTC88f5uVQKNAd', + '/ip4/178.62.61.185/tcp/4001/ipfs/QmSoLMeWqB7YGVLJN3pNLQpmmEk35v6wYtsMGLzSr5QBU3', + '/ip4/104.236.151.122/tcp/4001/ipfs/QmSoLju6m7xTh3DuokvT3886QRYqxAzb1kShaanJgW36yx' + ] + + const updatedList = [ + '/ip4/104.131.131.82/tcp/4001/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ', + '/ip4/104.236.176.52/tcp/4001/ipfs/QmSoLnSGccFuZQJzRadHn95W2CrSFmZuTdDWP8HXaHca9z', + '/ip4/104.236.179.241/tcp/4001/ipfs/QmSoLPppuBtQSGwKDZT2M73ULpjvfd3aZ6ha4oFGL1KrGM', + '/ip4/162.243.248.213/tcp/4001/ipfs/QmSoLueR4xBeUbY9WZ9xGUUxunbKWcrNFTDAadQJmocnWm', + '/ip4/128.199.219.111/tcp/4001/ipfs/QmSoLSafTMBsPKadTEgaXctDQVcqN88CNLHXMkTNwMKPnu', + '/ip4/104.236.76.40/tcp/4001/ipfs/QmSoLV4Bbm51jM9C4gDYZQ9Cy3U6aXMJDAbzgu2fzaDs64', + '/ip4/178.62.158.247/tcp/4001/ipfs/QmSoLer265NRgSp2LA3dPaeykiS1J6DifTC88f5uVQKNAd', + '/ip4/178.62.61.185/tcp/4001/ipfs/QmSoLMeWqB7YGVLJN3pNLQpmmEk35v6wYtsMGLzSr5QBU3', + '/ip4/104.236.151.122/tcp/4001/ipfs/QmSoLju6m7xTh3DuokvT3886QRYqxAzb1kShaanJgW36yx', + '/ip4/111.111.111.111/tcp/1001/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLUVIT' + ] + it('get bootstrap list', done => { - let ipfs = new IPFS() ipfs.bootstrap.list((err, list) => { expect(err).to.not.exist - let defaultList = [ - '/ip4/104.131.131.82/tcp/4001/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ', - '/ip4/104.236.176.52/tcp/4001/ipfs/QmSoLnSGccFuZQJzRadHn95W2CrSFmZuTdDWP8HXaHca9z', - '/ip4/104.236.179.241/tcp/4001/ipfs/QmSoLPppuBtQSGwKDZT2M73ULpjvfd3aZ6ha4oFGL1KrGM', - '/ip4/162.243.248.213/tcp/4001/ipfs/QmSoLueR4xBeUbY9WZ9xGUUxunbKWcrNFTDAadQJmocnWm', - '/ip4/128.199.219.111/tcp/4001/ipfs/QmSoLSafTMBsPKadTEgaXctDQVcqN88CNLHXMkTNwMKPnu', - '/ip4/104.236.76.40/tcp/4001/ipfs/QmSoLV4Bbm51jM9C4gDYZQ9Cy3U6aXMJDAbzgu2fzaDs64', - '/ip4/178.62.158.247/tcp/4001/ipfs/QmSoLer265NRgSp2LA3dPaeykiS1J6DifTC88f5uVQKNAd', - '/ip4/178.62.61.185/tcp/4001/ipfs/QmSoLMeWqB7YGVLJN3pNLQpmmEk35v6wYtsMGLzSr5QBU3', - '/ip4/104.236.151.122/tcp/4001/ipfs/QmSoLju6m7xTh3DuokvT3886QRYqxAzb1kShaanJgW36yx' - ] expect(list).to.deep.equal(defaultList) done() }) }) - it.skip('add a peer to the bootstrap list', done => { - done() + it('add a peer to the bootstrap list', done => { + ipfs.bootstrap.add('/ip4/111.111.111.111/tcp/1001/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLUVIT', err => { + expect(err).to.not.exist + ipfs.bootstrap.list((err, list) => { + expect(err).to.not.exist + expect(list).to.deep.equal(updatedList) + done() + }) + }) }) - it.skip('remove a peer from the bootstrap list', done => { - done() + it('remove a peer from the bootstrap list', done => { + ipfs.bootstrap.rm('/ip4/111.111.111.111/tcp/1001/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLUVIT', err => { + expect(err).to.not.exist + ipfs.bootstrap.list((err, list) => { + expect(err).to.not.exist + expect(list).to.deep.equal(defaultList) + done() + }) + }) }) }) From 292e75f6214e9bcd44d499c2bbf650d2845504f9 Mon Sep 17 00:00:00 2001 From: David Dias Date: Sat, 9 Jan 2016 23:48:35 +0100 Subject: [PATCH 4/8] refresh repo for each battery of tests --- src/ipfs-core/config.js | 4 +- src/ipfs-core/index.js | 2 +- ...c55d25f3042c22501e41d1246e7a1e9d3d8ec.data | 28 +++++ ...dcf095c1d219356cdf538ffce705a52d5738d.data | Bin 0 -> 10765 bytes ...ea3b310512d7767a9abfbd7a928a85e977173.data | 4 + ...0b0d3be3528fbbcc814feb7f2fbf71ca06162.data | Bin 0 -> 10807 bytes ...60e64383755a8c5163ba3c053c3b65777ed16.data | 4 + ...ccadfda3d8bc7d2f8cdf302aa51dae8dae9da.data | Bin 0 -> 10891 bytes ...223c2d96a9f70b5fd8b1d513f8c5b69dcaed4.data | 23 ++++ ...932be52c56d99c5966b65e0111239f098bbef.data | 2 + ...3346a644605d7614dca53cd3a59f7385a8abb.data | 114 ++++++++++++++++++ ...7f28fa9367ee167c312e6d65a2e02e81ab815.data | Bin 0 -> 10765 bytes ...68af3d10e1a497971629c07606bfdb812303d.data | Bin 0 -> 309 bytes ...02a72b057d1c7f2e682d0776a5363e2cca974.data | 3 + ...16cfa9a7ae5533f8e997cdab2ebadd7506340.data | 4 + ...e5cf3497a7845ee8f94456ccf4d1d2f6602b5.data | 24 ++++ ...c0f1e4947cff8e422610996e609dbcb976598.data | 9 ++ ...62f687a00c638bcb580feae06452e0c1f20b4.data | 8 ++ ...56baef91c7dc345e73d049ab570abe10dfbb9.data | Bin 0 -> 10849 bytes ...2fdadf9d45666c3be122a2efb5db93c1d5fa6.data | 55 +++++++++ ...be72a83e80f9c7bca1abcaa42298a57a33ff5.data | Bin 0 -> 101 bytes ...fb92427ae41e4649b934ca495991b7852b855.data | 0 ...41317afc9f967abe2aa05e7c641f7bbe98a37.data | Bin 0 -> 10765 bytes ...807def07b0db2f018808620eb30b980e94011.data | 3 + ...38b95dd29d31eac6433af0fb6fcd83dd80778.data | 3 + tests/repo-tests1452379313131/config | 1 + .../datastore/000002.ldb | Bin 0 -> 211 bytes .../datastore/000005.ldb | Bin 0 -> 1120 bytes .../repo-tests1452379313131/datastore/CURRENT | 1 + tests/repo-tests1452379313131/datastore/LOCK | 0 tests/repo-tests1452379313131/datastore/LOG | 10 ++ .../repo-tests1452379313131/datastore/LOG.old | 10 ++ .../datastore/MANIFEST-000007 | Bin 0 -> 293 bytes tests/repo-tests1452379313131/version | 1 + tests/test-api/index.js | 19 ++- tests/test-api/test-version.js | 1 + tests/test-cli-offline/index.js | 27 ++++- tests/test-cli/index.js | 27 ++++- tests/test-core/index.js | 27 ++++- 39 files changed, 399 insertions(+), 15 deletions(-) create mode 100644 tests/repo-tests1452379313131/blocks/1220120f/1220120f6af601d46e10b2d2e11ed71c55d25f3042c22501e41d1246e7a1e9d3d8ec.data create mode 100644 tests/repo-tests1452379313131/blocks/122031d6/122031d6da265092f1b03fec969243fdcf095c1d219356cdf538ffce705a52d5738d.data create mode 100644 tests/repo-tests1452379313131/blocks/122031e7/122031e7a41c15d03feb8cd793c3348ea3b310512d7767a9abfbd7a928a85e977173.data create mode 100644 tests/repo-tests1452379313131/blocks/12203628/12203628a4a19525dd84bbbffe132ec0b0d3be3528fbbcc814feb7f2fbf71ca06162.data create mode 100644 tests/repo-tests1452379313131/blocks/12204a5a/12204a5a95586f52e25811cf214677160e64383755a8c5163ba3c053c3b65777ed16.data create mode 100644 tests/repo-tests1452379313131/blocks/12205200/12205200cc6b6f79e1588480d9f9016ccadfda3d8bc7d2f8cdf302aa51dae8dae9da.data create mode 100644 tests/repo-tests1452379313131/blocks/122052c6/122052c63c7775396b3f82c639977a7223c2d96a9f70b5fd8b1d513f8c5b69dcaed4.data create mode 100644 tests/repo-tests1452379313131/blocks/12205994/122059948439065f29619ef41280cbb932be52c56d99c5966b65e0111239f098bbef.data create mode 100644 tests/repo-tests1452379313131/blocks/122062ce/122062ce1f2c91a13a97b596e873b5a3346a644605d7614dca53cd3a59f7385a8abb.data create mode 100644 tests/repo-tests1452379313131/blocks/12206781/122067817186b8ff365c758f387e3ae7f28fa9367ee167c312e6d65a2e02e81ab815.data create mode 100644 tests/repo-tests1452379313131/blocks/12207028/122070286b9afa6620a66f715c7020d68af3d10e1a497971629c07606bfdb812303d.data create mode 100644 tests/repo-tests1452379313131/blocks/1220709b/1220709b2dcc5f6a90ad64d6fe3a5d202a72b057d1c7f2e682d0776a5363e2cca974.data create mode 100644 tests/repo-tests1452379313131/blocks/12207fb8/12207fb898b5d7be46d85feb75d894e16cfa9a7ae5533f8e997cdab2ebadd7506340.data create mode 100644 tests/repo-tests1452379313131/blocks/12208b87/12208b872ca4ee517608331696dd6b3e5cf3497a7845ee8f94456ccf4d1d2f6602b5.data create mode 100644 tests/repo-tests1452379313131/blocks/122090c0/122090c07a7795c1193510a696d1fdfc0f1e4947cff8e422610996e609dbcb976598.data create mode 100644 tests/repo-tests1452379313131/blocks/1220929a/1220929a303c39da8a0b67c09697462f687a00c638bcb580feae06452e0c1f20b4.data create mode 100644 tests/repo-tests1452379313131/blocks/1220933b/1220933b41d37fd4508cdff45930dff56baef91c7dc345e73d049ab570abe10dfbb9.data create mode 100644 tests/repo-tests1452379313131/blocks/1220a52c/1220a52c3602030cb912edfe4de97002fdadf9d45666c3be122a2efb5db93c1d5fa6.data create mode 100644 tests/repo-tests1452379313131/blocks/1220c0fc/1220c0fc6b49543d7bf04e83d2a5a7cbe72a83e80f9c7bca1abcaa42298a57a33ff5.data create mode 100644 tests/repo-tests1452379313131/blocks/1220e3b0/1220e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855.data create mode 100644 tests/repo-tests1452379313131/blocks/1220e605/1220e605408ac3f78113ac9a7fd486441317afc9f967abe2aa05e7c641f7bbe98a37.data create mode 100644 tests/repo-tests1452379313131/blocks/1220e6a0/1220e6a045864ff8569e43e4866c0af807def07b0db2f018808620eb30b980e94011.data create mode 100644 tests/repo-tests1452379313131/blocks/1220ec5b/1220ec5b533a3218991f4377b8b8c2538b95dd29d31eac6433af0fb6fcd83dd80778.data create mode 100644 tests/repo-tests1452379313131/config create mode 100644 tests/repo-tests1452379313131/datastore/000002.ldb create mode 100644 tests/repo-tests1452379313131/datastore/000005.ldb create mode 100644 tests/repo-tests1452379313131/datastore/CURRENT create mode 100644 tests/repo-tests1452379313131/datastore/LOCK create mode 100644 tests/repo-tests1452379313131/datastore/LOG create mode 100644 tests/repo-tests1452379313131/datastore/LOG.old create mode 100644 tests/repo-tests1452379313131/datastore/MANIFEST-000007 create mode 100644 tests/repo-tests1452379313131/version diff --git a/src/ipfs-core/config.js b/src/ipfs-core/config.js index 5a29168d0b..6f4b6ed266 100644 --- a/src/ipfs-core/config.js +++ b/src/ipfs-core/config.js @@ -4,4 +4,6 @@ const os = require('os') exports = module.exports -exports.repoPath = process.env.IPFS_PATH || os.homedir() + '/.ipfs' +exports.repoPath = function () { + return process.env.IPFS_PATH || os.homedir() + '/.ipfs' +} diff --git a/src/ipfs-core/index.js b/src/ipfs-core/index.js index abd0d2ed95..7895ad99b9 100644 --- a/src/ipfs-core/index.js +++ b/src/ipfs-core/index.js @@ -11,7 +11,7 @@ function IPFS () { throw new Error('Must be instantiated with new') } - var repo = new IPFSRepo(config.repoPath) + var repo = new IPFSRepo(config.repoPath()) this.daemon = callback => { // 1. read repo to get peer data diff --git a/tests/repo-tests1452379313131/blocks/1220120f/1220120f6af601d46e10b2d2e11ed71c55d25f3042c22501e41d1246e7a1e9d3d8ec.data b/tests/repo-tests1452379313131/blocks/1220120f/1220120f6af601d46e10b2d2e11ed71c55d25f3042c22501e41d1246e7a1e9d3d8ec.data new file mode 100644 index 0000000000..389e111776 --- /dev/null +++ b/tests/repo-tests1452379313131/blocks/1220120f/1220120f6af601d46e10b2d2e11ed71c55d25f3042c22501e41d1246e7a1e9d3d8ec.data @@ -0,0 +1,28 @@ + +Hello and Welcome to IPFS! + +██╗██████╗ ███████╗███████╗ +██║██╔══██╗██╔════╝██╔════╝ +██║██████╔╝█████╗ ███████╗ +██║██╔═══╝ ██╔══╝ ╚════██║ +██║██║ ██║ ███████║ +╚═╝╚═╝ ╚═╝ ╚══════╝ + +If you're seeing this, you have successfully installed +IPFS and are now interfacing with the ipfs merkledag! + + ------------------------------------------------------- +| Warning: | +| This is alpha software. Use at your own discretion! | +| Much is missing or lacking polish. There are bugs. | +| Not yet secure. Read the security notes for more. | + ------------------------------------------------------- + +Check out some of the other files in this directory: + + ./about + ./help + ./quick-start <-- usage examples + ./readme <-- this file + ./security-notes + \ No newline at end of file diff --git a/tests/repo-tests1452379313131/blocks/122031d6/122031d6da265092f1b03fec969243fdcf095c1d219356cdf538ffce705a52d5738d.data b/tests/repo-tests1452379313131/blocks/122031d6/122031d6da265092f1b03fec969243fdcf095c1d219356cdf538ffce705a52d5738d.data new file mode 100644 index 0000000000000000000000000000000000000000..5ea0edda6f82982c276a4a3813a50c0e35121c68 GIT binary patch literal 10765 zcmeIzF%AJy6a~;Rm3)!Nk3xb(CK9$mt(wFR^jf72s6=9D)srdd6*gc6EI~I4+fbbT zRX6Y66Q?1IqgQpGAHRd{ss22Q^=&*UXYbW{zqlNV{wBXJW712aODXvf?XV11kq9)T zAq{CrLmJYMhBTxh4QWV28q$!4G^8O7X-GpF(vXHUq#+GyNJARZkcKp*;U8!iTA|tK KY}4Vho$h|}9P~&4 literal 0 HcmV?d00001 diff --git a/tests/repo-tests1452379313131/blocks/122031e7/122031e7a41c15d03feb8cd793c3348ea3b310512d7767a9abfbd7a928a85e977173.data b/tests/repo-tests1452379313131/blocks/122031e7/122031e7a41c15d03feb8cd793c3348ea3b310512d7767a9abfbd7a928a85e977173.data new file mode 100644 index 0000000000..ecce1053f6 --- /dev/null +++ b/tests/repo-tests1452379313131/blocks/122031e7/122031e7a41c15d03feb8cd793c3348ea3b310512d7767a9abfbd7a928a85e977173.data @@ -0,0 +1,4 @@ +5 +" ׾F_uؔlzS?|ڲPc@ js-ipfs-repo + + \ No newline at end of file diff --git a/tests/repo-tests1452379313131/blocks/12203628/12203628a4a19525dd84bbbffe132ec0b0d3be3528fbbcc814feb7f2fbf71ca06162.data b/tests/repo-tests1452379313131/blocks/12203628/12203628a4a19525dd84bbbffe132ec0b0d3be3528fbbcc814feb7f2fbf71ca06162.data new file mode 100644 index 0000000000000000000000000000000000000000..bbe6bda78d0a52f6d87da578f452d43718b9aa9f GIT binary patch literal 10807 zcmeI&tqQ_m6vpvsQC>mhU=TmxWeCpZ4H&eDU=nNw5wR?6Yue0K5w>X*qZns5SS{Xw z-hn1RK)egXzn^qC&+{usEMq~6w(px+ cb8FMhello + ipfs add hello + + +View it: + + ipfs cat + + +Try a directory: + + mkdir foo + mkdir foo/bar + echo "baz" > foo/baz + echo "baz" > foo/bar/baz + ipfs add -r foo + + +View things: + + ipfs ls + ipfs ls /bar + ipfs cat /baz + ipfs cat /bar/baz + ipfs cat /bar + ipfs ls /baz + + +References: + + ipfs refs + ipfs refs -r + ipfs refs --help + + +Get: + + ipfs get foo2 + diff foo foo2 + + +Objects: + + ipfs object get + ipfs object get /foo2 + ipfs object --help + + +Pin + GC: + + ipfs pin -r + ipfs gc + ipfs ls + ipfs unpin -r + ipfs gc + + +Daemon: + + ipfs daemon (in another terminal) + ipfs id + + +Network: + + (must be online) + ipfs swarm peers + ipfs id + ipfs cat + + +Mount: + + (warning: fuse is finicky!) + ipfs mount + cd /ipfs/< + + +Tool: + + ipfs version + ipfs update + ipfs commands + ipfs config --help + open http://localhost:5001/webui + + +Browse: + + webui: + + http://localhost:5001/webui + + video: + + http://localhost:8080/ipfs/QmVc6zuAneKJzicnJpfrqCH9gSy6bz54JhcypfJYhGUFQu/play#/ipfs/QmTKZgRNwDNZwHtJSjCp6r5FYefzpULfy37JvMt9DwvXse + + images: + + http://localhost:8080/ipfs/QmZpc3HvfjEXvLWGQPWbHk3AjD5j8NEN4gmFN8Jmrd5g83/cs + + markdown renderer app: + + http://localhost:8080/ipfs/QmX7M9CiYXjVeFnkfVGf3y5ixTZ2ACeSGyL1vBJY1HvQPp/mdown + \ No newline at end of file diff --git a/tests/repo-tests1452379313131/blocks/12206781/122067817186b8ff365c758f387e3ae7f28fa9367ee167c312e6d65a2e02e81ab815.data b/tests/repo-tests1452379313131/blocks/12206781/122067817186b8ff365c758f387e3ae7f28fa9367ee167c312e6d65a2e02e81ab815.data new file mode 100644 index 0000000000000000000000000000000000000000..a8f98693b7d4797d0a55704b16c15a6aa7d34bd5 GIT binary patch literal 10765 zcmeIzF%AJy6a~Szz&}ww{ J&EYejEr0X~^v?hQ literal 0 HcmV?d00001 diff --git a/tests/repo-tests1452379313131/blocks/12207028/122070286b9afa6620a66f715c7020d68af3d10e1a497971629c07606bfdb812303d.data b/tests/repo-tests1452379313131/blocks/12207028/122070286b9afa6620a66f715c7020d68af3d10e1a497971629c07606bfdb812303d.data new file mode 100644 index 0000000000000000000000000000000000000000..74de75af616ff437b5c7a3a5272281eac2146b6c GIT binary patch literal 309 zcmWgA<5Ch*SgK>j#LTl(=mjz6J*Z#Z`mUeibke1%>*qt`A@ymo*6O-~wOC)CS z3K@XZPnu<5V|lBKJN>}4>2CTNRSd^0_H1qVw~ozKk4Ii%i@p$ha(-S(VseSZ2}U7Z zkd6rls>-Jxlr$AsHtpiyKm2l@?&p6zQA*^T_KfrP>FKF6gjh0Ca|$F5F$tM~lqa2& z*O|D`YWmh`FN(J=HpxnHW4)f}dn)*>RpfVzsIJ{Y+=Zo?$=SNaC5c5P5({~S^g+6W z__Mw-Uda>Kbm^hob(zph@di$ZR2iSh3b{RB`110NH$rShsfj7MsS@Wngv>!2f{xjg zms)1qHyyK_UR9)g=w{aZf~|kMWdrSdqBHNTyCTF_oSIx(lvz@#o0ngbS}f7b!NtVE F2moEFc%uLS literal 0 HcmV?d00001 diff --git a/tests/repo-tests1452379313131/blocks/1220709b/1220709b2dcc5f6a90ad64d6fe3a5d202a72b057d1c7f2e682d0776a5363e2cca974.data b/tests/repo-tests1452379313131/blocks/1220709b/1220709b2dcc5f6a90ad64d6fe3a5d202a72b057d1c7f2e682d0776a5363e2cca974.data new file mode 100644 index 0000000000..3a99c365f0 --- /dev/null +++ b/tests/repo-tests1452379313131/blocks/1220709b/1220709b2dcc5f6a90ad64d6fe3a5d202a72b057d1c7f2e682d0776a5363e2cca974.data @@ -0,0 +1,3 @@ +4 +" Y9_)a˹2RmŖke9 js-ipfs-repo + \ No newline at end of file diff --git a/tests/repo-tests1452379313131/blocks/12207fb8/12207fb898b5d7be46d85feb75d894e16cfa9a7ae5533f8e997cdab2ebadd7506340.data b/tests/repo-tests1452379313131/blocks/12207fb8/12207fb898b5d7be46d85feb75d894e16cfa9a7ae5533f8e997cdab2ebadd7506340.data new file mode 100644 index 0000000000..ee87b9db01 --- /dev/null +++ b/tests/repo-tests1452379313131/blocks/12207fb8/12207fb898b5d7be46d85feb75d894e16cfa9a7ae5533f8e997cdab2ebadd7506340.data @@ -0,0 +1,4 @@ +0 +" ,Qv3k>\IzxEElM/fLICENSE1 +" JZXoRX!Fwd87U;SöWw README.md{ + \ No newline at end of file diff --git a/tests/repo-tests1452379313131/blocks/12208b87/12208b872ca4ee517608331696dd6b3e5cf3497a7845ee8f94456ccf4d1d2f6602b5.data b/tests/repo-tests1452379313131/blocks/12208b87/12208b872ca4ee517608331696dd6b3e5cf3497a7845ee8f94456ccf4d1d2f6602b5.data new file mode 100644 index 0000000000..3da92595c2 --- /dev/null +++ b/tests/repo-tests1452379313131/blocks/12208b87/12208b872ca4ee517608331696dd6b3e5cf3497a7845ee8f94456ccf4d1d2f6602b5.data @@ -0,0 +1,24 @@ + +The MIT License (MIT) + +Copyright (c) 2015 IPFS + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + \ No newline at end of file diff --git a/tests/repo-tests1452379313131/blocks/122090c0/122090c07a7795c1193510a696d1fdfc0f1e4947cff8e422610996e609dbcb976598.data b/tests/repo-tests1452379313131/blocks/122090c0/122090c07a7795c1193510a696d1fdfc0f1e4947cff8e422610996e609dbcb976598.data new file mode 100644 index 0000000000..71be805f1e --- /dev/null +++ b/tests/repo-tests1452379313131/blocks/122090c0/122090c07a7795c1193510a696d1fdfc0f1e4947cff8e422610996e609dbcb976598.data @@ -0,0 +1,9 @@ + +Some helpful resources for finding your way around ipfs: + +- quick-start: a quick show of various ipfs features. +- ipfs commands: a list of all commands +- ipfs --help: every command describes itself +- https://github.com/ipfs/go-ipfs -- the src repository +- #ipfs on irc.freenode.org -- the community irc channel + \ No newline at end of file diff --git a/tests/repo-tests1452379313131/blocks/1220929a/1220929a303c39da8a0b67c09697462f687a00c638bcb580feae06452e0c1f20b4.data b/tests/repo-tests1452379313131/blocks/1220929a/1220929a303c39da8a0b67c09697462f687a00c638bcb580feae06452e0c1f20b4.data new file mode 100644 index 0000000000..62d1c2979b --- /dev/null +++ b/tests/repo-tests1452379313131/blocks/1220929a/1220929a303c39da8a0b67c09697462f687a00c638bcb580feae06452e0c1f20b4.data @@ -0,0 +1,8 @@ + +Come hang out in our IRC chat room if you have any questions. + +Contact the ipfs dev team: +- Bugs: https://github.com/ipfs/go-ipfs/issues +- Help: irc.freenode.org/#ipfs +- Email: dev@ipfs.io + \ No newline at end of file diff --git a/tests/repo-tests1452379313131/blocks/1220933b/1220933b41d37fd4508cdff45930dff56baef91c7dc345e73d049ab570abe10dfbb9.data b/tests/repo-tests1452379313131/blocks/1220933b/1220933b41d37fd4508cdff45930dff56baef91c7dc345e73d049ab570abe10dfbb9.data new file mode 100644 index 0000000000000000000000000000000000000000..d899663bf7a13bb0563304b1d96985a784c2d515 GIT binary patch literal 10849 zcmWgA;8GG&c)a0=(~LhdBC~#fIWaSTr;7SI$0sSXC;Kd!I#aqLXh*0Jg9L-nsLIh$ z8ciXixns0s7%de?YlP9-aI`iYtqn(O!_nGsv^E^A4M%Ik(b{mdHXN-DM{C2;+HkZs z9IXvUYs1mnaI`iYtqn(O!_nGsv^E^A4M%Ik(b{mdHXN-DM{C2;+HkZs9IXvUYs1mn zaI`iYG__&mlom_2c+JFlUxXS??=;#MbToJ7(P`PK4+MoQKg`(u9` +- browsers or extensions can learn to use `ipfs://` directly +- hash-addressed content guarantees authenticity + +IPFS is modular: +- connection layer over any network protocol +- routing layer +- uses a routing layer DHT (kademlia/coral) +- uses a path-based naming service +- uses bittorrent-inspired block exchange + +IPFS uses crypto: +- cryptographic-hash content addressing +- block-level deduplication +- file integrity + versioning +- filesystem-level encryption + signing support + +IPFS is p2p: +- worldwide peer-to-peer file transfers +- completely decentralized architecture +- **no** central point of failure + +IPFS is a cdn: +- add a file to the filesystem locally, and it's now available to the world +- caching-friendly (content-hash naming) +- bittorrent-based bandwidth distribution + +IPFS has a name service: +- IPNS, an SFS inspired name system +- global namespace based on PKI +- serves to build trust chains +- compatible with other NSes +- can map DNS, .onion, .bit, etc to IPNS + \ No newline at end of file diff --git a/tests/repo-tests1452379313131/blocks/1220c0fc/1220c0fc6b49543d7bf04e83d2a5a7cbe72a83e80f9c7bca1abcaa42298a57a33ff5.data b/tests/repo-tests1452379313131/blocks/1220c0fc/1220c0fc6b49543d7bf04e83d2a5a7cbe72a83e80f9c7bca1abcaa42298a57a33ff5.data new file mode 100644 index 0000000000000000000000000000000000000000..c9885c45d7e7c10d02b98208d40cfd7b8bfaed21 GIT binary patch literal 101 zcmWgA=TZ_+Kwo-;;PadOz%uNME$6+{JHE$$U!OUW!sO)in> z4G}T|X$WFClbv7rFrua5=1<0)Q}=J#b|1g=FJWY200SX~$SEzBZ1I|j^S%f*oZe})FX(9Q%%jt? zQy&NlS$>$Y`#n34QbA^3F(V^P!?OjhZT>&P<~cuU%i;RLe(ysy@1_qD4Q&dq4R$uX zbPxoo11sKKRu>QF9Qd?w0|O_M0pouNU?_u2-8}VndNoG}qZmkp00{rx(5+JHej5PO CoIXSV literal 0 HcmV?d00001 diff --git a/tests/repo-tests1452379313131/datastore/000005.ldb b/tests/repo-tests1452379313131/datastore/000005.ldb new file mode 100644 index 0000000000000000000000000000000000000000..63d9d260b936415ee42b5aeda6c79fb941664398 GIT binary patch literal 1120 zcmZQDSjViNS&&z(FQg!8*qs;0^V3RMWIveo0t|Brg#j3VRkisv@!=|IgJvNC_dNx9y@%e`@arzW`upR#0^RR3Lu1P3 zgny1+s9JOHtH$|N^V2^pIaU+*`j0Vdf^UEA=Y(L*NL7==e45ubJUDbI<}5@1nZ5i@ zU-f@onB_6=BHQa-tVc_VRZiT0AST5ib<){%%1r}PkJe@8+6(<3{`CFeMP?prC*c znwwdgM`+7O$B&?~72w>77RV zf{y0SJUT5q^?{&}<%b!&-?Q^56=dcWGqS)myonCBGLo1n?_9oP$D!cvsdqIm%dJT< zUeCYn&kfrf>=lfOBoQtW6k&$7W$0~c7gOL@IORq4N$7y_CFLmFs-1D4yKkEePa;Yx&V3}9e z6J;wFzbL(7XX!B6*Rdrw=+4dxeU2>!j1QaGe>~sK(>yOETD?v4ss5$s3VXC14~0|~ z@|s=JZrGS)y@`hY)f%XfBnQv@ZgL4too7C-W6;9@lKgp&)Y9xu#YGC zq+Q(oPkf)J&zo^7bJ>~t)Xqs~*IU@HQqP#^{d0FztkiZ*y~k%OjhiRCYiY>$1@7+Z zzc{J2k%`0O*2zuI)9>zn)wWdsh9cXQc|w1;OnM=;)%wQi`6UM;Jtuj8n*Q?qk;X3q zZaf<6!(B7;zLu#kRKLAQM`r(FbFXM+CT2zkqS6H@{24)n$QSJzIOo8pg&P<+nGG2K hLjXe)2VAZvSyQK-gJTMZI7kRT2>;#Cty1cK8vstu!bkuB literal 0 HcmV?d00001 diff --git a/tests/repo-tests1452379313131/datastore/CURRENT b/tests/repo-tests1452379313131/datastore/CURRENT new file mode 100644 index 0000000000..875cf23355 --- /dev/null +++ b/tests/repo-tests1452379313131/datastore/CURRENT @@ -0,0 +1 @@ +MANIFEST-000007 diff --git a/tests/repo-tests1452379313131/datastore/LOCK b/tests/repo-tests1452379313131/datastore/LOCK new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/repo-tests1452379313131/datastore/LOG b/tests/repo-tests1452379313131/datastore/LOG new file mode 100644 index 0000000000..863b68fd57 --- /dev/null +++ b/tests/repo-tests1452379313131/datastore/LOG @@ -0,0 +1,10 @@ +=============== Dec 10, 2015 (PST) =============== +07:50:02.056578 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +07:50:02.057231 db@open opening +07:50:02.057312 journal@recovery F·1 +07:50:02.057514 journal@recovery recovering @3 +07:50:02.058921 mem@flush created L0@5 N·4 S·1KiB "/ip..\xf6\xe4\xa9,v5":"/pk..\xf6\xe4\xa9,v6" +07:50:02.059983 db@janitor F·4 G·0 +07:50:02.060001 db@open done T·2.755926ms +07:50:02.073183 db@close closing +07:50:02.073285 db@close done T·97.522µs diff --git a/tests/repo-tests1452379313131/datastore/LOG.old b/tests/repo-tests1452379313131/datastore/LOG.old new file mode 100644 index 0000000000..708351e772 --- /dev/null +++ b/tests/repo-tests1452379313131/datastore/LOG.old @@ -0,0 +1,10 @@ +=============== Dec 10, 2015 (PST) =============== +07:49:57.048841 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +07:49:57.049014 db@open opening +07:49:57.049066 journal@recovery F·1 +07:49:57.049233 journal@recovery recovering @1 +07:49:57.049693 mem@flush created L0@2 N·2 S·211B "/lo..oot,v2":"/lo..ins,v1" +07:49:57.050381 db@janitor F·3 G·0 +07:49:57.050397 db@open done T·1.375431ms +07:49:57.064580 db@close closing +07:49:57.064655 db@close done T·72.59µs diff --git a/tests/repo-tests1452379313131/datastore/MANIFEST-000007 b/tests/repo-tests1452379313131/datastore/MANIFEST-000007 new file mode 100644 index 0000000000000000000000000000000000000000..6af3b5450fb46c2d16258f242969f0d88dfa5892 GIT binary patch literal 293 zcmbOjutG$Rk&#g { + const repoExample = process.cwd() + '/tests/repo-example' + const repoTests = process.cwd() + '/tests/repo-tests' + Date.now() + process.env.IPFS_PATH = repoTests + before(done => { - api.start(err => { + ncp(repoExample, repoTests, err => { expect(err).to.not.exist - done() + api.start(err => { + expect(err).to.not.exist + done() + }) }) }) after(done => { api.stop((err) => { expect(err).to.not.exist - done() + rimraf(repoTests, err => { + expect(err).to.not.exist + done() + }) }) }) diff --git a/tests/test-api/test-version.js b/tests/test-api/test-version.js index d04f6251f1..7c26451e1d 100644 --- a/tests/test-api/test-version.js +++ b/tests/test-api/test-version.js @@ -1,4 +1,5 @@ /* globals describe, it */ + 'use strict' const expect = require('chai').expect diff --git a/tests/test-cli-offline/index.js b/tests/test-cli-offline/index.js index f857c6c7c1..b240ee2327 100644 --- a/tests/test-cli-offline/index.js +++ b/tests/test-cli-offline/index.js @@ -1,11 +1,32 @@ -/* globals describe */ +/* globals describe, before, after */ 'use strict' -var fs = require('fs') +const fs = require('fs') +const ncp = require('ncp').ncp +const rimraf = require('rimraf') +const expect = require('chai').expect describe('cli-offline', () => { - var tests = fs.readdirSync(__dirname) + const repoExample = process.cwd() + '/tests/repo-example' + const repoTests = process.cwd() + '/tests/repo-tests' + Date.now() + + before(done => { + ncp(repoExample, repoTests, err => { + process.env.IPFS_PATH = repoTests + expect(err).to.equal(null) + done() + }) + }) + + after(done => { + rimraf(repoTests, err => { + expect(err).to.equal(null) + done() + }) + }) + + const tests = fs.readdirSync(__dirname) tests.filter(file => { if (file === 'index.js') { return false diff --git a/tests/test-cli/index.js b/tests/test-cli/index.js index b5bdd7df1b..2e8c768446 100644 --- a/tests/test-cli/index.js +++ b/tests/test-cli/index.js @@ -1,11 +1,32 @@ -/* globals describe */ +/* globals describe, before, after */ 'use strict' -var fs = require('fs') +const fs = require('fs') +const ncp = require('ncp').ncp +const rimraf = require('rimraf') +const expect = require('chai').expect describe('cli', () => { - var tests = fs.readdirSync(__dirname) + const repoExample = process.cwd() + '/tests/repo-example' + const repoTests = process.cwd() + '/tests/repo-tests' + Date.now() + + before(done => { + ncp(repoExample, repoTests, err => { + process.env.IPFS_PATH = repoTests + expect(err).to.equal(null) + done() + }) + }) + + after(done => { + rimraf(repoTests, err => { + expect(err).to.equal(null) + done() + }) + }) + + const tests = fs.readdirSync(__dirname) tests.filter(file => { if (file === 'index.js') { return false diff --git a/tests/test-core/index.js b/tests/test-core/index.js index 225b770f39..1ffbe277df 100644 --- a/tests/test-core/index.js +++ b/tests/test-core/index.js @@ -1,11 +1,32 @@ -/* globals describe */ +/* globals describe, before, after */ 'use strict' -var fs = require('fs') +const fs = require('fs') +const ncp = require('ncp').ncp +const rimraf = require('rimraf') +const expect = require('chai').expect describe('core', () => { - var tests = fs.readdirSync(__dirname) + const repoExample = process.cwd() + '/tests/repo-example' + const repoTests = process.cwd() + '/tests/repo-tests' + Date.now() + + before(done => { + ncp(repoExample, repoTests, err => { + process.env.IPFS_PATH = repoTests + expect(err).to.equal(null) + done() + }) + }) + + after(done => { + rimraf(repoTests, err => { + expect(err).to.equal(null) + done() + }) + }) + + const tests = fs.readdirSync(__dirname) tests.filter(file => { if (file === 'index.js') { return false From af42da72611348d78f6fe65aa3e4947b1beacdac Mon Sep 17 00:00:00 2001 From: David Dias Date: Sat, 9 Jan 2016 23:49:15 +0100 Subject: [PATCH 5/8] mend --- ...c55d25f3042c22501e41d1246e7a1e9d3d8ec.data | 28 ----- ...dcf095c1d219356cdf538ffce705a52d5738d.data | Bin 10765 -> 0 bytes ...ea3b310512d7767a9abfbd7a928a85e977173.data | 4 - ...0b0d3be3528fbbcc814feb7f2fbf71ca06162.data | Bin 10807 -> 0 bytes ...60e64383755a8c5163ba3c053c3b65777ed16.data | 4 - ...ccadfda3d8bc7d2f8cdf302aa51dae8dae9da.data | Bin 10891 -> 0 bytes ...223c2d96a9f70b5fd8b1d513f8c5b69dcaed4.data | 23 ---- ...932be52c56d99c5966b65e0111239f098bbef.data | 2 - ...3346a644605d7614dca53cd3a59f7385a8abb.data | 114 ------------------ ...7f28fa9367ee167c312e6d65a2e02e81ab815.data | Bin 10765 -> 0 bytes ...68af3d10e1a497971629c07606bfdb812303d.data | Bin 309 -> 0 bytes ...02a72b057d1c7f2e682d0776a5363e2cca974.data | 3 - ...16cfa9a7ae5533f8e997cdab2ebadd7506340.data | 4 - ...e5cf3497a7845ee8f94456ccf4d1d2f6602b5.data | 24 ---- ...c0f1e4947cff8e422610996e609dbcb976598.data | 9 -- ...62f687a00c638bcb580feae06452e0c1f20b4.data | 8 -- ...56baef91c7dc345e73d049ab570abe10dfbb9.data | Bin 10849 -> 0 bytes ...2fdadf9d45666c3be122a2efb5db93c1d5fa6.data | 55 --------- ...be72a83e80f9c7bca1abcaa42298a57a33ff5.data | Bin 101 -> 0 bytes ...fb92427ae41e4649b934ca495991b7852b855.data | 0 ...41317afc9f967abe2aa05e7c641f7bbe98a37.data | Bin 10765 -> 0 bytes ...807def07b0db2f018808620eb30b980e94011.data | 3 - ...38b95dd29d31eac6433af0fb6fcd83dd80778.data | 3 - tests/repo-tests1452379313131/config | 1 - .../datastore/000002.ldb | Bin 211 -> 0 bytes .../datastore/000005.ldb | Bin 1120 -> 0 bytes .../repo-tests1452379313131/datastore/CURRENT | 1 - tests/repo-tests1452379313131/datastore/LOCK | 0 tests/repo-tests1452379313131/datastore/LOG | 10 -- .../repo-tests1452379313131/datastore/LOG.old | 10 -- .../datastore/MANIFEST-000007 | Bin 293 -> 0 bytes tests/repo-tests1452379313131/version | 1 - 32 files changed, 307 deletions(-) delete mode 100644 tests/repo-tests1452379313131/blocks/1220120f/1220120f6af601d46e10b2d2e11ed71c55d25f3042c22501e41d1246e7a1e9d3d8ec.data delete mode 100644 tests/repo-tests1452379313131/blocks/122031d6/122031d6da265092f1b03fec969243fdcf095c1d219356cdf538ffce705a52d5738d.data delete mode 100644 tests/repo-tests1452379313131/blocks/122031e7/122031e7a41c15d03feb8cd793c3348ea3b310512d7767a9abfbd7a928a85e977173.data delete mode 100644 tests/repo-tests1452379313131/blocks/12203628/12203628a4a19525dd84bbbffe132ec0b0d3be3528fbbcc814feb7f2fbf71ca06162.data delete mode 100644 tests/repo-tests1452379313131/blocks/12204a5a/12204a5a95586f52e25811cf214677160e64383755a8c5163ba3c053c3b65777ed16.data delete mode 100644 tests/repo-tests1452379313131/blocks/12205200/12205200cc6b6f79e1588480d9f9016ccadfda3d8bc7d2f8cdf302aa51dae8dae9da.data delete mode 100644 tests/repo-tests1452379313131/blocks/122052c6/122052c63c7775396b3f82c639977a7223c2d96a9f70b5fd8b1d513f8c5b69dcaed4.data delete mode 100644 tests/repo-tests1452379313131/blocks/12205994/122059948439065f29619ef41280cbb932be52c56d99c5966b65e0111239f098bbef.data delete mode 100644 tests/repo-tests1452379313131/blocks/122062ce/122062ce1f2c91a13a97b596e873b5a3346a644605d7614dca53cd3a59f7385a8abb.data delete mode 100644 tests/repo-tests1452379313131/blocks/12206781/122067817186b8ff365c758f387e3ae7f28fa9367ee167c312e6d65a2e02e81ab815.data delete mode 100644 tests/repo-tests1452379313131/blocks/12207028/122070286b9afa6620a66f715c7020d68af3d10e1a497971629c07606bfdb812303d.data delete mode 100644 tests/repo-tests1452379313131/blocks/1220709b/1220709b2dcc5f6a90ad64d6fe3a5d202a72b057d1c7f2e682d0776a5363e2cca974.data delete mode 100644 tests/repo-tests1452379313131/blocks/12207fb8/12207fb898b5d7be46d85feb75d894e16cfa9a7ae5533f8e997cdab2ebadd7506340.data delete mode 100644 tests/repo-tests1452379313131/blocks/12208b87/12208b872ca4ee517608331696dd6b3e5cf3497a7845ee8f94456ccf4d1d2f6602b5.data delete mode 100644 tests/repo-tests1452379313131/blocks/122090c0/122090c07a7795c1193510a696d1fdfc0f1e4947cff8e422610996e609dbcb976598.data delete mode 100644 tests/repo-tests1452379313131/blocks/1220929a/1220929a303c39da8a0b67c09697462f687a00c638bcb580feae06452e0c1f20b4.data delete mode 100644 tests/repo-tests1452379313131/blocks/1220933b/1220933b41d37fd4508cdff45930dff56baef91c7dc345e73d049ab570abe10dfbb9.data delete mode 100644 tests/repo-tests1452379313131/blocks/1220a52c/1220a52c3602030cb912edfe4de97002fdadf9d45666c3be122a2efb5db93c1d5fa6.data delete mode 100644 tests/repo-tests1452379313131/blocks/1220c0fc/1220c0fc6b49543d7bf04e83d2a5a7cbe72a83e80f9c7bca1abcaa42298a57a33ff5.data delete mode 100644 tests/repo-tests1452379313131/blocks/1220e3b0/1220e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855.data delete mode 100644 tests/repo-tests1452379313131/blocks/1220e605/1220e605408ac3f78113ac9a7fd486441317afc9f967abe2aa05e7c641f7bbe98a37.data delete mode 100644 tests/repo-tests1452379313131/blocks/1220e6a0/1220e6a045864ff8569e43e4866c0af807def07b0db2f018808620eb30b980e94011.data delete mode 100644 tests/repo-tests1452379313131/blocks/1220ec5b/1220ec5b533a3218991f4377b8b8c2538b95dd29d31eac6433af0fb6fcd83dd80778.data delete mode 100644 tests/repo-tests1452379313131/config delete mode 100644 tests/repo-tests1452379313131/datastore/000002.ldb delete mode 100644 tests/repo-tests1452379313131/datastore/000005.ldb delete mode 100644 tests/repo-tests1452379313131/datastore/CURRENT delete mode 100644 tests/repo-tests1452379313131/datastore/LOCK delete mode 100644 tests/repo-tests1452379313131/datastore/LOG delete mode 100644 tests/repo-tests1452379313131/datastore/LOG.old delete mode 100644 tests/repo-tests1452379313131/datastore/MANIFEST-000007 delete mode 100644 tests/repo-tests1452379313131/version diff --git a/tests/repo-tests1452379313131/blocks/1220120f/1220120f6af601d46e10b2d2e11ed71c55d25f3042c22501e41d1246e7a1e9d3d8ec.data b/tests/repo-tests1452379313131/blocks/1220120f/1220120f6af601d46e10b2d2e11ed71c55d25f3042c22501e41d1246e7a1e9d3d8ec.data deleted file mode 100644 index 389e111776..0000000000 --- a/tests/repo-tests1452379313131/blocks/1220120f/1220120f6af601d46e10b2d2e11ed71c55d25f3042c22501e41d1246e7a1e9d3d8ec.data +++ /dev/null @@ -1,28 +0,0 @@ - -Hello and Welcome to IPFS! - -██╗██████╗ ███████╗███████╗ -██║██╔══██╗██╔════╝██╔════╝ -██║██████╔╝█████╗ ███████╗ -██║██╔═══╝ ██╔══╝ ╚════██║ -██║██║ ██║ ███████║ -╚═╝╚═╝ ╚═╝ ╚══════╝ - -If you're seeing this, you have successfully installed -IPFS and are now interfacing with the ipfs merkledag! - - ------------------------------------------------------- -| Warning: | -| This is alpha software. Use at your own discretion! | -| Much is missing or lacking polish. There are bugs. | -| Not yet secure. Read the security notes for more. | - ------------------------------------------------------- - -Check out some of the other files in this directory: - - ./about - ./help - ./quick-start <-- usage examples - ./readme <-- this file - ./security-notes - \ No newline at end of file diff --git a/tests/repo-tests1452379313131/blocks/122031d6/122031d6da265092f1b03fec969243fdcf095c1d219356cdf538ffce705a52d5738d.data b/tests/repo-tests1452379313131/blocks/122031d6/122031d6da265092f1b03fec969243fdcf095c1d219356cdf538ffce705a52d5738d.data deleted file mode 100644 index 5ea0edda6f82982c276a4a3813a50c0e35121c68..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 10765 zcmeIzF%AJy6a~;Rm3)!Nk3xb(CK9$mt(wFR^jf72s6=9D)srdd6*gc6EI~I4+fbbT zRX6Y66Q?1IqgQpGAHRd{ss22Q^=&*UXYbW{zqlNV{wBXJW712aODXvf?XV11kq9)T zAq{CrLmJYMhBTxh4QWV28q$!4G^8O7X-GpF(vXHUq#+GyNJARZkcKp*;U8!iTA|tK KY}4Vho$h|}9P~&4 diff --git a/tests/repo-tests1452379313131/blocks/122031e7/122031e7a41c15d03feb8cd793c3348ea3b310512d7767a9abfbd7a928a85e977173.data b/tests/repo-tests1452379313131/blocks/122031e7/122031e7a41c15d03feb8cd793c3348ea3b310512d7767a9abfbd7a928a85e977173.data deleted file mode 100644 index ecce1053f6..0000000000 --- a/tests/repo-tests1452379313131/blocks/122031e7/122031e7a41c15d03feb8cd793c3348ea3b310512d7767a9abfbd7a928a85e977173.data +++ /dev/null @@ -1,4 +0,0 @@ -5 -" ׾F_uؔlzS?|ڲPc@ js-ipfs-repo - - \ No newline at end of file diff --git a/tests/repo-tests1452379313131/blocks/12203628/12203628a4a19525dd84bbbffe132ec0b0d3be3528fbbcc814feb7f2fbf71ca06162.data b/tests/repo-tests1452379313131/blocks/12203628/12203628a4a19525dd84bbbffe132ec0b0d3be3528fbbcc814feb7f2fbf71ca06162.data deleted file mode 100644 index bbe6bda78d0a52f6d87da578f452d43718b9aa9f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 10807 zcmeI&tqQ_m6vpvsQC>mhU=TmxWeCpZ4H&eDU=nNw5wR?6Yue0K5w>X*qZns5SS{Xw z-hn1RK)egXzn^qC&+{usEMq~6w(px+ cb8FMhello - ipfs add hello - - -View it: - - ipfs cat - - -Try a directory: - - mkdir foo - mkdir foo/bar - echo "baz" > foo/baz - echo "baz" > foo/bar/baz - ipfs add -r foo - - -View things: - - ipfs ls - ipfs ls /bar - ipfs cat /baz - ipfs cat /bar/baz - ipfs cat /bar - ipfs ls /baz - - -References: - - ipfs refs - ipfs refs -r - ipfs refs --help - - -Get: - - ipfs get foo2 - diff foo foo2 - - -Objects: - - ipfs object get - ipfs object get /foo2 - ipfs object --help - - -Pin + GC: - - ipfs pin -r - ipfs gc - ipfs ls - ipfs unpin -r - ipfs gc - - -Daemon: - - ipfs daemon (in another terminal) - ipfs id - - -Network: - - (must be online) - ipfs swarm peers - ipfs id - ipfs cat - - -Mount: - - (warning: fuse is finicky!) - ipfs mount - cd /ipfs/< - - -Tool: - - ipfs version - ipfs update - ipfs commands - ipfs config --help - open http://localhost:5001/webui - - -Browse: - - webui: - - http://localhost:5001/webui - - video: - - http://localhost:8080/ipfs/QmVc6zuAneKJzicnJpfrqCH9gSy6bz54JhcypfJYhGUFQu/play#/ipfs/QmTKZgRNwDNZwHtJSjCp6r5FYefzpULfy37JvMt9DwvXse - - images: - - http://localhost:8080/ipfs/QmZpc3HvfjEXvLWGQPWbHk3AjD5j8NEN4gmFN8Jmrd5g83/cs - - markdown renderer app: - - http://localhost:8080/ipfs/QmX7M9CiYXjVeFnkfVGf3y5ixTZ2ACeSGyL1vBJY1HvQPp/mdown - \ No newline at end of file diff --git a/tests/repo-tests1452379313131/blocks/12206781/122067817186b8ff365c758f387e3ae7f28fa9367ee167c312e6d65a2e02e81ab815.data b/tests/repo-tests1452379313131/blocks/12206781/122067817186b8ff365c758f387e3ae7f28fa9367ee167c312e6d65a2e02e81ab815.data deleted file mode 100644 index a8f98693b7d4797d0a55704b16c15a6aa7d34bd5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 10765 zcmeIzF%AJy6a~Szz&}ww{ J&EYejEr0X~^v?hQ diff --git a/tests/repo-tests1452379313131/blocks/12207028/122070286b9afa6620a66f715c7020d68af3d10e1a497971629c07606bfdb812303d.data b/tests/repo-tests1452379313131/blocks/12207028/122070286b9afa6620a66f715c7020d68af3d10e1a497971629c07606bfdb812303d.data deleted file mode 100644 index 74de75af616ff437b5c7a3a5272281eac2146b6c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 309 zcmWgA<5Ch*SgK>j#LTl(=mjz6J*Z#Z`mUeibke1%>*qt`A@ymo*6O-~wOC)CS z3K@XZPnu<5V|lBKJN>}4>2CTNRSd^0_H1qVw~ozKk4Ii%i@p$ha(-S(VseSZ2}U7Z zkd6rls>-Jxlr$AsHtpiyKm2l@?&p6zQA*^T_KfrP>FKF6gjh0Ca|$F5F$tM~lqa2& z*O|D`YWmh`FN(J=HpxnHW4)f}dn)*>RpfVzsIJ{Y+=Zo?$=SNaC5c5P5({~S^g+6W z__Mw-Uda>Kbm^hob(zph@di$ZR2iSh3b{RB`110NH$rShsfj7MsS@Wngv>!2f{xjg zms)1qHyyK_UR9)g=w{aZf~|kMWdrSdqBHNTyCTF_oSIx(lvz@#o0ngbS}f7b!NtVE F2moEFc%uLS diff --git a/tests/repo-tests1452379313131/blocks/1220709b/1220709b2dcc5f6a90ad64d6fe3a5d202a72b057d1c7f2e682d0776a5363e2cca974.data b/tests/repo-tests1452379313131/blocks/1220709b/1220709b2dcc5f6a90ad64d6fe3a5d202a72b057d1c7f2e682d0776a5363e2cca974.data deleted file mode 100644 index 3a99c365f0..0000000000 --- a/tests/repo-tests1452379313131/blocks/1220709b/1220709b2dcc5f6a90ad64d6fe3a5d202a72b057d1c7f2e682d0776a5363e2cca974.data +++ /dev/null @@ -1,3 +0,0 @@ -4 -" Y9_)a˹2RmŖke9 js-ipfs-repo - \ No newline at end of file diff --git a/tests/repo-tests1452379313131/blocks/12207fb8/12207fb898b5d7be46d85feb75d894e16cfa9a7ae5533f8e997cdab2ebadd7506340.data b/tests/repo-tests1452379313131/blocks/12207fb8/12207fb898b5d7be46d85feb75d894e16cfa9a7ae5533f8e997cdab2ebadd7506340.data deleted file mode 100644 index ee87b9db01..0000000000 --- a/tests/repo-tests1452379313131/blocks/12207fb8/12207fb898b5d7be46d85feb75d894e16cfa9a7ae5533f8e997cdab2ebadd7506340.data +++ /dev/null @@ -1,4 +0,0 @@ -0 -" ,Qv3k>\IzxEElM/fLICENSE1 -" JZXoRX!Fwd87U;SöWw README.md{ - \ No newline at end of file diff --git a/tests/repo-tests1452379313131/blocks/12208b87/12208b872ca4ee517608331696dd6b3e5cf3497a7845ee8f94456ccf4d1d2f6602b5.data b/tests/repo-tests1452379313131/blocks/12208b87/12208b872ca4ee517608331696dd6b3e5cf3497a7845ee8f94456ccf4d1d2f6602b5.data deleted file mode 100644 index 3da92595c2..0000000000 --- a/tests/repo-tests1452379313131/blocks/12208b87/12208b872ca4ee517608331696dd6b3e5cf3497a7845ee8f94456ccf4d1d2f6602b5.data +++ /dev/null @@ -1,24 +0,0 @@ - -The MIT License (MIT) - -Copyright (c) 2015 IPFS - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - \ No newline at end of file diff --git a/tests/repo-tests1452379313131/blocks/122090c0/122090c07a7795c1193510a696d1fdfc0f1e4947cff8e422610996e609dbcb976598.data b/tests/repo-tests1452379313131/blocks/122090c0/122090c07a7795c1193510a696d1fdfc0f1e4947cff8e422610996e609dbcb976598.data deleted file mode 100644 index 71be805f1e..0000000000 --- a/tests/repo-tests1452379313131/blocks/122090c0/122090c07a7795c1193510a696d1fdfc0f1e4947cff8e422610996e609dbcb976598.data +++ /dev/null @@ -1,9 +0,0 @@ - -Some helpful resources for finding your way around ipfs: - -- quick-start: a quick show of various ipfs features. -- ipfs commands: a list of all commands -- ipfs --help: every command describes itself -- https://github.com/ipfs/go-ipfs -- the src repository -- #ipfs on irc.freenode.org -- the community irc channel - \ No newline at end of file diff --git a/tests/repo-tests1452379313131/blocks/1220929a/1220929a303c39da8a0b67c09697462f687a00c638bcb580feae06452e0c1f20b4.data b/tests/repo-tests1452379313131/blocks/1220929a/1220929a303c39da8a0b67c09697462f687a00c638bcb580feae06452e0c1f20b4.data deleted file mode 100644 index 62d1c2979b..0000000000 --- a/tests/repo-tests1452379313131/blocks/1220929a/1220929a303c39da8a0b67c09697462f687a00c638bcb580feae06452e0c1f20b4.data +++ /dev/null @@ -1,8 +0,0 @@ - -Come hang out in our IRC chat room if you have any questions. - -Contact the ipfs dev team: -- Bugs: https://github.com/ipfs/go-ipfs/issues -- Help: irc.freenode.org/#ipfs -- Email: dev@ipfs.io - \ No newline at end of file diff --git a/tests/repo-tests1452379313131/blocks/1220933b/1220933b41d37fd4508cdff45930dff56baef91c7dc345e73d049ab570abe10dfbb9.data b/tests/repo-tests1452379313131/blocks/1220933b/1220933b41d37fd4508cdff45930dff56baef91c7dc345e73d049ab570abe10dfbb9.data deleted file mode 100644 index d899663bf7a13bb0563304b1d96985a784c2d515..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 10849 zcmWgA;8GG&c)a0=(~LhdBC~#fIWaSTr;7SI$0sSXC;Kd!I#aqLXh*0Jg9L-nsLIh$ z8ciXixns0s7%de?YlP9-aI`iYtqn(O!_nGsv^E^A4M%Ik(b{mdHXN-DM{C2;+HkZs z9IXvUYs1mnaI`iYtqn(O!_nGsv^E^A4M%Ik(b{mdHXN-DM{C2;+HkZs9IXvUYs1mn zaI`iYG__&mlom_2c+JFlUxXS??=;#MbToJ7(P`PK4+MoQKg`(u9` -- browsers or extensions can learn to use `ipfs://` directly -- hash-addressed content guarantees authenticity - -IPFS is modular: -- connection layer over any network protocol -- routing layer -- uses a routing layer DHT (kademlia/coral) -- uses a path-based naming service -- uses bittorrent-inspired block exchange - -IPFS uses crypto: -- cryptographic-hash content addressing -- block-level deduplication -- file integrity + versioning -- filesystem-level encryption + signing support - -IPFS is p2p: -- worldwide peer-to-peer file transfers -- completely decentralized architecture -- **no** central point of failure - -IPFS is a cdn: -- add a file to the filesystem locally, and it's now available to the world -- caching-friendly (content-hash naming) -- bittorrent-based bandwidth distribution - -IPFS has a name service: -- IPNS, an SFS inspired name system -- global namespace based on PKI -- serves to build trust chains -- compatible with other NSes -- can map DNS, .onion, .bit, etc to IPNS - \ No newline at end of file diff --git a/tests/repo-tests1452379313131/blocks/1220c0fc/1220c0fc6b49543d7bf04e83d2a5a7cbe72a83e80f9c7bca1abcaa42298a57a33ff5.data b/tests/repo-tests1452379313131/blocks/1220c0fc/1220c0fc6b49543d7bf04e83d2a5a7cbe72a83e80f9c7bca1abcaa42298a57a33ff5.data deleted file mode 100644 index c9885c45d7e7c10d02b98208d40cfd7b8bfaed21..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 101 zcmWgA=TZ_+Kwo-;;PadOz%uNME$6+{JHE$$U!OUW!sO)in> z4G}T|X$WFClbv7rFrua5=1<0)Q}=J#b|1g=FJWY200SX~$SEzBZ1I|j^S%f*oZe})FX(9Q%%jt? zQy&NlS$>$Y`#n34QbA^3F(V^P!?OjhZT>&P<~cuU%i;RLe(ysy@1_qD4Q&dq4R$uX zbPxoo11sKKRu>QF9Qd?w0|O_M0pouNU?_u2-8}VndNoG}qZmkp00{rx(5+JHej5PO CoIXSV diff --git a/tests/repo-tests1452379313131/datastore/000005.ldb b/tests/repo-tests1452379313131/datastore/000005.ldb deleted file mode 100644 index 63d9d260b936415ee42b5aeda6c79fb941664398..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1120 zcmZQDSjViNS&&z(FQg!8*qs;0^V3RMWIveo0t|Brg#j3VRkisv@!=|IgJvNC_dNx9y@%e`@arzW`upR#0^RR3Lu1P3 zgny1+s9JOHtH$|N^V2^pIaU+*`j0Vdf^UEA=Y(L*NL7==e45ubJUDbI<}5@1nZ5i@ zU-f@onB_6=BHQa-tVc_VRZiT0AST5ib<){%%1r}PkJe@8+6(<3{`CFeMP?prC*c znwwdgM`+7O$B&?~72w>77RV zf{y0SJUT5q^?{&}<%b!&-?Q^56=dcWGqS)myonCBGLo1n?_9oP$D!cvsdqIm%dJT< zUeCYn&kfrf>=lfOBoQtW6k&$7W$0~c7gOL@IORq4N$7y_CFLmFs-1D4yKkEePa;Yx&V3}9e z6J;wFzbL(7XX!B6*Rdrw=+4dxeU2>!j1QaGe>~sK(>yOETD?v4ss5$s3VXC14~0|~ z@|s=JZrGS)y@`hY)f%XfBnQv@ZgL4too7C-W6;9@lKgp&)Y9xu#YGC zq+Q(oPkf)J&zo^7bJ>~t)Xqs~*IU@HQqP#^{d0FztkiZ*y~k%OjhiRCYiY>$1@7+Z zzc{J2k%`0O*2zuI)9>zn)wWdsh9cXQc|w1;OnM=;)%wQi`6UM;Jtuj8n*Q?qk;X3q zZaf<6!(B7;zLu#kRKLAQM`r(FbFXM+CT2zkqS6H@{24)n$QSJzIOo8pg&P<+nGG2K hLjXe)2VAZvSyQK-gJTMZI7kRT2>;#Cty1cK8vstu!bkuB diff --git a/tests/repo-tests1452379313131/datastore/CURRENT b/tests/repo-tests1452379313131/datastore/CURRENT deleted file mode 100644 index 875cf23355..0000000000 --- a/tests/repo-tests1452379313131/datastore/CURRENT +++ /dev/null @@ -1 +0,0 @@ -MANIFEST-000007 diff --git a/tests/repo-tests1452379313131/datastore/LOCK b/tests/repo-tests1452379313131/datastore/LOCK deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/repo-tests1452379313131/datastore/LOG b/tests/repo-tests1452379313131/datastore/LOG deleted file mode 100644 index 863b68fd57..0000000000 --- a/tests/repo-tests1452379313131/datastore/LOG +++ /dev/null @@ -1,10 +0,0 @@ -=============== Dec 10, 2015 (PST) =============== -07:50:02.056578 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed -07:50:02.057231 db@open opening -07:50:02.057312 journal@recovery F·1 -07:50:02.057514 journal@recovery recovering @3 -07:50:02.058921 mem@flush created L0@5 N·4 S·1KiB "/ip..\xf6\xe4\xa9,v5":"/pk..\xf6\xe4\xa9,v6" -07:50:02.059983 db@janitor F·4 G·0 -07:50:02.060001 db@open done T·2.755926ms -07:50:02.073183 db@close closing -07:50:02.073285 db@close done T·97.522µs diff --git a/tests/repo-tests1452379313131/datastore/LOG.old b/tests/repo-tests1452379313131/datastore/LOG.old deleted file mode 100644 index 708351e772..0000000000 --- a/tests/repo-tests1452379313131/datastore/LOG.old +++ /dev/null @@ -1,10 +0,0 @@ -=============== Dec 10, 2015 (PST) =============== -07:49:57.048841 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed -07:49:57.049014 db@open opening -07:49:57.049066 journal@recovery F·1 -07:49:57.049233 journal@recovery recovering @1 -07:49:57.049693 mem@flush created L0@2 N·2 S·211B "/lo..oot,v2":"/lo..ins,v1" -07:49:57.050381 db@janitor F·3 G·0 -07:49:57.050397 db@open done T·1.375431ms -07:49:57.064580 db@close closing -07:49:57.064655 db@close done T·72.59µs diff --git a/tests/repo-tests1452379313131/datastore/MANIFEST-000007 b/tests/repo-tests1452379313131/datastore/MANIFEST-000007 deleted file mode 100644 index 6af3b5450fb46c2d16258f242969f0d88dfa5892..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 293 zcmbOjutG$Rk&#g Date: Sat, 9 Jan 2016 23:49:50 +0100 Subject: [PATCH 6/8] mend --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 4d18d56eb7..25076c86b6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ **/node_modules/ **/*.log +tests/repo-tests* # Logs logs From ef701dc99d94d056a72d2ad903484096f9e6579a Mon Sep 17 00:00:00 2001 From: David Dias Date: Mon, 11 Jan 2016 12:51:00 +0100 Subject: [PATCH 7/8] add bootstrap list to cli --- src/cli/commands/bootstrap/add.js | 36 ++++++++++++++++++++++++++++++ src/cli/commands/bootstrap/list.js | 21 +++++++++++++++++ src/cli/commands/bootstrap/rm.js | 36 ++++++++++++++++++++++++++++++ src/http-api/routes/bootstrap.js | 22 ++++++++++++++++++ 4 files changed, 115 insertions(+) create mode 100644 src/cli/commands/bootstrap/add.js create mode 100644 src/cli/commands/bootstrap/list.js create mode 100644 src/cli/commands/bootstrap/rm.js create mode 100644 src/http-api/routes/bootstrap.js diff --git a/src/cli/commands/bootstrap/add.js b/src/cli/commands/bootstrap/add.js new file mode 100644 index 0000000000..337c2f55fa --- /dev/null +++ b/src/cli/commands/bootstrap/add.js @@ -0,0 +1,36 @@ +'use strict' + +const Command = require('ronin').Command +const IPFS = require('../../ipfs-core') +const debug = require('debug') +const log = debug('cli:version') +log.error = debug('cli:version:error') + +module.exports = Command.extend({ + desc: 'Shows IPFS version information', + + options: { + number: { + alias: 'n', + type: 'boolean', + default: false + }, + commit: { + type: 'boolean', + default: false + }, + repo: { + type: 'boolean', + default: false + } + }, + + run: (name) => { + var node = new IPFS() + node.version((err, version) => { + if (err) { return log.error(err) } + + console.log(version) + }) + } +}) diff --git a/src/cli/commands/bootstrap/list.js b/src/cli/commands/bootstrap/list.js new file mode 100644 index 0000000000..9f52b092a4 --- /dev/null +++ b/src/cli/commands/bootstrap/list.js @@ -0,0 +1,21 @@ +'use strict' + +const Command = require('ronin').Command +const IPFS = require('../../../ipfs-core') +const debug = require('debug') +const log = debug('cli:version') +log.error = debug('cli:version:error') + +module.exports = Command.extend({ + desc: 'Show peers in the bootstrap list', + + options: {}, + + run: (name) => { + var node = new IPFS() + node.bootstrap.list((err, list) => { + if (err) { return log.error(err) } + list.forEach(node => { console.log(node) }) + }) + } +}) diff --git a/src/cli/commands/bootstrap/rm.js b/src/cli/commands/bootstrap/rm.js new file mode 100644 index 0000000000..337c2f55fa --- /dev/null +++ b/src/cli/commands/bootstrap/rm.js @@ -0,0 +1,36 @@ +'use strict' + +const Command = require('ronin').Command +const IPFS = require('../../ipfs-core') +const debug = require('debug') +const log = debug('cli:version') +log.error = debug('cli:version:error') + +module.exports = Command.extend({ + desc: 'Shows IPFS version information', + + options: { + number: { + alias: 'n', + type: 'boolean', + default: false + }, + commit: { + type: 'boolean', + default: false + }, + repo: { + type: 'boolean', + default: false + } + }, + + run: (name) => { + var node = new IPFS() + node.version((err, version) => { + if (err) { return log.error(err) } + + console.log(version) + }) + } +}) diff --git a/src/http-api/routes/bootstrap.js b/src/http-api/routes/bootstrap.js new file mode 100644 index 0000000000..a5ae2a44e4 --- /dev/null +++ b/src/http-api/routes/bootstrap.js @@ -0,0 +1,22 @@ +'use strict' + +const server = require('./../index.js').server +const resources = require('./../resources') + +server.route({ + method: 'GET', + path: '/api/v0/bootstrap', + handler: resources.version.list +}) + +server.route({ + method: 'POST', + path: '/api/v0/boostrap', + handler: resources.version.add +}) + +server.route({ + method: 'DELETE', + path: '/api/v0/boostrap', + handler: resources.version.add +}) From 467ef34e7328b9fada213c7826d470443beab398 Mon Sep 17 00:00:00 2001 From: David Dias Date: Mon, 11 Jan 2016 13:30:38 +0100 Subject: [PATCH 8/8] bootstrap add rm list complete + cli + cli tests --- src/cli/commands/bootstrap/add.js | 26 ++------ src/cli/commands/bootstrap/rm.js | 26 ++------ src/ipfs-core/index.js | 1 + tests/test-cli-offline/test-bootstrap.js | 75 ++++++++++++++++++++++++ 4 files changed, 86 insertions(+), 42 deletions(-) create mode 100644 tests/test-cli-offline/test-bootstrap.js diff --git a/src/cli/commands/bootstrap/add.js b/src/cli/commands/bootstrap/add.js index 337c2f55fa..188198e438 100644 --- a/src/cli/commands/bootstrap/add.js +++ b/src/cli/commands/bootstrap/add.js @@ -1,36 +1,20 @@ 'use strict' const Command = require('ronin').Command -const IPFS = require('../../ipfs-core') +const IPFS = require('../../../ipfs-core') const debug = require('debug') const log = debug('cli:version') log.error = debug('cli:version:error') module.exports = Command.extend({ - desc: 'Shows IPFS version information', + desc: 'Show peers in the bootstrap list', - options: { - number: { - alias: 'n', - type: 'boolean', - default: false - }, - commit: { - type: 'boolean', - default: false - }, - repo: { - type: 'boolean', - default: false - } - }, + options: {}, - run: (name) => { + run: (multiaddr) => { var node = new IPFS() - node.version((err, version) => { + node.bootstrap.add(multiaddr, (err, list) => { if (err) { return log.error(err) } - - console.log(version) }) } }) diff --git a/src/cli/commands/bootstrap/rm.js b/src/cli/commands/bootstrap/rm.js index 337c2f55fa..a3bca1059c 100644 --- a/src/cli/commands/bootstrap/rm.js +++ b/src/cli/commands/bootstrap/rm.js @@ -1,36 +1,20 @@ 'use strict' const Command = require('ronin').Command -const IPFS = require('../../ipfs-core') +const IPFS = require('../../../ipfs-core') const debug = require('debug') const log = debug('cli:version') log.error = debug('cli:version:error') module.exports = Command.extend({ - desc: 'Shows IPFS version information', + desc: 'Show peers in the bootstrap list', - options: { - number: { - alias: 'n', - type: 'boolean', - default: false - }, - commit: { - type: 'boolean', - default: false - }, - repo: { - type: 'boolean', - default: false - } - }, + options: {}, - run: (name) => { + run: (multiaddr) => { var node = new IPFS() - node.version((err, version) => { + node.bootstrap.rm(multiaddr, (err, list) => { if (err) { return log.error(err) } - - console.log(version) }) } }) diff --git a/src/ipfs-core/index.js b/src/ipfs-core/index.js index 7895ad99b9..697854894e 100644 --- a/src/ipfs-core/index.js +++ b/src/ipfs-core/index.js @@ -90,6 +90,7 @@ function IPFS () { config.Bootstrap.push(multiaddr) repo.config.set(config, err => { if (err) { return callback(err) } + callback() }) }) diff --git a/tests/test-cli-offline/test-bootstrap.js b/tests/test-cli-offline/test-bootstrap.js new file mode 100644 index 0000000000..f23dca6245 --- /dev/null +++ b/tests/test-cli-offline/test-bootstrap.js @@ -0,0 +1,75 @@ +/* globals describe, it */ + +'use strict' + +const expect = require('chai').expect +const nexpect = require('nexpect') + +describe('bootstrap', () => { + const defaultList = [ + '/ip4/104.131.131.82/tcp/4001/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ', + '/ip4/104.236.176.52/tcp/4001/ipfs/QmSoLnSGccFuZQJzRadHn95W2CrSFmZuTdDWP8HXaHca9z', + '/ip4/104.236.179.241/tcp/4001/ipfs/QmSoLPppuBtQSGwKDZT2M73ULpjvfd3aZ6ha4oFGL1KrGM', + '/ip4/162.243.248.213/tcp/4001/ipfs/QmSoLueR4xBeUbY9WZ9xGUUxunbKWcrNFTDAadQJmocnWm', + '/ip4/128.199.219.111/tcp/4001/ipfs/QmSoLSafTMBsPKadTEgaXctDQVcqN88CNLHXMkTNwMKPnu', + '/ip4/104.236.76.40/tcp/4001/ipfs/QmSoLV4Bbm51jM9C4gDYZQ9Cy3U6aXMJDAbzgu2fzaDs64', + '/ip4/178.62.158.247/tcp/4001/ipfs/QmSoLer265NRgSp2LA3dPaeykiS1J6DifTC88f5uVQKNAd', + '/ip4/178.62.61.185/tcp/4001/ipfs/QmSoLMeWqB7YGVLJN3pNLQpmmEk35v6wYtsMGLzSr5QBU3', + '/ip4/104.236.151.122/tcp/4001/ipfs/QmSoLju6m7xTh3DuokvT3886QRYqxAzb1kShaanJgW36yx' + ] + + const updatedList = [ + '/ip4/104.131.131.82/tcp/4001/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ', + '/ip4/104.236.176.52/tcp/4001/ipfs/QmSoLnSGccFuZQJzRadHn95W2CrSFmZuTdDWP8HXaHca9z', + '/ip4/104.236.179.241/tcp/4001/ipfs/QmSoLPppuBtQSGwKDZT2M73ULpjvfd3aZ6ha4oFGL1KrGM', + '/ip4/162.243.248.213/tcp/4001/ipfs/QmSoLueR4xBeUbY9WZ9xGUUxunbKWcrNFTDAadQJmocnWm', + '/ip4/128.199.219.111/tcp/4001/ipfs/QmSoLSafTMBsPKadTEgaXctDQVcqN88CNLHXMkTNwMKPnu', + '/ip4/104.236.76.40/tcp/4001/ipfs/QmSoLV4Bbm51jM9C4gDYZQ9Cy3U6aXMJDAbzgu2fzaDs64', + '/ip4/178.62.158.247/tcp/4001/ipfs/QmSoLer265NRgSp2LA3dPaeykiS1J6DifTC88f5uVQKNAd', + '/ip4/178.62.61.185/tcp/4001/ipfs/QmSoLMeWqB7YGVLJN3pNLQpmmEk35v6wYtsMGLzSr5QBU3', + '/ip4/104.236.151.122/tcp/4001/ipfs/QmSoLju6m7xTh3DuokvT3886QRYqxAzb1kShaanJgW36yx', + '/ip4/111.111.111.111/tcp/1001/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLUVIT' + ] + + it('list the bootstrap nodes', done => { + nexpect.spawn('node', [process.cwd() + '/src/cli/bin.js', 'bootstrap', 'list']) + .run((err, stdout, exitcode) => { + expect(stdout).to.deep.equal(defaultList) + expect(err).to.not.exist + expect(exitcode).to.equal(0) + done() + }) + }) + + it('add another bootstrap node', done => { + nexpect.spawn('node', [process.cwd() + '/src/cli/bin.js', 'bootstrap', 'add', '/ip4/111.111.111.111/tcp/1001/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLUVIT']) + .run((err, stdout, exitcode) => { + expect(err).to.not.exist + expect(exitcode).to.equal(0) + + nexpect.spawn('node', [process.cwd() + '/src/cli/bin.js', 'bootstrap', 'list']) + .run((err, stdout, exitcode) => { + expect(stdout).to.deep.equal(updatedList) + expect(err).to.not.exist + expect(exitcode).to.equal(0) + done() + }) + }) + }) + + it('rm a bootstrap node', done => { + nexpect.spawn('node', [process.cwd() + '/src/cli/bin.js', 'bootstrap', 'rm', '/ip4/111.111.111.111/tcp/1001/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLUVIT']) + .run((err, stdout, exitcode) => { + expect(err).to.not.exist + expect(exitcode).to.equal(0) + + nexpect.spawn('node', [process.cwd() + '/src/cli/bin.js', 'bootstrap', 'list']) + .run((err, stdout, exitcode) => { + expect(stdout).to.deep.equal(defaultList) + expect(err).to.not.exist + expect(exitcode).to.equal(0) + done() + }) + }) + }) +})