https://dechat-mauromolinari-knobsit.vercel.app/
- Node.js >= v16
- Truffle and Ganache
- Npm/Yarn
git checkout main
- Run
npm install
in project root to install Truffle build and smart contract dependencies - Run local testnet in port
8545
with an Ethereum client, e.g. Ganache truffle migrate --network develop
truffle console --network develop
- Run tests in Truffle console:
test
develop
network id is 1337, remember to change it in Metamask as well!
cd client
npm install
npm run start
- Open
http://localhost:3000
0x301430E545f3EB3DA114233f46524642B1337125
When using proprietary platform to chat - like Discord, Slack, etc.. - we delegate our data to a third party and we need to rely on them for our privacy, message-encryption and files we share.
A simplified solution can be to create a webchat (Discord-like) in which users will be able to chat and exchage assets in different ways. In particular, users will be able to:
- login to the application;
- send, receive, deny, confirm friend requests tracked by a smart contract;
- manage friends tracked by a smart contract;
- chat through a webapp application based on Textile;
- store file via IPFS;
- exchange NFT stickers;
- send money between friends;
- audio and video calls.
I'm aware of the fact that paying fees for managing friends is not acceptable for the final users, was implemented in this way only for the purpose of completing the course. In the future the final users will not pay such fees, instead a smart contract with the necessary funds will be in charge of these operations.
- Enter service web site
- Login with Metamask
- Send friend request to another account
- Accept friend request with the other account
- Chat with your new friend directly or with the common chat
client
: Project's React frontend.contracts
: Smart contracts that are deployed in the Ropsten testnet.migrations
: Migration files for deploying contracts incontracts
directory.test
: Tests for smart contracts.
REACT_APP_TEXTILE=
REACT_APP_TEXTILE_COMMON_CHAT_SECRET=
REACT_APP_TEXTILE can be obtained through the textile hub by creating a new API key of type user group without Signature Authentication.
REACT_APP_TEXTILE_COMMON_CHAT_SECRET can be obtained from the funcion call PrivateKey.fromRandom()
(see utils/textile.ts
line 50) and is needed to generate a common identity for the common chat.
ROPSTEN_MNEMONIC=
ROPSTEN_INFURA_PROJECT_ID=