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

feat: preload mfs and dag.put #1468

Closed
wants to merge 16 commits into from
Closed

feat: preload mfs and dag.put #1468

wants to merge 16 commits into from

Conversation

alanshaw
Copy link
Member

@alanshaw alanshaw commented Jul 26, 2018

refs #1459

This PR will periodically submit your MFS root to the preload nodes when it changes. It also preloads content added via dag.put

Currently the changeset for just this PR is this commit: 1e6bc09

depends on #1464

alanshaw added 10 commits July 25, 2018 16:51
This PR adds a new config property `preload`:

```js
new IPFS({
  preload: {
    enabled: false,
    addresses: [{
      bootstrap: '/multiaddr/bootstrap/address/tcp/4001/ipfs/peerId',
      gateway: '/multiaddr/gateway/address/tcp/9090'
    }]
  }
})
```

* `preload.enabled` (default `false`) enables/disabled preloading
* `preload.addresses` array of node addresses to preload content on
    * `preload.addresses.0.bootstrap` the swarm address of the preload node. This is added to the node's bootstrap addresses
    * `preload.addresses.0.gateway` the gateway address of the preload node. This is the address we make a HTTP HEAD request to, to initiate the preload

After adding content with `ipfs.files.add*` or `ipfs.dag.put`, we make HTTP HEAD requests to _all_ preload gateway addresses (providing `preload.enabled` is true).

License: MIT
Signed-off-by: Alan Shaw <[email protected]>
License: MIT
Signed-off-by: Alan Shaw <[email protected]>
License: MIT
Signed-off-by: Alan Shaw <[email protected]>
License: MIT
Signed-off-by: Alan Shaw <[email protected]>
License: MIT
Signed-off-by: Alan Shaw <[email protected]>
License: MIT
Signed-off-by: Alan Shaw <[email protected]>
License: MIT
Signed-off-by: Alan Shaw <[email protected]>
@ghost ghost assigned alanshaw Jul 26, 2018
@ghost ghost added the status/in-progress In progress label Jul 26, 2018
@alanshaw alanshaw mentioned this pull request Jul 26, 2018
8 tasks
License: MIT
Signed-off-by: Alan Shaw <[email protected]>
License: MIT
Signed-off-by: Alan Shaw <[email protected]>
alanshaw added 2 commits July 26, 2018 22:50
License: MIT
Signed-off-by: Alan Shaw <[email protected]>
alanshaw added 2 commits July 27, 2018 07:02
License: MIT
Signed-off-by: Alan Shaw <[email protected]>
@alanshaw alanshaw closed this Jul 27, 2018
@ghost ghost removed the status/in-progress In progress label Jul 27, 2018
@daviddias daviddias deleted the feat/preload-mfs branch July 27, 2018 09:38
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant