This repository has been archived by the owner on Feb 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
feat(issue-1852): now supports multiple api and gateways #1903
Merged
alanshaw
merged 5 commits into
ipfs:master
from
grantlouisherman:feat/multiple-api-gateways
Mar 11, 2019
Merged
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
b5c7628
feat(issue-1852): now supports multiple api and gateways
grantlouisherman 1b17688
feat(pr): addressing PR comments
grantlouisherman e57d0e9
refactor: cleanup and add test
1c38202
fix: guard against undefined _apiServers
d5215c2
chore: increase timeout for windows
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,7 +26,7 @@ const checkLock = (repo, cb) => { | |
cb() | ||
} | ||
|
||
function testSignal (ipfs, sig) { | ||
function testSignal (ipfs, sig, config) { | ||
return ipfs('init').then(() => { | ||
return ipfs('config', 'Addresses', JSON.stringify({ | ||
API: '/ip4/127.0.0.1/tcp/0', | ||
|
@@ -91,6 +91,33 @@ describe('daemon', () => { | |
}).catch(err => done(err)) | ||
}) | ||
|
||
skipOnWindows('should handle API Array and Gateway Array', function (done) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hey @alanshaw I'm not sure if you wanted this to be tested in another location as well. |
||
this.timeout(100 * 1000) | ||
// These tests are flaky, but retrying 3 times seems to make it work 99% of the time | ||
this.retries(3) | ||
|
||
ipfs('init').then(() => { | ||
return ipfs('config', 'Addresses', JSON.stringify({ | ||
Swarm: ['/ip4/0.0.0.0/tcp/4002', '/ip4/127.0.0.1/tcp/4003/ws'], | ||
API: ['/ip4/127.0.0.1/tcp/5002', '/ip6/::1/tcp/5002'], | ||
Gateway: ['/ip4/127.0.0.1/tcp/9090', '/ip6/::1/tcp/9090'] | ||
}), '--json') | ||
}).then(() => { | ||
const res = ipfs('daemon') | ||
const timeout = setTimeout(() => { | ||
done(new Error('Daemon did not get ready in time')) | ||
}, 1000 * 120) | ||
res.stdout.on('data', (data) => { | ||
const line = data.toString() | ||
if (line.includes('Daemon is ready')) { | ||
clearTimeout(timeout) | ||
res.kill() | ||
done() | ||
} | ||
}) | ||
}).catch(err => done(err)) | ||
}) | ||
|
||
skipOnWindows('should handle SIGINT gracefully', function (done) { | ||
this.timeout(100 * 1000) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to pass hapiInfoToMultiaddr to this function - it’s in scope already
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey when I don't pass that in and when I run
jsipfs daemon
it throws an error saying that it is not a function. Not 100% sure why, but I kept it in there for that reason. Maybe because it is being called within the scope of the start function that it does not have access to that function?