Created
April 13, 2019 15:00
-
-
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
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"); | |
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