Пример #1
0
        public async Task <IHandler> Start()
        {
            var url = ParseUrl(_chaincodeSettings.PeerAddress);

            // TODO: TLS Stuff?

            var handler = _handlerFactory.Create(url.Host, url.Port);

            var chaincodeId = new ChaincodeID {
                Name = _chaincodeSettings.ChaincodeIdName
            };

            _logger.LogInformation("Registering with peer " +
                                   $"{url.Host}:{url.Port} as chaincode " +
                                   $"{_chaincodeSettings.ChaincodeIdName}");

            await handler.Chat(new ChaincodeMessage
            {
                Type    = ChaincodeMessage.Types.Type.Register,
                Payload = chaincodeId.ToByteString()
            });

            return(handler);
        }
Пример #2
0
 private static ChaincodeMessage NewRegisterChaincodeMessage(ChaincodeID chaincodeId)
 {
     return(new ChaincodeMessage {
         Type = ChaincodeMessage.Types.Type.Register, Payload = chaincodeId.ToByteString()
     });
 }