This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var Ratings = artifacts.require("./Rating.sol"); | |
| module.exports = function(deployer) { | |
| deployer.deploy(Ratings,['Star Wars', 'Avatar', 'Inception'], {gas: 6700000}); | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module.exports = { | |
| networks:{ | |
| development:{ | |
| host:"localhost", | |
| port:8545, | |
| network_id:'*' | |
| } | |
| } | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Web3 from 'web3'; | |
| const web3=new Web3(new Web3.providers.HttpProvider("http://localhost:8545")); | |
| let ratingABI=[{"constant":true,"inputs":[{"name":"movie","type":"bytes32"}],"name":"totalVotesFor","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"bytes32"}],"name":"ratingsReceived","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"movie","type":"bytes32"}],"name":"voteForMovie","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"movieList","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"movieNames","type":"bytes32[]"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"}] | |
| let ratingAddress='0x42b9991505950cc5ac38a6557d8efcdc40235de6'; | |
| web3.eth.de |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, { Component } from 'react'; | |
| import logo from './logo.svg'; | |
| import './App.css'; | |
| import { ratingContract } from "./EthereumSetup"; | |
| import {ShowMovies } from "./ShowMovies"; | |
| class App extends Component { | |
| constructor(props){ | |
| super(props) | |
| this.state={ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, { Component } from 'react'; | |
| import './ShowMovies.css' | |
| export class ShowMovies extends Component{ | |
| handleChange=(movie)=>{ | |
| let _movie=movie; | |
| this.props.vote(_movie) | |
| } | |
| render(){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| table, th, td { | |
| border: 1px solid #ccc; | |
| margin: 0 auto; | |
| padding:3px; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "name": "invitation", | |
| "version": "1.0.0", | |
| "description": "", | |
| "main": "index.js", | |
| "dependencies": { | |
| "axios": "^0.17.1", | |
| "body-parser": "^1.18.2", | |
| "cookie-session": "^2.0.0-beta.3", | |
| "ejs": "^2.5.7", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const express = require("express"); | |
| const app = express(); | |
| var session = require("express-session"); | |
| const path = require("path"); | |
| var passport = require("passport"); | |
| var shortid = require("shortid"); | |
| const FacebookStrategy = require("passport-facebook").Strategy; | |
| const bodyParser = require("body-parser"); | |
| var nodemailer = require("nodemailer"); | |
| //set our client folder and view |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const { Client } = require("pg"); | |
| const client = new Client({ | |
| connectionString: process.env.DATABASE_URL, | |
| ssl: true | |
| }); | |
| //connection query and creation of tables | |
| client.connect(); | |
| const db_creation_string = `CREATE TABLE IF NOT EXISTS invitations(id SERIAL PRIMARY KEY, created_at TIMESTAMP, | |
| updated_at TIMESTAMP, link TEXT, senderId TEXT, sendermsg TEXT, senderName TEXT, | |
| receiverId TEXT); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| app.use(passport.initialize()); | |
| app.use(passport.session()); | |
| passport.serializeUser((user, done) => done(null, user)); | |
| // Deserialize user from the sessions | |
| passport.deserializeUser((user, done) => done(null, user)); | |
| //passport middleware | |
| passport.use( | |
| new FacebookStrategy( | |
| { |
OlderNewer