Blockchain (Hyperledger Fabric)/작업 중인 Solution

Hyperledger Composer 모델링 작업 Ver. 0.0.1

김야키 2019. 2. 22. 18:28

모델링 작업 (.CTO파일)

작성날짜 2019.02.22

Ver 0.0.1

/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ namespace org.example.mynetwork // 사용자 유형 enum Account{ o normal // 일반 학생 o accoutant // 회계 o master // 학회장 혹은 관리자 } // 학과

enum Major{ o bible         // 성서학과 o nurse        // 간호학과 o social        // 사회복지학과 o child         // 영유아보육학과 o software    // 컴퓨터소프트웨어학과 } // 학생 정보 participant Student identified by stdId{ o String stdId                         // 학번 o String stdName                      // 이름 o Account Account                     // 학생 유형 o Major major                           // 학과 o Double money                     // 소지 금액 o Boolean state default = true   // 학회비 납부 여부 }

/* * 학과별 학회비 정보 * Hyperledger Fabric에서 Asset은 상품의 정보를 뜻하고 있음 */ asset Dues identified by major{ o String major o Double duesMoney o Major inmajor } // 트랙잭션 설계 // Return 타입은 String형으로 Success/Fail 로 구분 @returns(String) transaction SendMoney{ --> Student normal     // 학회비를 지불하는 학생 --> Student accoutant // 학회비를 겉는 학생 즉, 회계 --> Dues dues            // 학과별 학회비 설정 정보 }


// 차후 관리자 측(master)에서 회계 권한을 줄 수 있는 트랜잭션 설계 예정


ISSUES

  1. 현제는 학교의 학과별로 제한 두었지만 차 후에 일반 사용자를 기준으로 둘 것이기 때문에 해당 모델을 수정 해야 함
  2. 당연히 Participant부분의 정보가 수정되면 Transaction 부분도 수정되어야 함
  3. Dues를 학회비 정보가 아닌 특정 단체에서 정하는 회비로 수정해야 함
    • 학과를 기준으로 두는것이 아닌 "단체"라는 추상 클래스를 생성해야 함
  4. namespace를 수정해야 함