Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.

Commit 98414f1

Browse files
authored
Merge branch 'master' into add-http-dag-api
2 parents 147e5a6 + e38b81d commit 98414f1

File tree

11 files changed

+61
-64
lines changed

11 files changed

+61
-64
lines changed

ISSUE_TEMPLATE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,5 @@ One of following:
3939
This is for you! Please read, and then delete this text before posting it.
4040
The js-ipfs issues are only for bug reports and directly actionable features.
4141
42-
Read https://github.com/ipfs/community/blob/master/contributing.md#reporting-issues if your issue doesn't fit either of those categories.
42+
Read https://github.com/ipfs/community/blob/master/CONTRIBUTING.md#reporting-issues if your issue doesn't fit either of those categories.
4343
-->

README.md

+33-33
Large diffs are not rendered by default.

examples/browser-create-react-app/public/manifest.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"short_name": "React App",
3-
"name": "Create React App Sample",
2+
"short_name": "IPFS React App",
3+
"name": "IPFS Create React App Example",
44
"icons": [
55
{
66
"src": "favicon.ico",

examples/browser-create-react-app/src/App.js

+9-9
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ import useIpfs from './hooks/use-ipfs.js'
44
import logo from './ipfs-logo.svg'
55

66
const App = () => {
7-
const { ipfs, ipfsInitError } = useIpfsFactory({commands: ['id']})
7+
const { ipfs, ipfsInitError } = useIpfsFactory({ commands: ['id'] })
88
const id = useIpfs(ipfs, 'id')
99
return (
1010
<div className='sans-serif'>
11-
<header className="flex items-center pa3 bg-navy bb bw3 b--aqua">
12-
<a href="https://ipfs.io" title="home">
13-
<img alt="IPFS logo" src={logo} style={{ height: 50 }} className='v-top' />
11+
<header className='flex items-center pa3 bg-navy bb bw3 b--aqua'>
12+
<a href='https://ipfs.io' title='home'>
13+
<img alt='IPFS logo' src={logo} style={{ height: 50 }} className='v-top' />
1414
</a>
15-
<h1 className="flex-auto ma0 tr f3 fw2 montserrat aqua">IPFS React</h1>
15+
<h1 className='flex-auto ma0 tr f3 fw2 montserrat aqua'>IPFS React</h1>
1616
</header>
1717
<main>
1818
{ipfsInitError && (
@@ -26,20 +26,20 @@ const App = () => {
2626
)
2727
}
2828

29-
const Title = ({children}) => {
29+
const Title = ({ children }) => {
3030
return (
31-
<h2 className="f5 ma0 pb2 tracked aqua fw4 montserrat">{children}</h2>
31+
<h2 className='f5 ma0 pb2 tracked aqua fw4 montserrat'>{children}</h2>
3232
)
3333
}
3434

3535
const IpfsId = (props) => {
36-
if (!props) return null
36+
if (!props) return null
3737
return (
3838
<section className='bg-snow mw7 center mt5'>
3939
<h1 className='f3 fw4 ma0 pv3 aqua montserrat tc'>Connected to IPFS</h1>
4040
<div className='pa4'>
4141
{['id', 'agentVersion'].map((key) => (
42-
<div className="mb4" key={key}>
42+
<div className='mb4' key={key}>
4343
<Title>{key}</Title>
4444
<div className='bg-white pa2 br2 truncate monospace'>{props[key]}</div>
4545
</div>

examples/browser-create-react-app/src/App.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ it('renders without crashing', () => {
66
const div = document.createElement('div')
77
ReactDOM.render(<App />, div)
88
ReactDOM.unmountComponentAtNode(div)
9-
});
9+
})

examples/browser-create-react-app/src/hooks/use-ipfs-factory.js

+5-7
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ let ipfs = null
1313
* so use-ipfs calls can grab it from there rather than expecting
1414
* it to be passed in.
1515
*/
16-
export default function useIpfsFactory ({commands}) {
17-
const [isIpfsReady, setIpfsReady] = useState(!!ipfs)
16+
export default function useIpfsFactory ({ commands }) {
17+
const [isIpfsReady, setIpfsReady] = useState(Boolean(ipfs))
1818
const [ipfsInitError, setIpfsInitError] = useState(null)
1919

2020
useEffect(() => {
@@ -34,11 +34,9 @@ export default function useIpfsFactory ({commands}) {
3434
async function startIpfs () {
3535
if (ipfs) {
3636
console.log('IPFS already started')
37-
3837
} else if (window.ipfs && window.ipfs.enable) {
3938
console.log('Found window.ipfs')
40-
ipfs = await window.ipfs.enable({commands})
41-
39+
ipfs = await window.ipfs.enable({ commands })
4240
} else {
4341
try {
4442
console.time('IPFS Started')
@@ -51,10 +49,10 @@ export default function useIpfsFactory ({commands}) {
5149
}
5250
}
5351

54-
setIpfsReady(!!ipfs)
52+
setIpfsReady(Boolean(ipfs))
5553
}
5654

57-
return {ipfs, isIpfsReady, ipfsInitError}
55+
return { ipfs, isIpfsReady, ipfsInitError }
5856
}
5957

6058
function promiseMeJsIpfs (Ipfs, opts) {

package-list.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"Package",
44
"Version",
55
"Deps",
6-
"CI",
6+
"CI/Travis",
77
"Coverage",
88
"Lead Maintainer"
99
],
@@ -30,7 +30,7 @@
3030
["libp2p/js-libp2p-kad-dht", "libp2p-kad-dht"],
3131
["libp2p/js-libp2p-mdns", "libp2p-mdns"],
3232
["libp2p/js-libp2p-mplex", "libp2p-mplex"],
33-
["libp2p/js-libp2p-railing", "libp2p-railing"],
33+
["libp2p/js-libp2p-bootstrap", "libp2p-bootstrap"],
3434
["libp2p/js-libp2p-secio", "libp2p-secio"],
3535
["libp2p/js-libp2p-tcp", "libp2p-tcp"],
3636
["libp2p/js-libp2p-webrtc-star", "libp2p-webrtc-star"],
@@ -51,7 +51,7 @@
5151

5252
"Generics/Utils",
5353
["ipfs/js-ipfs-http-client", "ipfs-http-client"],
54-
["ipfs/ipfs-multipart", "ipfs-multipart"],
54+
["ipfs/js-ipfs-multipart", "ipfs-multipart"],
5555
["ipfs/is-ipfs", "is-ipfs"],
5656
["multiformats/js-multihashing", "multihashing"],
5757
["multiformats/js-mafmt", "mafmt"]

src/core/components/files-regular/cat-pull-stream.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ module.exports = function (self) {
1515

1616
ipfsPath = normalizePath(ipfsPath)
1717
const pathComponents = ipfsPath.split('/')
18-
const restPath = normalizePath(pathComponents.slice(1).join('/'))
19-
const filterFile = (file) => (restPath && file.path === restPath) || (file.path === ipfsPath)
18+
const fileNameOrHash = pathComponents[pathComponents.length - 1]
2019

2120
if (options.preload !== false) {
2221
self._preload(pathComponents[0])
@@ -26,7 +25,7 @@ module.exports = function (self) {
2625

2726
pull(
2827
exporter(ipfsPath, self._ipld, options),
29-
pull.filter(filterFile),
28+
pull.filter(file => file.path === fileNameOrHash),
3029
pull.take(1),
3130
pull.collect((err, files) => {
3231
if (err) {

src/core/runtime/config-browser.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ module.exports = () => ({
2828
],
2929
Swarm: {
3030
ConnMgr: {
31-
LowWater: 600,
32-
HighWater: 900
31+
LowWater: 200,
32+
HighWater: 500
3333
}
3434
}
3535
})

src/core/runtime/config-nodejs.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ module.exports = () => ({
4141
],
4242
Swarm: {
4343
ConnMgr: {
44-
LowWater: 600,
45-
HighWater: 900
44+
LowWater: 200,
45+
HighWater: 500
4646
}
4747
}
4848
})

src/http/api/routes/webui.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ module.exports = [
1717
method: '*',
1818
path: '/webui',
1919
handler (request, h) {
20-
return h.redirect('/ipfs/QmXc9raDM1M5G5fpBnVyQ71vR4gbnskwnB9iMEzBuLgvoZ')
20+
return h.redirect('/ipfs/QmZepbAvvUvCqKmNjgf3dStoSToXCW9uQopx4vd2HFMELR')
2121
}
2222
}
2323
]

0 commit comments

Comments
 (0)