Skip to content

Instantly share code, notes, and snippets.

@schadokar
Created April 13, 2019 15:00
Show Gist options
  • Save schadokar/b921307da98fb5e704698488cba44b5b to your computer and use it in GitHub Desktop.
Save schadokar/b921307da98fb5e704698488cba44b5b to your computer and use it in GitHub Desktop.
docker-ethereum contract-API it will call deploy and compile function of ethereum
const express = require("express");
const router = express.Router();
const compile = require("../../ethereum/compile");
const deploy = require("../../ethereum/deploy");
// Compile the contract
router.post("/compile", async function(req, res, next) {
const result = compile();
res.send(result);
});
// Deploy the contract
router.post("/deploy", async function(req, res, next) {
const result = await deploy("Hello World!");
res.send(JSON.parse(result).address);
});
module.exports = router;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment