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.

77 lines
2.4 KiB

  1. <html>
  2. <head>
  3. <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
  4. <meta charset="utf-8">
  5. <title>Track your bike</title>
  6. </head>
  7. <body>
  8. <div id="logo">
  9. <pre>
  10. _ _ _ _ _
  11. | | (_) | | | |
  12. ___ _ __| |__ _| |_ __| | |__
  13. / _ \| '__| '_ \| | __| / _\` | '_\
  14. | (_) | | | |_) | | |_ | (_| | |_) |
  15. \___/|_| |_.__/|_|\__| \__,_|_.__/
  16. Peer-to-Peer Database for the Decentralized Web
  17. </pre>
  18. </div>
  19. <button id="open" type="button" disabled>Open</button>
  20. <button id="create" type="button" disabled>Open</button>
  21. <button id="status" type="button" disabled>Open</button>
  22. <script src="example.js"></script>
  23. <script type="text/javascript" src="lib/orbitdb.js" charset="utf-8"></script>
  24. <script type="text/javascript" src="lib/ipfs.js" charset="utf-8"></script>
  25. <script type="text/javascript" src="functions.js">
  26. <!-- <script src="https://unpkg.com/ipfs@0.35.0/dist/index.min.js"></script> -->
  27. <script src="https://www.unpkg.com/orbit-db/dist/orbitdb.min.js"></script>
  28. <script>
  29. </script>
  30. <script>
  31. //const initIPFS = async (IPFS, ORBITDB) => {
  32. // Create IPFS instance
  33. // const ipfsOptions = { repo: '/orbitdb/examples/browser/new/ipfs/0.33.1', }
  34. //const ipfs = await Ipfs.create(ipfsOptions)
  35. // Create OrbitDB instance
  36. //const orbitdb = await OrbitDB.createInstance(ipfs)
  37. //}
  38. //initIPFS()
  39. // async function createDb(){
  40. // Create database instance
  41. // Create IPFS instance
  42. //const ipfsOptions = { repo: '/orbitdb/examples/browser/new/ipfs/0.33.1.2', }
  43. //const ipfs = await Ipfs.create(ipfsOptions)
  44. //const orbitdb = await OrbitDB.createInstance(ipfs)
  45. //const db = await orbitdb.keyvalue('first-database')
  46. // const address = db.address
  47. // console.log(address)
  48. //console.log(db.address.toString())
  49. //await db.put('timestamp', '4.9123123/-8.1231')
  50. //const value = db.get('timestamp')
  51. //console.log(value)
  52. //}
  53. initIPFS()
  54. createDb()
  55. </script>
  56. </script>
  57. <script type="text/javascript" charset="utf-8">
  58. // Start the example
  59. //main()
  60. </script>
  61. </body>
  62. </html>