Giter Site home page Giter Site logo

tkacharya / kickstart-campaign Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 78 KB

Using blockchain to handle the backend of kickstarter . #blockchain #ethereum #solidity #rinkeby #infura

Solidity 10.39% JavaScript 89.39% Shell 0.23%
kickstarter kickstarter-camp blockchain solidity contracts metamask rinkeby infura udemy npm

kickstart-campaign's Introduction

kickstart-campaign

Build Status

Description

I have tried to build the code of KICKSTARTER , this is a website where people post their ideas and get investments around it promising to give the product to the investors. This can be secured more by use of blockchain ethereum , to track whether the money is being sent to vendors or being used in personal expenses. This code focuses on providing a basic approach of how we can track , approve expenses for the desired campaign.

This Project also includes a Frontend Web Designing in it created with the help of React , Next JS and deployed on 3000 port.

1. Clone the project

$ git clone https://github.com/tkAcharya/kickstart-campaign.git
$ cd kickstart-campaign

2. Install the modules required for the project

$ npm install
$ npm install --save solc ganache-cli web3 mocha

3. Run the test file

$ node ./ethereum/compile.js
$ npm test

NOTE : This should give you a sample of addresses , and should run the tests to verify the campaign build and end to end testing

The below step is not required for local setup

4. Deploy the Contract to Rinkeby Test Network

  • Download and setup the metamask extension of chrome (Store the passphrase with you)
  • You need to create a free account on infura.io
  • Create a project in the infura and store the endpoint for rinkeby network
  • Install the following packages(if not present)
$ npm install โ€“-save [email protected]
$ npm install -- save dotenv
  • Write the passphrase of metamask in the mnemonic field in .env file present in ethereum folder
  • Write the rinkeby test network link in the link field in .env file present in ethereum folder
  • Run node deploy.js [OR] Run sh runAndDeployContract.sh

5. Verify the deployed Contract to Rinkeby Test Network

After running the deploy file , you would have got a message like "Contract Deployed to "

Copy the xyz and paste it in rinkebyNetwork

You will be able to view your contract info in the dashboard.

6. Run the Frontend Part of it

After running the deploy file , you would have got a message like "Contract Deployed to "

Update the XYZ on factory.js

Update the infura address on web3.js

Run npm run dev-custom

This will run the next JS with the router in it , which takes care of dynamic routing

HIT http://localhost:3000/ to get the home page

API LIST

API Routed To
/ pages/index.js
/campaigns/new pages/campaigns/new,js
/campaigns/{Address} pages/campaigns/index.js
/campaigns/{Address}/requests pages/campaigns/requests/index.js
/campaigns/{Address}/requests/new pages/campaigns/requests/new

Features

  • Offline support
  • Cross-platform
  • Awesome sounds
  • No singup/login required
  • Auto launch
  • Auto updates

Ethereum Code Beautifiers for different editors

Learnt from Udemy Course Link


If facing some issues :

  1. Always remove node_modules folder and then do <node install updates> to get all the dependencies

  2. If facing ganache or web3 related issues (web3 is in constant modification so , use the versioning instead .26) After that run <npm install --save mocha ganache-cli [email protected]>

  3. Put the console.log and verify if any variable from the compile is coming as undefined. Now run to verify if the whole code is working

Basic Terminologies in the Solidity Code :

  • Contracts : this contains .sol file mentioning our contract

  • test : this contains the test.js file (using some mocha code)

  • package.json : we keep this inside our root directory (have some script inside it , and it also captures different dependency being used)

  • compile.js : compiles our soldity files (node compile.js)

  • deploy.js : script file to take the compiled code and deploy it.

  • Running the tests : npm run test

kickstart-campaign's People

Contributors

tkacharya avatar

Stargazers

 avatar  avatar

Watchers

 avatar

kickstart-campaign's Issues

Error: transaction underpriced

node:internal/process/promises:246
triggerUncaughtException(err, true /* fromPromise */);
^

Error: transaction underpriced
at /Users/sandeep/Downloads/kickstart-campaign-master/node_modules/web3-provider-engine/subproviders/web3.js:15:44
at XMLHttpRequest.request.onreadystatechange (/Users/sandeep/Downloads/kickstart-campaign-master/node_modules/truffle-hdwallet-provider/node_modules/web3/lib/web3/httpprovider.js:118:13)
at XMLHttpRequest.dispatchEvent (/Users/sandeep/Downloads/kickstart-campaign-master/node_modules/xhr2/lib/xhr2.js:76:20)
at XMLHttpRequest._setReadyState (/Users/sandeep/Downloads/kickstart-campaign-master/node_modules/xhr2/lib/xhr2.js:422:14)
at XMLHttpRequest._onHttpResponseEnd (/Users/sandeep/Downloads/kickstart-campaign-master/node_modules/xhr2/lib/xhr2.js:616:14)
at IncomingMessage. (/Users/sandeep/Downloads/kickstart-campaign-master/node_modules/xhr2/lib/xhr2.js:568:23)

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.