libresilient/config.js.example

41 wiersze
2.1 KiB
Plaintext

/*
* LibResilient config
*
* This is an example config for LibResilient. When deploying LibResilient on your website
* you will need to create your own config, using this one as a template.
*
*/
// plugins config
self.LibResilientConfig.plugins = [{
name: 'fetch'
},{
name: 'cache'
},{
name: 'any-of',
uses: [{
name: 'alt-fetch',
// configuring the alternate endpoints plugin to use IPNS gateways
//
// NOTICE: we cannot use CIDv0 with gateways that use hash directly in the (sub)domain:
// https://github.com/node-fetch/node-fetch/issues/260
// we *can* use CIDv1 with such gateways, and that's suggested:
// https://docs.ipfs.io/how-to/address-ipfs-on-web/#path-gateway
// https://cid.ipfs.io/
endpoints: [
'https://<CIDv1>.ipns.dweb.link/', // USA
'https://ipfs.kxv.io/ipns/<CIDv0-or-CIDv1>/', // Hong Kong
'https://jorropo.net/ipns/<CIDv0-or-CIDv1>/', // France
'https://gateway.pinata.cloud/ipns/<CIDv0-or-CIDv1>/', // Germany
'https://<CIDv1>.ipns.bluelight.link/' // Singapore
]
},{
name: 'gun-ipfs',
gunPubkey: '<your-gun-pubkey>'
}]
}]
// we need to explicitly list components we want to see debug messages from
self.LibResilientConfig.loggedComponents = ['service-worker', 'fetch', 'cache', 'any-of', 'alt-fetch', 'gun-ipfs']