This file contains 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 solc = require("solc"); | |
// file system - read and write files to your computer | |
const fs = require("fs"); | |
// web3 interface | |
const Web3 = require("web3"); | |
// setup a http provider | |
const web3 = new Web3(new Web3.providers.HttpProvider("http://127.0.0.1:7545")); |
This file contains 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
// SPDX-License-Identifier: GPL-3.0 | |
pragma solidity >=0.7.0 <0.9.0; | |
struct Student{ | |
string name ; | |
uint rollno; | |
} | |
contract Crud{ |
This file contains 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
// SPDX-License-Identifier: GPL-3.0 | |
pragma solidity >=0.5.0 <0.9.0; | |
contract Array{ | |
uint[6] public fixedArr = [1,2,3]; //Fixed size array | |
uint[] public arr = [1,2,3]; //Dynamic array | |
function updateArrVal(uint index,uint val) public{ | |
arr[index] = val; |
This file contains 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"); | |
var geoip = require("geoip-lite"); | |
const app = express(); | |
app.use(express.json()); | |
app.get("/", (req, res) => { | |
var ip = req.headers['x-forwarded-for'] || req.connection.remoteAddress; | |
var geo = geoip.lookup(ip); | |
console.log(geo) |