IT/블록체인

[블록체인] 실습 순서

KimCookieYa 2022. 5. 2. 01:34

node -v

.profile의 경로를 .bashrc로 복붙

go version

peer version

docker images

docker ps

docker network ls

cd dev/fabcar

./startFabric.sh

cd ../dev/javascript

ls

npm install

# javascript 폴더 안에, node_modules 폴더 생서됨: ls로 확인

ls node_modules/ | grep fabric

 

node enrollAdmin.js

node registerUser.js

tree wallet/

node query.js

node invoke.js

invoke.js 안에 createCarOwner, bstudent로 수정하기

node invoke.js 하면, 블록 4까지 생성됨.

docker logs peer0.org1.example.com

 # 2주차 1

hyperledger explorer 설치

cd

cd dev/(dev 폴더로 가기)

git clone https://github.com/saarc/h-explorer.git

 

GitHub - saarc/h-explorer

Contribute to saarc/h-explorer development by creating an account on GitHub.

github.com

cd h-explorer/

cd hyperledger-explorer/

docker-compose up -d (필요한 데이터를 자동으로 다운로드함)(네트워크 관련 컨테이너가 2개 더 수행될 것)

docker ps -a(추가된 컨테이너 확인)

history 10(최근 사용한 명령어 10개)

* localhost:8080 으로 익스플로러 웹서버에 접근가능

docker-compose down -v (웹서버 종료)

cd

cd fabric-samples/basic-network/

./teardown.sh (네트워크 컨테이너 삭제)

docker ps -a, docker images dev-*, docker network ls 로 컨테이너가 종료되었는지 확인