lfrKain / eth-messaging

Web dapp for sending messages between ethereum accounts.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

eth-messaging

Screenshot

This project is my solution for a challenge proposed at my current company ioBuilders.

In summary, the challenge consists in a dapp for sending messages between ethereum accounts. The following points should be achieved:

  • Message data should be stored off-chain in an external repository.
  • Only the receiver of the message should be able to read the message, no one else.
  • It should be possible to send anonymous messages.

Tech stack

How to test

Step 1:

Run npm install.

Step 2:

Run a local swarm node with docker docker run -p 8500:8500 -e PASSWORD=password123 -t ethdevops/swarm --httpaddr 0.0.0.0.

Step 3:

Execute npm run dev. This will start ganache-cli, deploy smart contract wih truffle and deploy and run the application with lite-server on port 3000.

Ganache-cli is started with 4 predefined ethereum private keys you can use to test the dapp:

  • Alice -> 9b3b72cc4b29b4e7d0c39962ca3a7db11e1e60a1353e39705d82b36012694caf
  • Bob -> eeb80a1e35c9db4dabd237edb5fd2827312ac2ce32723f163d067169c870eff1
  • Frank -> b5a3091a455b493dab6f53825b92301f2f77ea9bbe2ff4bb5e65486e97126b39
  • e5a90dceea42ad2ec7360f08185089ba6187f3422d974872cff5219801f8c84b for sending anonymous messages.

For testing how messages are sent from one account to another, you should import at least 2 of these accounts into Metamask in differenct browser instances. In Chrome, each instance should have a different profile. For opening Chrome with a different profile than default in linux, execute google-chrome --profile-directory=Temp. Also CORS should be enabled to be able to interact with swarm, i suggest to use this chrome plugin.

Additional commands

Execute contract tests:

npm run truffle test

Execute contract tests with coverage:

./node_modules/.bin/solidity-coverage

Execute Solium:

npm run solium

About

Web dapp for sending messages between ethereum accounts.

License:MIT License


Languages

Language:JavaScript 99.7%Language:HTML 0.3%