Ethereum Friend Directory is a blockchain-based social graph which allows users to maintain a list of mutual connections. This list of connections can be accessed by any app on the decentralized web to allow for social use cases e.g. a portable following/follower list.
Requests are created and accepted off-chain. This is the most cost-effective way of facilitating this interaction. An implementation of these methods can be found in the tests directory.
- Alice creates a request by signing the hash of a message which contains her and Bob's address and sends it to Bob
- Bob signs the same message with Alice's signature added in
- Bob or Alice can confirm the request at any time by submitting it to the contract's
confirmRequest
method - Bob's address is added to Alice's set in the
adj
mapping and Alice to Bob's
- The adjacency list for each user in
adj
is read by the client to display who is friends with who. - ENS is used to resolve ENS domains and profile images
- Design - Figma
- Concept mapped out
- Contract
- Confirm request accept
- Remove friends
- Batch confirm
- Batch remove
- Add salt to hash arguments
- Frontend
- Basic components
- Connect/switch account and view profile
- Profile url
- ENS reverse resolution - ENS Docs
- Requests
- Create signature that you can send to someone
- Route to sign request to accept
- Route to publish friend confirmation
- Share request via URL
- Share request via QR code
- Store invites locally for batch confirm
- Remove friends
- View other accounts
- UX improvements
- Button hover states
- Button loading states
- Page loading states
- Mobile layout
- Testing
- Create ENS task
- Set profile image
- Deploy
- Growth/adoption
- Properly document contract call
- Sample code for Infura and Alchemy
- SDKs
- JavaScript
- Python
- Ruby
- Go
- React component
Reach out on Twitter @stephancill if you'd like to help out or make a PR.
yarn
yarn run node
In a separate terminal, to generate random data for the built in accounts:
yarn dev
cd client
yarn start
yarn test
- Update network in
hardhat.config.js
npx hardhat run deploy --network [network name]
cd client
- Add addresses for
PublicResolver
,ReverseRegistrar
,ReverseRecords
,ENS
inclient/deployments/map.json
(andEFD
if using an existing contract) - Build using
yarn build
Deploy client to IPFS using ipfs-deploy
- Install ipfs-deploy
npm install -g ipfs-deploy
- Deploy app
npx ipfs-deploy build
- Visit the HTTP gateway URL to check if it worked.