Hyperledger Fabric의 체인코드 Version과 Sequence의 차이

byron1st·2020년 12월 14일
0

Hyperledger Fabric v2.1에서는 체인코드를 Id, Version과 Sequence로 구분한다. 기존 v1.x 에서는 Id와 Version 만으로 구분했었는데, Sequence 라는 것이 추가되었다. “Id와 Version으로 충분한거 아닌가?”라고 생각했기에, Sequence의 의미를 커뮤니티에 물어보았다. 개인적으로 Sequence 값의 의미를 잘 이해하지 못했기 때문이다. 그 결과 다음과 같이 답변을 받았다. 좋은 답변이라 생각되어 글을 남긴다.

I see version is for chaincode, and sequence is for chaincode definition (deployment). For example, if you use the same chaincode but modify the chaincode definition (such as endorsement policy), you need to approve and commit a chaincode definition with a new sequence. If you have updated the chaincode, then you can use a new version and also a new sequence as you will have a different package ID (since you have modified the chaincode). As far as you are keeping the chaincodename, the channel-chaincodename maintains the state in the ledger.
체인코드 Version은 체인코드 바이너리에 대한 버전을 의미한다. 반면, Sequence는 체인코드, 그리고 체인코드의 운영에 대한 정의까지 포함한 버전을 의미한다. 체인코드의 정의(chaincode definition)는 체인코드 바이너리와 이를 운영하기 위한 정책(endorsement policy 등)으로 구성되며, 바이너리 자체에 대한 버전은 기존 Version으로, 정의 전체에 대한 버전은 Sequence 로 구분하는 것이다.

개인적으로 코드와 운영의 버전을 구분했다는 점에서 논리적이라고 생각하고 좋은 발전이라고 생각한다.

profile
Hyperledger Fabric, React/React Native, Software Architecture

0개의 댓글