좋은 프로그램은 마음의 여유에서 나온다.

EOS DAPP 개발(삽질)하기2 본문

블록체인/EOS

EOS DAPP 개발(삽질)하기2

좋은데이 2018.05.08 16:26

맥에서 빌드가 실패하여..(다양한 에러,, 해결하면 계속 나와서)


도커를 깔고 ubuntu 16.04 에서 빌드 시도.


$ docker run -it ubuntu bash
$ apt-get update
$ apt-get install libcurl4-gnutls-dev libexpat1-dev gettext libz-dev libssl-dev
$ apt-get install git
$ apt-get install sudo
$ git clone https://github.com/EOSIO/eos --recursive
$ cd eos
$ ./eosio_build.sh
	 _______  _______  _______ _________ _______
	(  ____ \(  ___  )(  ____ \\__   __/(  ___  )
	| (    \/| (   ) || (    \/   ) (   | (   ) |
	| (__    | |   | || (_____    | |   | |   | |
	|  __)   | |   | |(_____  )   | |   | |   | |
	| (      | |   | |      ) |   | |   | |   | |
	| (____/\| (___) |/\____) |___) (___| (___) |
	(_______/(_______)\_______)\_______/(_______)

	EOS.IO has been successfully built. 1:39:44

	To verify your installation run the following commands:


1시간 40분정도 걸려서 빌드가 완료됨.


빌드가 잘됐는지 확인하기 위해 몽고를 실행하고


$ ~/opt/mongodb/bin/mongod -f ~/opt/mongodb/mongod.conf &
$ cd build
$ make test


* 몽고디비 실행에 실패하면 bind ip를 변경해준다.




$ vi ~/opt/mongodb/mongod.conf

bindIp = 0.0.0.0


* 테스트시에 nodeos_run_test-mongodb에서 failed가 나오는데, 만약 나온다면 build 디렉토리를 삭제하고, 빌드부터 다시 시작하면 됨(왜지?)



31/33 Test #31: distributed-transactions-test ..........   Passed   42.37 sec
      Start 32: distributed-transactions-remote-test
32/33 Test #32: distributed-transactions-remote-test ...   Passed   62.47 sec
      Start 33: restart-scenarios-test_resync
33/33 Test #33: restart-scenarios-test_resync ..........   Passed  145.33 sec
100% tests passed, 0 tests failed out of 33

Total Test time (real) = 791.26 sec


설치하기


$ cd build

$ sudo make install 
-- Installing: /usr/local/var/lib/eosio
-- Installing: /usr/local/bin/cleos
-- Installing: /usr/local/bin/keosd
-- Installing: /usr/local/bin/eosio-launcher
-- Installing: /usr/local/bin/eosio-abigen
-- Installing: /usr/local/bin/eosiocpp



실행하기


$ cd build/programs/nodeos


$ ./nodeos -e -p eosio --plugin eosio::wallet_api_plugin --plugin eosio::chain_api_plugin


3195501ms thread-0   producer_plugin.cpp:239       block_production_loo ] eosio generated block b2aa05b0... #96710 @ 2018-05-09T00:53:15.500 with 0 trxs, lib: 96709

3196001ms thread-0   producer_plugin.cpp:239       block_production_loo ] eosio generated block 000af1ad... #96711 @ 2018-05-09T00:53:16.000 with 0 trxs, lib: 96710

3196508ms thread-0   producer_plugin.cpp:239       block_production_loo ] eosio generated block 0fb991c3... #96712 @ 2018-05-09T00:53:16.500 with 0 trxs, lib: 96711

3197001ms thread-0   producer_plugin.cpp:239       block_production_loo ] eosio generated block a53a4d90... #96713 @ 2018-05-09T00:53:17.000


// 플러그인 목록

https://developers.eos.io/eosio-nodeos/docs/history_api_plugin



* 도커 이미지로 테스트 노드 바로 실행하기


이오스 소스 디렉토리에서 Dcoker로 이동


$ eos git:(master) cd Docker


$ Docker git:(master) ls


Dockerfile                  cleos.sh                    docker-compose.yml

README.md                   config.ini                  nodeosd.sh

builder                     docker-compose-dawn3.0.yaml


$ Docker git:(master) docker build . -t eosio/eos


Sending build context to Docker daemon  24.06kB

Step 1/14 : FROM eosio/builder as builder

latest: Pulling from eosio/builder

297061f60c36: Pull complete

e9ccef17b516: Pull complete

dbc33716854d: Pull complete

8fe36b178d25: Pull complete

686596545a94: Pull complete

974005a02d1e: Pull complete

baeba8f600c2: Pull complete

7f6e9f1f5e2d: Pull complete

64bf6088845b: Pull complete

e2c9bb4925e3: Extracting  13.64MB/13.64MB

4840741b6408: Download complete

3705a019f35a: Download complete

f7dcd62b7393: Download complete

c7e24bdbfeb2: Download complete

3c0176556a1c: Download complete

ceee447dcb4d: Download complete

7d22bab085bf: Download complete


Successfully built 838363728096

Successfully tagged eosio/eos:latest



도커 컨테이너 실행


docker run --name nodeos -p 8888:8888 -p 9876:9876 -t eosio/eos nodeosd.sh arg1 arg2


$ curl http://127.0.0.1:8888/v1/chain/get_info

{"server_version":"2ae61517","head_block_num":33,"last_irreversible_block_num":32,"head_block_id":"0000002100f6c0ff12d63abf7d0de8279920899d3291d4357c028c22df80ab90","head_block_time":"2018-05-09T02:18:08","head_block_producer":"eosio"}



'블록체인 > EOS' 카테고리의 다른 글

EOS HTTP API 외부 요청 허용  (0) 2018.06.19
EOS dawn 1.0.2 노드 실행 오류  (0) 2018.06.14
EOS 지갑 생성하기  (0) 2018.06.11
EOS DAPP 개발(삽질)하기3  (0) 2018.05.18
EOS DAPP 개발(삽질)하기2  (0) 2018.05.08
EOS DAPP 개발(삽질)하기  (0) 2018.04.27
0 Comments
댓글쓰기 폼