GithubHelp home page GithubHelp logo

voting-scrypt's Introduction

Voting

This is training exercise I've forked from this https://github.com/sCrypt-Inc/voting.git Credit goes to sCripy-Inc

Step 1. Clone the project

$ git clone https://github.com/GowthamNaruto/voting-scrypt.git

Step 2. Install dependencies

$ cd voting
$ npm install

Step 3. Compile contract

$ npx scrypt-cli compile

Step 4. Add your API Key

Use your own API key in file index.tsx. If you don't have it, please follow this guide to get one.

Scrypt.init({
	apiKey: 'YOUR_API_KEY', // <---
	network: 'testnet',
});

Step 5. Deploy contract

Before deploying the contract, create a .env file and save your private key in the PRIVATE_KEY environment variable.

PRIVATE_KEY=xxxxx

If you don't have a private key, please follow this guide to generate one using Sensilet wallet, then fund the private key's address with our faucet.

Run the following command to deploy the contract.

$ npm run deploy:contract

After success, you will see an output similar to the following:

Copy the deployment TxID then change the value of ContractId in file src/App.tsx:

const contract_id = {
	txId: 'bccf73c0f49920fdbd2c66972b6ab14ac098239c429176acf5e599acb7dc6d4a',
	outputIndex: 0,
};

Step 6. Run the frontend app

$ npm start

Runs the app in the development mode. Open http://localhost:3000 to view it in the browser.

voting-scrypt's People

Contributors

gowthamnaruto 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.