This is a proof of concept of a persistent OrbitDB Server.
The main idea is coming from orbit-db-pinner
Explore the docs »
·
Report Bug
·
Request Feature
Table of Contents
This is not a working server, this is a proof of concept for exploring OrbitDB in the browser.
Immediatly when you think about OrbitDB the problem of the persitence is comming.
In fact I have a static SPA application calling multiple SaaS services, and I need a communication beetween my connected users.
OrbitDB seems to be the perfect companion for that.
But what happens if no one is connected ?
The idea is to host this expressjs server on Heroku and ping from the SPA app…
Heroku will kill it after 30 min.
- Clone the repo
git clone https://github.com/eltorio/orbitdb-server.git
- Install NPM packages
npm install
- For TLS (optional)
#declare two variables each containing a single lined PEM export TLS_KEY="-----BEGIN RSA PRIVATE KEY-----\nMI………………………………………=\n-----END RSA PRIVATE KEY-----\n" export TLS_CERT="-----BEGIN CERTIFICATE-----\nMII…………………………………………==\n-----END CERTIFICATE-----\n"
- Launch
npm run dev;
- Populate
curl http(s)://localhost:3000/pin?address=[SOME-orbitb-path] curl http(s)://localhost:3000/start curl http(s)://localhost:3000/peers …
Currently server is working, OrbitDB bases are replicated. But WebRTCStar is not working.
So yet the best solution is to provide to browser clients the swarm address of the server in the bootstrap list.
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE.txt
for more information.
Project Link: https://github.com/eltorio/orbitdb-server