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

feat: preload object.new object.put object.patch.* #1471

Closed
wants to merge 15 commits into from

Conversation

alanshaw
Copy link
Member

depends on #1464

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]>
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 27, 2018
@ghost ghost added the status/in-progress In progress label Jul 27, 2018
@alanshaw alanshaw mentioned this pull request Jul 27, 2018
8 tasks
License: MIT
Signed-off-by: Alan Shaw <[email protected]>
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