{"id":18487513,"url":"https://github.com/IBM/FabricNodeSDK-Starter","last_synced_at":"2025-04-08T20:31:22.527Z","repository":{"id":66064767,"uuid":"124962861","full_name":"IBM/FabricNodeSDK-Starter","owner":"IBM","description":"WARNING: This repository is no longer maintained :warning:  \u003e This repository will not be updated. The repository will be kept available in read-only mode.","archived":true,"fork":false,"pushed_at":"2019-05-26T18:20:11.000Z","size":5935,"stargazers_count":49,"open_issues_count":0,"forks_count":25,"subscribers_count":16,"default_branch":"master","last_synced_at":"2024-12-20T23:33:35.795Z","etag":null,"topics":["blockchain-network","hyperledger-fabric","hyperledger-fabric-sdk","ibmcode"],"latest_commit_sha":null,"homepage":"https://developer.ibm.com/code/patterns/explore-hyperledger-fabric-through-a-complete-set-of-apis/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/IBM.png","metadata":{"files":{"readme":"README-ko.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-03-12T23:11:45.000Z","updated_at":"2024-04-19T18:05:28.000Z","dependencies_parsed_at":"2023-02-20T18:31:20.390Z","dependency_job_id":null,"html_url":"https://github.com/IBM/FabricNodeSDK-Starter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IBM%2FFabricNodeSDK-Starter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IBM%2FFabricNodeSDK-Starter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IBM%2FFabricNodeSDK-Starter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IBM%2FFabricNodeSDK-Starter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/IBM","download_url":"https://codeload.github.com/IBM/FabricNodeSDK-Starter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247922901,"owners_count":21018883,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blockchain-network","hyperledger-fabric","hyperledger-fabric-sdk","ibmcode"],"created_at":"2024-11-06T12:50:31.427Z","updated_at":"2025-04-08T20:31:22.521Z","avatar_url":"https://github.com/IBM.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# Hyperledger Fabric Node SDK를 사용하여 블록체인 네트워크 생성하고 배포하기\r\n\r\n*다른 언어로 보기: [English](README.md)*\r\n\r\n## 블록체인 네트워크 설정하기\r\n\r\n\r\n\r\n블록체인 애플리케이션 빌드하기 파트1에 오신 것을 환영합니다. 첫번째 코드 패턴은 블록체인을 백엔드로 사용하여 피트니스 활동을 기록하고 fitcoin을 통한 상품의 주문과 같은 트랜잭션을 관리하는 비교적 더 큰 규모의 애플리케이션입니다. 이 시리즈의 첫 단계에서는 Hyperledger Fabric Node SDK를 사용하여 Hyperledger 블록체인 네트워크를 만들고 배포하는데 중점을 둡니다. 이 코드 패턴에는 두 명의 참가자, 즉 구매자 그리고 판매자/상점 피어가 있습니다. 구매자는 애플리케이션을 다운로드한 후 자신의 단계를 블록체인에 등록하고, 판매자는 구매자가 구매를 하기에 충분한 fitcoin을 가지고 있는지 확인합니다.\r\n\r\n\r\n\r\nIBM Cloud의 평생 무료인 lite 계정이 있다면 이 애플리케이션을 로컬에서 실행하시거나 [IBM Blockchain Starter Plan](https://www.ibm.com/blogs/blockchain/2018/03/getting-started-on-the-ibm-blockchain-platform-starter-plan/)을 사용하실 수 있습니다.\r\n\r\n\r\n\r\n## 구성 요소\r\n\r\n* Hyperledger Fabric\r\n\r\n* Docker\r\n\r\n* Node.js용 Hyperledger Fabric SDK\r\n\r\n\r\n\r\n\r\n\r\n## 애플리케이션 흐름도\r\n\r\n![Application Workflow](images/Pattern1-Build-a-network.png)\r\n\r\n\r\n\r\n## 사전에 필요한 지식\r\n\r\n* [Docker](https://www.docker.com/products/overview) - v1.13 or higher\r\n\r\n* [Docker Compose](https://docs.docker.com/compose/overview/) - v1.8 or higher\r\n\r\n\r\n\r\n## 순서\r\n\r\n1. [Build.sh를 실행하여 네트워크 빌드](#1-buildsh-스크립트-실행)\r\n\r\n2. [네트워크 시작](#2-네트워크-시작)\r\n\r\n3. [로그에서 결과 확인](#3-로그-확인)\r\n\r\n4. [블록체인 네트워크 확인](#4-블록체인-네트워크-확인)\r\n\r\n\r\n\r\n## 1. Build.sh 스크립트 실행\r\n\r\n다음 순서를 수행합니다:\r\n\r\n\r\n\r\na. 기존에 존재하는 블록체인 도커 이미지를 삭제하여 시스템을 초기화한다.\r\n\r\n\r\n\r\nb. 인증서를 발급한다.\r\n\r\n\r\n\r\n  * `crypto-config.yaml`(암호 설정파일)은 소속 기관이나 부서 등 Peers와 Orderers간 서로의 신분의 내용을 정의합니다.\r\n\r\n\r\n\r\nc. Peers, Orderers 그리고 Channel을 생성한다.\r\n\r\n\r\n\r\n  * `configtx.yaml` 파일은 블록체인 네트워크 또는 채널을 초기화하고, Orderer에게 체인의 가장 첫번째인 제네시스 블럭을 제공합니다. (Shop 또는 Fincoin 피어일 경우 멤버십 서비스는 각 채널 피어에 설치됨.)\r\n\r\n\r\n\r\nd. Orderer, Peer, Channel, Network 도커 이미지를 생성한다.\r\n\r\n\r\n\r\n### 새로운 터미널을 열어 다음 명령어 실행:\r\n\r\n```bash\r\n\r\nexport FABRIC_CFG_PATH=$(pwd)\r\n\r\nchmod +x cryptogen\r\n\r\nchmod +x configtxgen\r\n\r\nchmod +x generate-certs.sh\r\n\r\nchmod +x generate-cfgtx.sh\r\n\r\nchmod +x docker-images.sh\r\n\r\nchmod +x build.sh\r\n\r\nchmod +x clean.sh\r\n\r\n./build.sh\r\n\r\n```\r\n\r\n\r\n\r\n## 2. 네트워크 시작\r\n\r\n\r\n\r\n다음 테스트 실행 후 이 순서를 재진행하는 경우 'LOCALCONFIG' 환경변수가 정의되지 않도록 합니다.\r\n\r\n```bash\r\n\r\nunset LOCALCONFIG  \r\n\r\n```\r\n\r\n\r\n\r\n피어노드에 체인코드를 설치하고 블록체인 네트워크를 시작하기 위한 두 가지 옵션이 있습니다. 다음 중 하나를 선택하세요.\r\n\r\n* LevelDB 사용하여 블록체인 상태를 저장하는 경우, 다음 명령어를 실행하여 네트워크를 시작합니다:\r\n\r\n```bash\r\n\r\ndocker-compose -p \"fitcoin\" -f \"docker-compose.yaml\" up -d    \r\n\r\n```\r\n\r\n* CouchDB 사용하여 블록체인 상태를 저장하는 경우, 다음 명령어를 실행하여 네트워크를 시작합니다:\r\n\r\n```bash\r\n\r\ndocker-compose -p \"fitcoin\" -f \"docker-compose-couchdb.yaml\" up -d    \r\n\r\n```\r\n\r\n\r\n\r\n## 3. 로그 확인\r\n\r\n\r\n\r\n다음 스크립트를 실행하여 로그 결과를 확인합니다.\r\n\r\n\r\n\r\n**Command**\r\n\r\n```bash\r\n\r\ndocker logs blockchain-setup\r\n\r\n```\r\n\r\n**Output:**\r\n\r\n```bash\r\n\r\nRegister CA fitcoin-org\r\n\r\nCA registration complete  FabricCAServices : {hostname: fitcoin-ca, port: 7054}\r\n\r\nRegister CA shop-org\r\n\r\nCA registration complete  FabricCAServices : {hostname: shop-ca, port: 7054}\r\n\r\ninfo: [EventHub.js]: _connect - options {\"grpc.ssl_target_name_override\":\"shop-peer\",\"grpc.default_authority\":\"shop-peer\"}\r\n\r\ninfo: [EventHub.js]: _connect - options {\"grpc.ssl_target_name_override\":\"fitcoin-peer\",\"grpc.default_authority\":\"fitcoin-peer\"}\r\n\r\nDefault channel not found, attempting creation...\r\n\r\nSuccessfully created a new default channel.\r\n\r\nJoining peers to the default channel.\r\n\r\nChaincode is not installed, attempting installation...\r\n\r\nBase container image present.\r\n\r\ninfo: [packager/Golang.js]: packaging GOLANG from bcfit\r\n\r\ninfo: [packager/Golang.js]: packaging GOLANG from bcfit\r\n\r\nSuccessfully installed chaincode on the default channel.\r\n\r\nSuccessfully instantiated chaincode on all peers.\r\n\r\n```\r\n\r\n\r\n\r\n\r\n\r\n## 4. 블록체인 네트워크 확인\r\n\r\n\r\n\r\n다음 명령을 실행하여 네트워크에서 `invoke`와 `query` 기능을 테스트하세요:\r\n\r\n```bash\r\n\r\ncd configuration\r\n\r\nexport LOCALCONFIG=true\r\n\r\nnode config.js\r\n\r\ncd ..\r\n\r\ncd test/\r\n\r\nnpm install\r\n\r\n```\r\n\r\n\r\n\r\nLevelDB 사용 시, 다음 명령어를 실행합니다:\r\n\r\n```bash\r\n\r\nnode index.js\r\n\r\n```\r\n\r\n\r\n\r\nCouchDB 사용 시, 다음 명령어를 실행합니다:\r\n\r\n```bash\r\n\r\nnode indexCouchDB.js\r\n\r\n```\r\n\r\n\r\n\r\n\r\n\r\n## 추가 자료\r\n\r\n* [Hyperledger Fabric Documentation](https://hyperledger-fabric.readthedocs.io/en/release-1.1/)\r\n\r\n* [Hyperledger Fabric code on GitHub](https://github.com/hyperledger/fabric)\r\n\r\n\r\n\r\n## 라이센스\r\n\r\n[Apache 2.0](LICENSE)\r\n\r\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FIBM%2FFabricNodeSDK-Starter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FIBM%2FFabricNodeSDK-Starter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FIBM%2FFabricNodeSDK-Starter/lists"}