Merge pull request #277 from orbitdb/fix/browser-examples

Fix browser examples
This commit is contained in:
Haad 2017-12-10 14:17:49 +01:00 committed by GitHub
commit 51b8e417e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 21 additions and 29 deletions

View File

@ -11,6 +11,8 @@ build: test
npm run build
cp dist/orbitdb.min.js examples/browser/lib/orbitdb.min.js
cp node_modules/ipfs/dist/index.min.js examples/browser/lib/ipfs.min.js
cp dist/orbitdb.js examples/browser/lib/orbitdb.js
cp node_modules/ipfs/dist/index.js examples/browser/lib/ipfs.js
@echo "Build success!"
@echo "Output: 'dist/', 'examples/browser/'"

View File

@ -27,8 +27,8 @@
Addresses: {
Swarm: [
// Use IPFS dev signal server
'/dns4/star-signal.cloud.ipfs.team/wss/p2p-webrtc-star',
// '/ip4/0.0.0.0/tcp/9090/wss/p2p-webrtc-star',
// '/dns4/star-signal.cloud.ipfs.team/wss/p2p-webrtc-star',
'/dns4/ws-star.discovery.libp2p.io/tcp/443/wss/p2p-websocket-star',
]
},
Bootstrap: [],

View File

@ -34,8 +34,8 @@
Addresses: {
Swarm: [
// Use IPFS dev signal server
'/dns4/star-signal.cloud.ipfs.team/wss/p2p-webrtc-star',
// '/ip4/0.0.0.0/tcp/9090/wss/p2p-webrtc-star',
// '/dns4/star-signal.cloud.ipfs.team/wss/p2p-webrtc-star',
'/dns4/ws-star.discovery.libp2p.io/tcp/443/wss/p2p-websocket-star',
]
},
Bootstrap: [],

View File

@ -7,6 +7,7 @@ const Uglify = require('uglifyjs-webpack-plugin')
const uglifyOptions = {
uglifyOptions: {
mangle: false,
compress: false,
},
}

2
dist/es5/OrbitDB.js vendored
View File

@ -291,7 +291,7 @@ var OrbitDB = function () {
// accessController.add('admin', this.key.getPublic('hex'))
// }
// Add keys that can write to the database
if (options && options.write) {
if (options && options.write && options.write.length > 0) {
options.write.forEach(function (e) {
return accessController.add('write', e);
});

2
dist/orbitdb.min.js vendored

File diff suppressed because one or more lines are too long

View File

@ -47,7 +47,7 @@
<div id="writerText"></div>
<script type="text/javascript" src="lib/orbitdb.min.js" charset="utf-8"></script>
<script type="text/javascript" src="lib/ipfs.min.js" charset="utf-8"></script>
<script type="text/javascript" src="lib/ipfs.js" charset="utf-8"></script>
<script type="text/javascript" src="example.js" charset="utf-8"></script>
<script type="text/javascript" charset="utf-8">
// Start the example

View File

@ -22,7 +22,6 @@ function handleError(e) {
}
const main = (IPFS, ORBITDB) => {
let ipfsReady = false
let orbitdb, db
let count = 0
let interval = Math.floor((Math.random() * 300) + (Math.random() * 2000))
@ -45,9 +44,8 @@ const main = (IPFS, ORBITDB) => {
// Create IPFS instance
const ipfs = new Ipfs({
// repo: '/orbitdb/examples/browser/ipfs' + new Date().getTime(),
repo: '/orbitdb/examples/browser/new/ipfs/0.27.0',
start: false,
repo: '/orbitdb/examples/browser/new/ipfs/0.27.3',
start: true,
EXPERIMENTAL: {
pubsub: true,
},
@ -55,21 +53,12 @@ const main = (IPFS, ORBITDB) => {
Addresses: {
Swarm: [
// Use IPFS dev signal server
'/dns4/star-signal.cloud.ipfs.team/wss/p2p-webrtc-star',
// '/dns4/star-signal.cloud.ipfs.team/wss/p2p-webrtc-star',
'/dns4/ws-star.discovery.libp2p.io/tcp/443/wss/p2p-websocket-star',
// Use local signal server
// '/ip4/0.0.0.0/tcp/9090/wss/p2p-webrtc-star',
]
},
Bootstrap: [],
Discovery: {
MDNS: {
Enabled: true,
Interval: 10
},
webRTCStar: {
Enabled: true
}
},
}
})

14
package-lock.json generated
View File

@ -1778,9 +1778,9 @@
"integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac="
},
"crdts": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/crdts/-/crdts-0.1.2.tgz",
"integrity": "sha512-fmJEhm4BxtTxMVFf1FvJEP4f57yyHxSLpGFW6sbL1zOlavGp6B39WSvX9J0fLjE0AtOLjdb0rPMN0K/sdSW+Pw=="
"version": "0.1.5",
"resolved": "https://registry.npmjs.org/crdts/-/crdts-0.1.5.tgz",
"integrity": "sha512-4Z/dQqa9qzMPlrE+zd0ecl53QFwaTZVVYTUgxvpF0k8OcOy4HY7c+C9brXp81eigLE0EKENTVp3CjIMY9b/ezg=="
},
"create-ecdh": {
"version": "4.0.0",
@ -4564,9 +4564,9 @@
}
},
"ipfs": {
"version": "0.27.1",
"resolved": "https://registry.npmjs.org/ipfs/-/ipfs-0.27.1.tgz",
"integrity": "sha512-sv82SR/0MJCyRgZ2VoHn1rKJbLTXKej1usRQjpg0sa78wVum+wzJm9QzaW5RaexFiGXJcE9w1tiopcAC1ysfJA==",
"version": "0.27.3",
"resolved": "https://registry.npmjs.org/ipfs/-/ipfs-0.27.3.tgz",
"integrity": "sha512-pUvmBE/Vo5vGPuChJchl/1AQBldjmtJU7iddtbR9iLz8f1qdtz2y7p9HyHsPM8N7t+VjB1Y+B2JchUap4wPdUg==",
"dev": true,
"requires": {
"async": "2.6.0",
@ -6968,7 +6968,7 @@
"resolved": "https://registry.npmjs.org/orbit-db-counterstore/-/orbit-db-counterstore-1.1.0.tgz",
"integrity": "sha512-25CtAWuT5Ni4rDLziNj5qbjgAP0d+nyWWV9Tx30VqPXgCA4hYG3hAgIs3EYCVLWIRFZH7xdCfLyHfXY/v8pQvg==",
"requires": {
"crdts": "0.1.2",
"crdts": "0.1.5",
"orbit-db-store": "2.1.0"
}
},