Post

Tron 살펴보기 - TronBox 시작하기

Tron 살펴보기 - TronBox 시작하기

Tron 살펴보기 - TronBox 시작하기

터미널에서 TronBox와 TronGrid을 빠르게 세팅하고 실행할 수 있습니다. TronBox와 TronGrid 이 2개의 툴로 MetaCoin App을 실행하고 Smart Contract 컴파일, Contract 배포, 마지막으로 Shasta 테스트넷에서 이벤트 쿼리를 실행할 수있습니다.

원래는 튜토리얼 영상이 있는데 게시자가 지운듯 싶습니다.

설치

  • Nodejs 5.0+
  • Windows, Linux, or Mac OS X
1
2
3
# tronbox를 글로벌로 설치합니다.
$ npm install -g tronbox
...
1
2
3
4
5
# tronbox는 v2.3.11입니다.
# solidity는 v0.4.24입니다.
$ tronbox version
Tronbox v2.3.11 (core: 4.1.13)
Solidity v0.4.24 (tron-solc)

Initialize a Tron-Box Project

Tronbox project 초기화

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# tronbox 프로젝트를 초기화합니다.
$ tronbox init
Downloading...
Unpacking...
Setting up...
Unbox successful. Sweet!

Commands:

  Compile:        tronbox compile
  Migrate:        tronbox migrate
  Test contracts: tronbox test

$ ls
contracts         migrations        test              tronbox-config.js tronbox.js
contractmigrationstesttronbox.js
스마트컨트렉트파일마이그레이션을 위한 자바스크립트파일스마트컨트렉트를 테스트하기 위한 자바스크립트 파일프로젝트의 설정파일로 fullnode address, 서버의 event server 정보가 존재합니다.

Basic Commands

기본 명령어

commandusage
tronbox compile모든 스마트 컨트렉트를 컴파일하며 컴파일된 결과는 ./build/contracts에 저장됩니다.
tronbox compile –compile-all다시 모든 스마트 컨트렉트를 컴파일 합니다.
tronbox migrate마지막 마이그레션이후의 변경된 컨트렉트를 배포합니다.
tronbox migrate –reset모든 마이그레이션을 다시 진행합니다.
tronbox test [test_script_path]모든 테스트 스크립트를 실행합니다. 옵션으로 –reset flag를 사용하여 테스트파일을 입력하실 수있습니다.
tronbox consoletronbox명령어를 지원하는 console입니다.
This post is licensed under CC BY 4.0 by the author.