VSCODE
Truffle
설치
// cmd 창에서
npm intsall -g truffle
truffle-config.js
- Truffle 프레임워크 설정 정보를 담은 파일
- src 폴더 내에 배치
require("babel-register");
require("babel-polyfill");
module.exports = {
networks: {
development: {
host: "127.0.0.1",
port: 7545,
network_id: "*", // Match any network id
},
},
// Solidity Contract를 담는 디렉토리
contracts_directory: "./src/contracts/",
// Transaction의 JSON 정보를 저장하는 디렉토리
contracts_build_directory: "./src/truffle_abis/",
compilers: {
solc: {
version: "^0.5.0",
optimizer: {
enabled: true,
runs: 200,
},
},
},
};
run_migrations.js
const Migrations = artifacts.require("Migrations");
module.exports = function deployer() {
deployer.deploy(Migrations);
};