6. TCP 헤더 구조
Source port : 메시지를 보내는 측에서 통신을 위해 사용하는 port 번호
Destination port ; 메시지 받는 측의 통신 port번호
Sequence number : 송신자가 지정하는 순서 번호, TCP에서는 전송 데이터의 각 바이트마다 순서 번호가
존재한다.
ACK : 다음에 받을것으로 예상되는 데이터 옥텟의 순서 번호를 나타낸다
7. 실행 - wireshark
실행 직후 결과
Source Port : 58500 Destination Port : 3000
Source Port : 3000 Destination Port : 58500
11. Hyperledger-fabric Service
Project layout
Folder name File name Description
Blockchain
Invoke.go 값이 수정될 때 호출된다.
Query.go State를 얻는다.
Setup.go 변수들을 생성하고 변수와 설정을
초기화 시킨다.
Chaincode Main.go Chaincode를 초기화 시킨다.
Web
controllers Controller.go
Home.go
Request.go
templates Home.html
Layout.html
Request.html
12. Hyperledger-fabric Service
Hello의 상태를 얻기위해 chaincode에 QueryHello가 query.Query.go
Event hub와 chain, client 를 설정하고 configuration file을 읽고 초기화한다.
-초기화 하기 위해서 변수들을 추가한다.
-SDK를 configuration 파일과 함께 초기화한다.
-자원 관리 client는 채널 관리에 책임을 진다.
-MSP client는 그들의 identity에서부터 유저의 정보(채널을 저장하기 위해서 필요한 signing identity)를
retrieve하기위해 우리를 allow 한다.
-admin user가 전에 만들어진 채널에 join할 수 있도록 만든다.
-peer들에게 보내질 chaincode package를 생성한다.
-org peer들에 example cc 를 설치한다.
-chaincode policy를 설정한다.
-channel client는 query을 사용하고 트랜잭션을 실행한다.
-채널 event 에 접근이 가능한 client의 생성
Setup.go
실행 후 hello의 value를 수정하게 될 때 호출된다.
Arguments를 준비하고 데이터가 추가되게 된다.
Request(proposal)를 생성한 후 전송한다.
전송한 결과를 기다린 후 결과를 출력한다.
invoke.go
13. Hyperledger-fabric Service
Chaincode를 초기화한다.
-func init : chaincode가 install 되었을 때만 호출된다. 앞으로의 request를 handle하기 위해서 ledger를 준비한다.
-func invoke : invoke라 불리는 request들을 처리한다. ledger안의 모든 read, write function들을 처리한다.
-func query : ledger의 모든 readonly기능이 있다.
Main.go
14. Client Web Server
Example) 값 수정
request.html
Request.go
layout.html
invoke.go
controller.go
app.go
home.go
controller.go
home.html
favicon.ico
request.html
home.html
favicon.ico
request.html
home.html
favicon.ico