You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

67 lines
2.1 KiB

<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>
<!--<script type="text/javascript" src="functions.js"> </script>-->
<!-- <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>
const simon = async (IPFS, ORBITDB) => {
// Create IPFS instance
const ipfsOptions = { repo: '/orbitdb/examples/browser/new/ipfs/0.33.1', }
const ipfs = await Ipfs.create(ipfsOptions)
// Create OrbitDB instance
const orbitdb = await OrbitDB.createInstance(ipfs)
// Create database instance
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)
}
simon()
</script>
</script>
<script type="text/javascript" charset="utf-8">
// Start the example
//main()
</script>
</body>
</html>