2016-10-13 4 views
0

Bluemix의 Blockchain 구현을 사용하지 않고도이 예제를 컴퓨터에서 실행하려고합니다.대리석 예를 오프라인으로 실행할 때의 문제

https://github.com/IBM-Blockchain/marbles/blob/master/tutorial_part1.md#confignetwork

나는 hyperledger/직물 피어 고정 표시기 이미지를 다운로드하고 올바른 CORE_PEER_ID와 CORE_VM_ENDPOINT에 대응하는 고정 표시기-compose.yml 파일을 설정했습니다.

vp0: 
    image: hyperledger/fabric-peer 
    environment: 
    - CORE_PEER_ID=vp0 
    - CORE_PEER_ADDRESSAUTODETECT=true 
    - CORE_VM_ENDPOINT=172.17.0.1:2375 
    - CORE_LOGGING_LEVEL=DEBUG 
    command: peer node start 

이제 올바른 api_host 및 api_port와 함께 대리석 노드 응용 프로그램을 실행하려고합니다.

var peers = [{ 
     "api_host": "172.17.0.2", //hostname or ip of peer 
     "api_port": 7051, //http port 
     "id": "vp0" //unique id of peer 
    }]; 

직물 피어 노드 응용 프로그램과의 연결 요청을 무시 보인다 응답 :

http://172.17.0.2:7051/chain 

:

vp0_1 | 2016/10/13 20:15:03 transport: http2Server.HandleStreams received bogus greeting from client: "POST /registrar HTTP/1.1" 

내가 우체부와 GET 요청을 보내도 시도 응답은

vp0_1 | 2016/10/13 20:13:23 transport: http2Server.HandleStreams received bogus greeting from client: "GET /chain HTTP/1.1\r\nHos" 

여기 내 GET 요청

Starting capstone_vp0_1 
Attaching to capstone_vp0_1 
vp0_1 | 20:11:36.771 [logging] LoggingInit -> DEBU 001 Setting default logging level to DEBUG for command 'node' 
vp0_1 | 20:11:36.771 [peer] func1 -> INFO 002 Auto detected peer address: 172.17.0.2:7051 
vp0_1 | 20:11:36.771 [peer] func1 -> INFO 003 Auto detected peer address: 172.17.0.2:7051 
vp0_1 | 20:11:36.772 [eventhub_producer] AddEventType -> DEBU 004 registering BLOCK 
vp0_1 | 20:11:36.772 [eventhub_producer] AddEventType -> DEBU 005 registering CHAINCODE 
vp0_1 | 20:11:36.772 [eventhub_producer] AddEventType -> DEBU 006 registering REJECTION 
vp0_1 | 20:11:36.772 [eventhub_producer] AddEventType -> DEBU 007 registering REGISTER 
vp0_1 | 20:11:36.772 [nodeCmd] serve -> INFO 008 Security enabled status: false 
vp0_1 | 20:11:36.772 [nodeCmd] serve -> INFO 009 Privacy enabled status: false 
vp0_1 | 20:11:36.772 [eventhub_producer] start -> INFO 00a event processor started 
vp0_1 | 20:11:36.772 [db] open -> DEBU 00b Is db path [/var/hyperledger/production/db] empty [false] 
vp0_1 | 20:11:36.985 [chaincode] NewChaincodeSupport -> INFO 00c Chaincode support using peerAddress: 172.17.0.2:7051 
vp0_1 | 20:11:36.986 [chaincode] NewChaincodeSupport -> DEBU 00d Turn off keepalive(value 0) 
vp0_1 | 20:11:36.986 [sysccapi] RegisterSysCC -> INFO 00e system chaincode (noop,github.com/hyperledger/fabric/bddtests/syschaincode/noop) disabled 
vp0_1 | 20:11:36.986 [nodeCmd] serve -> DEBU 00f Running as validating peer - making genesis block if needed 
vp0_1 | 20:11:36.986 [state] loadConfig -> INFO 010 Loading configurations... 
vp0_1 | 20:11:36.986 [state] loadConfig -> INFO 011 Configurations loaded. stateImplName=[buckettree], stateImplConfigs=map[numBuckets:%!s(int=1000003) maxGroupingAtEachLevel:%!s(int=5) bucketCacheSize:%!s(int=100)], deltaHistorySize=[500] 
vp0_1 | 20:11:36.986 [state] NewState -> INFO 012 Initializing state implementation [buckettree] 
vp0_1 | 20:11:36.986 [buckettree] initConfig -> INFO 013 configs passed during initialization = map[string]interface {}{"numBuckets":1000003, "maxGroupingAtEachLevel":5, "bucketCacheSize":100} 
vp0_1 | 20:11:36.986 [buckettree] initConfig -> INFO 014 Initializing bucket tree state implemetation with configurations &{maxGroupingAtEachLevel:5 lowestLevel:9 levelToNumBucketsMap:map[2:13 3:65 9:1000003 1:3 8:200001 6:8001 4:321 7:40001 5:1601 0:1] hashFunc:0xab4560} 
vp0_1 | 20:11:36.986 [buckettree] newBucketCache -> INFO 015 Constructing bucket-cache with max bucket cache size = [100] MBs 
vp0_1 | 20:11:36.986 [buckettree] loadAllBucketNodesFromDB -> INFO 016 Loaded buckets data in cache. Total buckets in DB = [0]. Total cache size:=0 
vp0_1 | 20:11:36.987 [nodeCmd] serve -> DEBU 017 Running as validating peer - installing consensus 
vp0_1 | 20:11:36.987 [peer] initDiscovery -> DEBU 018 Retrieved discovery list from disk: [] 
vp0_1 | 20:11:36.987 [consensus/controller] NewConsenter -> INFO 019 Creating default consensus plugin (noops) 
vp0_1 | 20:11:36.988 [consensus/noops] newNoops -> DEBU 01a Creating a NOOPS object 
vp0_1 | 20:11:36.988 [consensus/noops] newNoops -> INFO 01b NOOPS consensus type = *noops.Noops 
vp0_1 | 20:11:36.988 [consensus/noops] newNoops -> INFO 01c NOOPS block size = 500 
vp0_1 | 20:11:36.988 [consensus/noops] newNoops -> INFO 01d NOOPS block wait = 1s 
vp0_1 | 20:11:36.988 [peer] chatWithSomePeers -> DEBU 01e Starting up the first peer of a new network 
vp0_1 | 20:11:36.988 [consensus/statetransfer] verifyAndRecoverBlockchain -> DEBU 01f Validating existing blockchain, highest validated block is 0, valid through 0 
vp0_1 | 20:11:36.988 [consensus/statetransfer] blockThread -> INFO 021 Validated blockchain to the genesis block 
vp0_1 | 20:11:36.988 [consensus/handler] 1 -> DEBU 020 Starting up message thread for consenter 
vp0_1 | 20:11:36.988 [rest] StartOpenchainRESTServer -> INFO 022 Initializing the REST service on 0.0.0.0:7050, TLS is disabled. 
vp0_1 | 20:11:36.988 [nodeCmd] serve -> INFO 023 Starting peer with ID=name:"vp0" , network ID=dev, address=172.17.0.2:7051, rootnodes=, validator=true 
vp0_1 | 20:11:36.988 [peer] ensureConnected -> DEBU 024 Starting Peer reconnect service (touch service), with period = 6s 
vp0_1 | 20:11:42.989 [peer] ensureConnected -> DEBU 025 Touch service indicates no dropped connections 
vp0_1 | 20:11:42.989 [peer] ensureConnected -> DEBU 026 Connected to: [] 
vp0_1 | 20:11:42.989 [peer] ensureConnected -> DEBU 027 Discovery knows about: [] 

답변

0

나머지 요청을 보내는 동안 잘못된 포트 (7051 실제로 grpc 포트입니다)를 사용하고 있기 때문에이 오류 메시지가 표시되는 전체 출력됩니다.

hyperledger 패브릭 피어의 기본 나머지 API 포트는 입니다. 그래서 GET 요청을해야한다 : http://172.17.0.2:7050/chain

나머지 인터페이스의 피어에서 사용중인 포트는 (로그에서 볼) 다음과 같은 로그 항목

vp0_1 | 20:11:36.988 [rest] StartOpenchainRESTServer -> INFO 022 Initializing the REST service on 0.0.0.0:7050, TLS is disabled. 
에 주목하여 확인할 수 있습니다