Skip to content

Messenger dapp based on PSS protocol over Ethereum Swarm

License

Notifications You must be signed in to change notification settings

okamilab/nebula

Repository files navigation

CircleCI

Nebula

Messager dapp based on PSS over Ethereum Swarm. We built a basic communication protocol over PSS which includes typed messages allowing to send invitation requests, responses and direct messages. We implemented UI for the dapp on React. The dapp contains different modules - chat, contact, setting. The setting module allows connecting the dapp to different Swarm nodes, as well as set security settings. The contact module allows managing contacts, resolving contacts by publicKey, address or ENS name. The chat module allows managing chats.

As our next steps, we plan to compile Swarm to WebAssembly in order to run it in web-browser as well as build the mobile library to run the dapp on mobile.

Try it

You can run the dapp http://nebuladapp.net. In order to run swarm take a look #Running nebula section.

NOTE: You need to force insecure connection (http://) in order to connect to swarm WebSocket (ws://). It is not possible to connect to secure WebSocket at the moment.

Playground

In order to play with Nebula you can use predefined nodes:

Roadmap

  • Improvements

    • Restore connection after lose #21
    • Copy-full-key-hex--to-clipboard for publicKeys #20
    • Fix messages order in chat #22
  • Routing

    • Avoid broadcasting, reveal address partially
  • File sharing

    • Data encryption
  • State management

    • Save/restore state to/from swarm
    • Data encryption
    • Auto/manual state backup
  • UX improvements

    • Design
      • Material-UI
    • Contact management
      • Add possibility to change contact usename
      • Manage of declined contacts
    • Chat management
      • Add possibility to set chat name
      • Add possibility to check chat info (participants, stat)
      • Add possibility to leave chat
      • Optimize chat representation (render last X messages, the rest - on demand)
      • Highlighting unread messages
      • Archive chat
      • Images preview
      • Smiles/Emoji
    • Notification
      • Contact mutations (received request, added or declined request events)
      • Chat mutations (received message, contact left events)
      • DApp events (connection lost, etc.)
  • ENS

    • Investigate possibility of ENS integration, using ENS for contacts and own PSS address
    • Experiment with ENS by extending the protocol for using PSS addresses
  • Research

    • Investigate swarm execution options, is it possible to run without unlock an account. In order to provide one swarm instance for multiple accounts
    • Investigate possibility to create multi users chats
    • Investigate payments initiated from chat
    • Investigate possibility to run the dapp on mobile
    • Investigate possibility to run the dapp as a browser extension
  • Feeds

    • Investigate feeds
    • Experiment with feeds, store personal data in swarm
  • Non-functional

    • Unit/integration testing
    • Linting
    • Investigate how to deploy the dapp properly
    • Continuous deployment to GitHub pages
  • Hosting

    • Buy ENS name
    • Buy domain name
    • Proxy from domain name to ENS (?)

Introduction

Nebula intro

Updates

  1. Nebula Ðapp
  2. Nebula Ðapp Development Update #1

Building the source

Make sure you have installed the necessary dependencies using npm:

$ npm i

To build a production version of the web application, run the following, command in your command prompt:

$ npm run build

This will build both the server and client bundle in the build/ directory.

Running nebula

The project works with local instanse of swarm, default endpoint ws://127.0.0.1:8546. It can be changed on settings page.

  1. First important step is to run swarm

    The command may look like:

    swarm --bzzaccount <address> --ws --wsorigins "*" --corsdomain "*"

    The commands enable the WS-RPC server --ws, allows any origins from which to accept websockets requests --wsorigins "*" and allows any domains from which to accept http requests --corsdomain "*"

    ATTENTION: the command is not secure, it is suitable only for testing purpose. Otherwise, you need to restrict origins

    By default, WS-RPC runs at ws://127.0.0.1:8546, nebula will connect with this endpoint, otherwise you need to change settings in nebula dapp.

  2. To run the development version of the web application, run the following command in your command prompt:

    $ npm start

    or, the production server that serves the web application can be launched using:

    $ node build/index.js

    This will host the web application at http://localhost:3000. The host and port can be customized using respectively the environmental variables HOST and PORT. Any changes made on the code base are detected and will hot reload changed parts of the application.

References

  1. https://swarm.ethereum.org
  2. https://swarm-guide.readthedocs.io/en/latest