Coder Social home page Coder Social logo

blogchain's Introduction

Blogchain

Blogchain is a platform, Where bloggers can publish their blocks on the ethereum blockchain and get rewarded by readers sending them ether.

What do we do!

Ownership, immutability and reward, is what we deliver.

As a reader you can navigate all blogs, search by keyword or blogger address and when ever you feel rich and generous, you can buy a blogger a cup of coffee to keep crafting awesome blogs. Cup of coffee = sending 1 Ether to blogger

As a Blogger, post your great blogs and wait for readers feedback, a feedback in ether $_$

check out some of our users stories:

Always hated being forced to pay for
low quality articles, with blogchain I only
support when sense great effort and
a worthy blogger.
- Mark, reader

I post my blogs on blogchain for two reasons:
1- I am done with my content getting robbed,
now my blogs are safe and sound on the Ethereum blockchain
2- A reader can buy a cup of coffee with
one click, THE POWER OF CRYPTO BABYYY!
- Khaled, blogger

Stretch Requirements

Since storage on Ethereum is expensive, I used IPFS to store only an IPFS hash that I create when the blog is created, and which refer to the blog content on IPFS
Note: This is only applicable when you use this project front-end. check App.js

Installation

Blogchain requires

Try it on Rinkeby testnet:

Our smart contract is deployed on Rinkeby already, and thanks to INFURA and hdwallet-provider, you can interact with it using our react front-end, Awesome right!, the migration files are set, all you need to do:

1- Login to Metamask, switch to Rinkeby testnet
2- Fund your account with some ether https://faucet.rinkeby.io/
3- from bellow complete only the "Start front-end server" section Don't compile nor migrate for now

Start front-end server:

$ cd client
$ npm install
$ npm audit fix

Might get some errors after npm install don't worry about them, but If you got an error related to websocket module after npm audit fix run:

$ cd node_modules/websocket
$ rm -r .git/
$ cd ../..
$ npm audit fix

Finally:

$ npm run start

** Stop here and follow the use case steps bellow **

Try it on local environment:

$ truffle compile

In a seperate terminal window

$ ganache-cli

Login to Metamask with the mnemonic generated by Ganache-cli and switch to localhost to get the funded accounts

$ truffle migrate

Go back to Rinkeby:

$ truffle compile

Login to Metamask, switch to Rinkeby testnet

$ truffle migrate --network rinkeby

Use Case

1- Create a blog using account 1, confirm transaction on Metamask
2- Switch to account 2, because a blogger can't reward himself
3- Refresh the page
4- Send ether from account 2 to account 1 by clicking the blog row, confirm transaction on Metamask
5- Check balances

Deployment

Blogchain is currently deployed on Ropsten and Rinkeby test networks:

Tesnet Link
Ropsten https://ropsten.etherscan.io/address/0xa17f34912812608324d85d91f13e71e110327629
Rinkeby https://rinkeby.etherscan.io/address/0xa0ce8e6cc3a01499d35b2f8b36cc3e8c7a73bbd0

Note: I added the function getBlogByTd() to contract after ropsten deployment, I added it for testing porpuses only, so it is not in the deployed contract on ropsten.

Testing

I wrote a simple test, but on executing it is throwing error: "VM Exception while processing transaction: invalid opcode"

Note: you might need to downgrade your Node version in order to be able to run the Javascript test this is a truffle node issue

blogchain's People

Contributors

mohamadalkhaldi avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.