private void blockListen(TransactionContext transactionContext) throws CryptoException, InvalidArgumentException { this.transactionContext = transactionContext; PeerEvents.Register register = PeerEvents.Register.newBuilder() .addEvents(PeerEvents.Interest.newBuilder().setEventType(PeerEvents.EventType.BLOCK).build()).build(); PeerEvents.Event.Builder blockEventBuilder = PeerEvents.Event.newBuilder().setRegister(register) .setCreator(transactionContext.getIdentity().toByteString()) .setTimestamp(ProtoUtils.getCurrentFabricTimestamp()); if (null != clientTLSCertificateDigest) { logger.trace("Setting clientTLSCertificate digest for event registration to " + DatatypeConverter.printHexBinary(clientTLSCertificateDigest)); blockEventBuilder.setTlsCertHash(ByteString.copyFrom(clientTLSCertificateDigest)); } ByteString blockEventByteString = blockEventBuilder.build().toByteString(); PeerEvents.SignedEvent signedBlockEvent = PeerEvents.SignedEvent.newBuilder() .setEventBytes(blockEventByteString) .setSignature(transactionContext.signByteString(blockEventByteString.toByteArray())) .build(); sender.onNext(signedBlockEvent); }
/** * <code>optional .protos.ChaincodeReg chaincode_reg_info = 2;</code> */ public org.hyperledger.fabric.protos.peer.PeerEvents.ChaincodeReg.Builder getChaincodeRegInfoBuilder() { return getChaincodeRegInfoFieldBuilder().getBuilder(); } /**
/** * <code>optional .protos.ChaincodeReg chaincode_reg_info = 2;</code> */ private com.google.protobuf.SingleFieldBuilderV3< org.hyperledger.fabric.protos.peer.PeerEvents.ChaincodeReg, org.hyperledger.fabric.protos.peer.PeerEvents.ChaincodeReg.Builder, org.hyperledger.fabric.protos.peer.PeerEvents.ChaincodeRegOrBuilder> getChaincodeRegInfoFieldBuilder() { if (chaincodeRegInfoBuilder_ == null) { if (!(regInfoCase_ == 2)) { regInfo_ = org.hyperledger.fabric.protos.peer.PeerEvents.ChaincodeReg.getDefaultInstance(); } chaincodeRegInfoBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< org.hyperledger.fabric.protos.peer.PeerEvents.ChaincodeReg, org.hyperledger.fabric.protos.peer.PeerEvents.ChaincodeReg.Builder, org.hyperledger.fabric.protos.peer.PeerEvents.ChaincodeRegOrBuilder>( (org.hyperledger.fabric.protos.peer.PeerEvents.ChaincodeReg) regInfo_, getParentForChildren(), isClean()); regInfo_ = null; } regInfoCase_ = 2; onChanged();; return chaincodeRegInfoBuilder_; }
public Builder mergeFrom(org.hyperledger.fabric.protos.peer.PeerEvents.Interest other) { if (other == org.hyperledger.fabric.protos.peer.PeerEvents.Interest.getDefaultInstance()) return this; if (other.eventType_ != 0) { setEventTypeValue(other.getEventTypeValue()); } if (!other.getChainID().isEmpty()) { chainID_ = other.chainID_; onChanged(); } switch (other.getRegInfoCase()) { case CHAINCODE_REG_INFO: { mergeChaincodeRegInfo(other.getChaincodeRegInfo()); break; } case REGINFO_NOT_SET: { break; } } onChanged(); return this; }
/** * <code>optional .protos.ChaincodeReg chaincode_reg_info = 2;</code> */ private com.google.protobuf.SingleFieldBuilderV3< org.hyperledger.fabric.protos.peer.PeerEvents.ChaincodeReg, org.hyperledger.fabric.protos.peer.PeerEvents.ChaincodeReg.Builder, org.hyperledger.fabric.protos.peer.PeerEvents.ChaincodeRegOrBuilder> getChaincodeRegInfoFieldBuilder() { if (chaincodeRegInfoBuilder_ == null) { if (!(regInfoCase_ == 2)) { regInfo_ = org.hyperledger.fabric.protos.peer.PeerEvents.ChaincodeReg.getDefaultInstance(); } chaincodeRegInfoBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< org.hyperledger.fabric.protos.peer.PeerEvents.ChaincodeReg, org.hyperledger.fabric.protos.peer.PeerEvents.ChaincodeReg.Builder, org.hyperledger.fabric.protos.peer.PeerEvents.ChaincodeRegOrBuilder>( (org.hyperledger.fabric.protos.peer.PeerEvents.ChaincodeReg) regInfo_, getParentForChildren(), isClean()); regInfo_ = null; } regInfoCase_ = 2; onChanged();; return chaincodeRegInfoBuilder_; }
public Builder mergeFrom(org.hyperledger.fabric.protos.peer.PeerEvents.Interest other) { if (other == org.hyperledger.fabric.protos.peer.PeerEvents.Interest.getDefaultInstance()) return this; if (other.eventType_ != 0) { setEventTypeValue(other.getEventTypeValue()); } if (!other.getChainID().isEmpty()) { chainID_ = other.chainID_; onChanged(); } switch (other.getRegInfoCase()) { case CHAINCODE_REG_INFO: { mergeChaincodeRegInfo(other.getChaincodeRegInfo()); break; } case REGINFO_NOT_SET: { break; } } onChanged(); return this; }
/** * <code>optional .protos.ChaincodeReg chaincode_reg_info = 2;</code> */ private com.google.protobuf.SingleFieldBuilderV3< org.hyperledger.fabric.protos.peer.PeerEvents.ChaincodeReg, org.hyperledger.fabric.protos.peer.PeerEvents.ChaincodeReg.Builder, org.hyperledger.fabric.protos.peer.PeerEvents.ChaincodeRegOrBuilder> getChaincodeRegInfoFieldBuilder() { if (chaincodeRegInfoBuilder_ == null) { if (!(regInfoCase_ == 2)) { regInfo_ = org.hyperledger.fabric.protos.peer.PeerEvents.ChaincodeReg.getDefaultInstance(); } chaincodeRegInfoBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< org.hyperledger.fabric.protos.peer.PeerEvents.ChaincodeReg, org.hyperledger.fabric.protos.peer.PeerEvents.ChaincodeReg.Builder, org.hyperledger.fabric.protos.peer.PeerEvents.ChaincodeRegOrBuilder>( (org.hyperledger.fabric.protos.peer.PeerEvents.ChaincodeReg) regInfo_, getParentForChildren(), isClean()); regInfo_ = null; } regInfoCase_ = 2; onChanged();; return chaincodeRegInfoBuilder_; }
private void blockListen(TransactionContext transactionContext) throws CryptoException, InvalidArgumentException { this.transactionContext = transactionContext; PeerEvents.Register register = PeerEvents.Register.newBuilder() .addEvents(PeerEvents.Interest.newBuilder().setEventType(PeerEvents.EventType.BLOCK).build()).build(); PeerEvents.Event.Builder blockEventBuilder = PeerEvents.Event.newBuilder().setRegister(register) .setCreator(transactionContext.getIdentity().toByteString()) .setTimestamp(ProtoUtils.getCurrentFabricTimestamp()); if (null != clientTLSCertificateDigest) { logger.trace("Setting clientTLSCertificate digest for event registration to " + DatatypeConverter.printHexBinary(clientTLSCertificateDigest)); blockEventBuilder.setTlsCertHash(ByteString.copyFrom(clientTLSCertificateDigest)); } ByteString blockEventByteString = blockEventBuilder.build().toByteString(); PeerEvents.SignedEvent signedBlockEvent = PeerEvents.SignedEvent.newBuilder() .setEventBytes(blockEventByteString) .setSignature(transactionContext.signByteString(blockEventByteString.toByteArray())) .build(); sender.onNext(signedBlockEvent); }
public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { org.hyperledger.fabric.protos.peer.PeerEvents.Interest parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (org.hyperledger.fabric.protos.peer.PeerEvents.Interest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private int regInfoCase_ = 0;
public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { org.hyperledger.fabric.protos.peer.PeerEvents.Interest parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (org.hyperledger.fabric.protos.peer.PeerEvents.Interest) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private int regInfoCase_ = 0;
private void blockListen(TransactionContext transactionContext) throws CryptoException { this.transactionContext = transactionContext; PeerEvents.Register register = PeerEvents.Register.newBuilder() .addEvents(PeerEvents.Interest.newBuilder().setEventType(PeerEvents.EventType.BLOCK).build()).build(); PeerEvents.Event.Builder blockEventBuilder = PeerEvents.Event.newBuilder().setRegister(register) .setCreator(transactionContext.getIdentity().toByteString()) .setTimestamp(ProtoUtils.getCurrentFabricTimestamp()); if (null != clientTLSCertificateDigest) { logger.trace("Setting clientTLSCertificate digest for event registration to " + DatatypeConverter.printHexBinary(clientTLSCertificateDigest)); blockEventBuilder.setTlsCertHash(ByteString.copyFrom(clientTLSCertificateDigest)); } ByteString blockEventByteString = blockEventBuilder.build().toByteString(); PeerEvents.SignedEvent signedBlockEvent = PeerEvents.SignedEvent.newBuilder() .setEventBytes(blockEventByteString) .setSignature(transactionContext.signByteString(blockEventByteString.toByteArray())) .build(); sender.onNext(signedBlockEvent); }
/** * <code>repeated .protos.Interest events = 1;</code> */ public Builder addEvents( org.hyperledger.fabric.protos.peer.PeerEvents.Interest.Builder builderForValue) { if (eventsBuilder_ == null) { ensureEventsIsMutable(); events_.add(builderForValue.build()); onChanged(); } else { eventsBuilder_.addMessage(builderForValue.build()); } return this; } /**
/** * <code>repeated .protos.Interest events = 1;</code> */ public Builder addEvents( org.hyperledger.fabric.protos.peer.PeerEvents.Interest.Builder builderForValue) { if (eventsBuilder_ == null) { ensureEventsIsMutable(); events_.add(builderForValue.build()); onChanged(); } else { eventsBuilder_.addMessage(builderForValue.build()); } return this; } /**
/** * <code>repeated .protos.Interest events = 1;</code> */ public Builder setEvents( int index, org.hyperledger.fabric.protos.peer.PeerEvents.Interest.Builder builderForValue) { if (eventsBuilder_ == null) { ensureEventsIsMutable(); events_.set(index, builderForValue.build()); onChanged(); } else { eventsBuilder_.setMessage(index, builderForValue.build()); } return this; } /**
/** * <code>repeated .protos.Interest events = 1;</code> */ public Builder addEvents( org.hyperledger.fabric.protos.peer.PeerEvents.Interest.Builder builderForValue) { if (eventsBuilder_ == null) { ensureEventsIsMutable(); events_.add(builderForValue.build()); onChanged(); } else { eventsBuilder_.addMessage(builderForValue.build()); } return this; } /**
/** * <code>repeated .protos.Interest events = 1;</code> */ public Builder addEvents( int index, org.hyperledger.fabric.protos.peer.PeerEvents.Interest.Builder builderForValue) { if (eventsBuilder_ == null) { ensureEventsIsMutable(); events_.add(index, builderForValue.build()); onChanged(); } else { eventsBuilder_.addMessage(index, builderForValue.build()); } return this; } /**
/** * <code>repeated .protos.Interest events = 1;</code> */ public Builder addEvents( int index, org.hyperledger.fabric.protos.peer.PeerEvents.Interest.Builder builderForValue) { if (eventsBuilder_ == null) { ensureEventsIsMutable(); events_.add(index, builderForValue.build()); onChanged(); } else { eventsBuilder_.addMessage(index, builderForValue.build()); } return this; } /**
/** * <code>repeated .protos.Interest events = 1;</code> */ public Builder setEvents( int index, org.hyperledger.fabric.protos.peer.PeerEvents.Interest.Builder builderForValue) { if (eventsBuilder_ == null) { ensureEventsIsMutable(); events_.set(index, builderForValue.build()); onChanged(); } else { eventsBuilder_.setMessage(index, builderForValue.build()); } return this; } /**
/** * <code>repeated .protos.Interest events = 1;</code> */ public Builder setEvents( int index, org.hyperledger.fabric.protos.peer.PeerEvents.Interest.Builder builderForValue) { if (eventsBuilder_ == null) { ensureEventsIsMutable(); events_.set(index, builderForValue.build()); onChanged(); } else { eventsBuilder_.setMessage(index, builderForValue.build()); } return this; } /**
/** * <code>repeated .protos.Interest events = 1;</code> */ public Builder addEvents( int index, org.hyperledger.fabric.protos.peer.PeerEvents.Interest.Builder builderForValue) { if (eventsBuilder_ == null) { ensureEventsIsMutable(); events_.add(index, builderForValue.build()); onChanged(); } else { eventsBuilder_.addMessage(index, builderForValue.build()); } return this; } /**