Develop/Block Chain

[Block Chain] Truffle Framework/개발 환경 구축

순무엄마동생 2021. 9. 10. 20:38

로컬 환경에서 Solidity(Smart Contract)를 쉽게 컴파일하고 배포할 수 있는 프레임워크

 

Truffle Framework 시작하기

1. node.js를 설치합니다.

2. vscode를 설치합니다. (꼭 vscode일 필요는 없습니다!)

3. truffle을 아래 명령어로 설치합니다.

npm -g install truffle

 

4. ganache-cli를 아래 명령어로 설치합니다.

npm i ganache-cli

 

5. init & tutorial

ganache-cli -d -m tutorial
truffle init

 

truffle init

init 후에는 아래 contracts/migrations/test가 나오는데

contracts는 Solidity Contract 디렉토리

migrations는 배포관련 스크립트 디렉토리

test는 테스트 디렉토리

build는 truffle compile 후에 생성되는 디렉토리다!