2022-07-13 13:16:24 +02:00
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
|
|
|
|
|
|
|
|
<meta charset="utf-8">
|
|
|
|
<title>Track your bike</title>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<div id="logo">
|
|
|
|
<pre>
|
|
|
|
_ _ _ _ _
|
|
|
|
| | (_) | | | |
|
|
|
|
___ _ __| |__ _| |_ __| | |__
|
|
|
|
/ _ \| '__| '_ \| | __| / _\` | '_\
|
|
|
|
| (_) | | | |_) | | |_ | (_| | |_) |
|
|
|
|
\___/|_| |_.__/|_|\__| \__,_|_.__/
|
|
|
|
|
|
|
|
Peer-to-Peer Database for the Decentralized Web
|
|
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<button id="open" type="button" disabled>Open</button>
|
|
|
|
|
|
|
|
<button id="create" type="button" disabled>Open</button>
|
|
|
|
|
|
|
|
<button id="status" type="button" disabled>Open</button>
|
|
|
|
<script src="example.js"></script>
|
|
|
|
<script type="text/javascript" src="lib/orbitdb.js" charset="utf-8"></script>
|
|
|
|
<script type="text/javascript" src="lib/ipfs.js" charset="utf-8"></script>
|
2022-07-18 15:18:07 +02:00
|
|
|
<script type="text/javascript" src="functions.js">
|
2022-07-13 13:16:24 +02:00
|
|
|
<!-- <script src="https://unpkg.com/ipfs@0.35.0/dist/index.min.js"></script> -->
|
|
|
|
<script src="https://www.unpkg.com/orbit-db/dist/orbitdb.min.js"></script>
|
|
|
|
<script>
|
|
|
|
</script>
|
|
|
|
<script>
|
2022-07-18 15:18:07 +02:00
|
|
|
//const initIPFS = async (IPFS, ORBITDB) => {
|
2022-07-13 13:16:24 +02:00
|
|
|
|
|
|
|
// Create IPFS instance
|
2022-07-18 15:18:07 +02:00
|
|
|
// const ipfsOptions = { repo: '/orbitdb/examples/browser/new/ipfs/0.33.1', }
|
|
|
|
//const ipfs = await Ipfs.create(ipfsOptions)
|
2022-07-13 13:16:24 +02:00
|
|
|
|
|
|
|
// Create OrbitDB instance
|
2022-07-18 15:18:07 +02:00
|
|
|
//const orbitdb = await OrbitDB.createInstance(ipfs)
|
2022-07-13 13:16:24 +02:00
|
|
|
|
2022-07-18 15:18:07 +02:00
|
|
|
//}
|
|
|
|
//initIPFS()
|
|
|
|
|
|
|
|
// async function createDb(){
|
2022-07-13 13:16:24 +02:00
|
|
|
// Create database instance
|
|
|
|
|
2022-07-18 15:18:07 +02:00
|
|
|
// Create IPFS instance
|
|
|
|
//const ipfsOptions = { repo: '/orbitdb/examples/browser/new/ipfs/0.33.1.2', }
|
|
|
|
//const ipfs = await Ipfs.create(ipfsOptions)
|
|
|
|
//const orbitdb = await OrbitDB.createInstance(ipfs)
|
|
|
|
//const db = await orbitdb.keyvalue('first-database')
|
|
|
|
// const address = db.address
|
|
|
|
// console.log(address)
|
|
|
|
//console.log(db.address.toString())
|
|
|
|
//await db.put('timestamp', '4.9123123/-8.1231')
|
|
|
|
//const value = db.get('timestamp')
|
|
|
|
//console.log(value)
|
|
|
|
//}
|
|
|
|
initIPFS()
|
|
|
|
createDb()
|
|
|
|
|
2022-07-13 13:16:24 +02:00
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<script type="text/javascript" charset="utf-8">
|
|
|
|
// Start the example
|
|
|
|
//main()
|
|
|
|
</script>
|
|
|
|
|
|
|
|
</body>
|
|
|
|
</html>
|