text: exports.id=0,exports.modules={"./src/server/server.js":function(e,r,o){"use strict";o.r(r);var t,s=o("./build/contracts/FlightSuretyApp.json"),n=o("./src/server/config.json"),l=o("web3"),u=o.n(l),c=o("express"),i=o.n(c),a=n.localhost,f=new u.a(new u.a.providers.WebsocketProvider(a.url.replace("http","ws"))),g=new f.eth.Contract(s.abi,a.appAddress);f.eth.getAccounts().then(function(e){console.log("Server Is Running...");for(var r=0;r<20;r++)console.log(r),g.methods.registerOracle().send({from:e[20+r],value:f.utils.toWei("1","ether"),gas:3e5},function(e,r){});g.events.OracleRequest({fromBlock:0},function(r,o){if(r)console.log("Error listening to event",r);else if(o){console.log("from inside event"),t=o;for(var s=function(r){g.methods.getMyIndexes().call({from:e[20+r]},function(o,s){if(s)for(var n=0;n<3;n++)try{g.methods.submitOracleResponse(Number(s[n]),t.returnValues.airline,t.returnValues.flight,Number(t.returnValues.timestamp),20).send({from:e[20+r],gas:3e5},function(e,r){})}catch(e){console.log("\nError",n,Number(s[n]),t.returnValues.flight,Number(t.returnValues.timestamp))}else o&&console.log("Error getting indexes",o)})},n=0;n<20;n++)s(n)}}),g.events.OracleReport({fromBlock:0},function(e,r){console.log("OracleReport",r.returnValues.status)}),g.events.FlightStatusInfo({fromBlock:0},function(e,r){console.log("FlightStatusInfo",r.returnValues.status)})}).catch(function(e){console.log("Server Error",e)});var m=i()();m.get("/api",function(e,r){r.send({message:"An API for use with your Dapp!"})}),r.default=m}};