Created
January 18, 2022 21:47
-
-
Save petrosDemetrakopoulos/03312cdd8db1969a2f75757938bf6da6 to your computer and use it in GitHub Desktop.
EthairBalloons API dependencies
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 ethAirBalloons = require('ethairballoons'); | |
const path = require('path'); | |
const savePath = path.resolve(__dirname + '/contracts'); | |
const express = require('express') | |
const bodyParser = require('body-parser') | |
const app = express() | |
const port = 3000 | |
app.use(bodyParser.json()) | |
const ethAirBalloonsProvider = ethAirBalloons('http://localhost:8545', savePath); | |
const Car = ethAirBalloonsProvider.createSchema({ | |
name: "Car", | |
contractName: "carsContract", | |
properties: [ | |
{ | |
name: "model", | |
type: "bytes32", | |
primaryKey: true | |
}, | |
{ | |
name: "engine", | |
type: "bytes32", | |
}, | |
{ name: "cylinders", | |
type: "uint" | |
} | |
] | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment