idx int64 0 41.2k | question stringlengths 74 4.21k | target stringlengths 5 888 |
|---|---|---|
32,300 | public static String dateToString ( Date date ) { final TimeZone utc = TimeZone . getTimeZone ( "UTC" ) ; SimpleDateFormat tformat = new SimpleDateFormat ( "yyyy-MM-dd'T'HH:mm:ss.SSSXXX" ) ; tformat . setTimeZone ( utc ) ; return tformat . format ( date ) ; } | Converts Date type to String based on RFC3339 formatting |
32,301 | public static ECP weakBBSign ( BIG sk , BIG m ) { BIG exp = IdemixUtils . modAdd ( sk , m , IdemixUtils . GROUP_ORDER ) ; exp . invmodp ( IdemixUtils . GROUP_ORDER ) ; return IdemixUtils . genG1 . mul ( exp ) ; } | Produces a WBB signature for a give message |
32,302 | public static boolean weakBBVerify ( ECP2 pk , ECP sig , BIG m ) { ECP2 p = new ECP2 ( ) ; p . copy ( pk ) ; p . add ( IdemixUtils . genG2 . mul ( m ) ) ; p . affine ( ) ; return PAIR . fexp ( PAIR . ate ( p , sig ) ) . equals ( IdemixUtils . genGT ) ; } | Verify a WBB signature for a certain message |
32,303 | boolean check ( IdemixIssuerPublicKey ipk ) { if ( nym == null || issuerNonce == null || proofC == null || proofS == null || ipk == null ) { return false ; } ECP t = ipk . getHsk ( ) . mul ( proofS ) ; t . sub ( nym . mul ( proofC ) ) ; byte [ ] proofData = new byte [ 0 ] ; proofData = IdemixUtils . append ( proofData ... | Cryptographically verify the IdemixCredRequest |
32,304 | public String toJson ( ) { StringWriter stringWriter = new StringWriter ( ) ; JsonWriter jsonWriter = Json . createWriter ( new PrintWriter ( stringWriter ) ) ; jsonWriter . writeObject ( toJsonObject ( ) ) ; jsonWriter . close ( ) ; return stringWriter . toString ( ) ; } | Convert the enrollment request to a JSON string |
32,305 | public String getPackageId ( ) throws ProposalException { if ( Status . SUCCESS != getStatus ( ) ) { throw new ProposalException ( format ( "Status of install proposal did not ret ok for %s, %s " , getPeer ( ) , getStatus ( ) ) ) ; } ByteString payload = getProposalResponse ( ) . getResponse ( ) . getPayload ( ) ; Life... | The packageId the identifies this chaincode change . |
32,306 | public boolean check ( ) { if ( AttributeNames == null || Hsk == null || HRand == null || HAttrs == null || BarG1 == null || BarG1 . is_infinity ( ) || BarG2 == null || HAttrs . length < AttributeNames . length ) { return false ; } for ( int i = 0 ; i < AttributeNames . length ; i ++ ) { if ( HAttrs [ i ] == null ) { r... | check whether the issuer public key is correct |
32,307 | public Map < String , Boolean > getApprovalMap ( ) throws ProposalException { Lifecycle . QueryApprovalStatusResults rs = getApprovalStatusResults ( ) ; if ( rs == null ) { return Collections . emptyMap ( ) ; } return rs . getApprovedMap ( ) ; } | A map of approved and not approved . The key contains name of org the value a Boolean if approved . |
32,308 | public Collection < String > getPeerNames ( ) { if ( peers == null ) { return Collections . EMPTY_SET ; } else { return new HashSet < > ( peers . keySet ( ) ) ; } } | Names of Peers found |
32,309 | public Collection < String > getOrdererNames ( ) { if ( orderers == null ) { return Collections . EMPTY_SET ; } else { return new HashSet < > ( orderers . keySet ( ) ) ; } } | Names of Orderers found |
32,310 | public void setPeerProperties ( String name , Properties properties ) throws InvalidArgumentException { setNodeProperties ( "Peer" , name , peers , properties ) ; } | Set a specific peer s properties . |
32,311 | public void setOrdererProperties ( String name , Properties properties ) throws InvalidArgumentException { setNodeProperties ( "Orderer" , name , orderers , properties ) ; } | Set a specific orderer s properties . |
32,312 | public static NetworkConfig fromYamlFile ( File configFile ) throws InvalidArgumentException , IOException , NetworkConfigurationException { return fromFile ( configFile , false ) ; } | Creates a new NetworkConfig instance configured with details supplied in a YAML file . |
32,313 | public static NetworkConfig fromJsonFile ( File configFile ) throws InvalidArgumentException , IOException , NetworkConfigurationException { return fromFile ( configFile , true ) ; } | Creates a new NetworkConfig instance configured with details supplied in a JSON file . |
32,314 | public static NetworkConfig fromYamlStream ( InputStream configStream ) throws InvalidArgumentException , NetworkConfigurationException { logger . trace ( "NetworkConfig.fromYamlStream..." ) ; if ( configStream == null ) { throw new InvalidArgumentException ( "configStream must be specified" ) ; } Yaml yaml = new Yaml ... | Creates a new NetworkConfig instance configured with details supplied in YAML format |
32,315 | public static NetworkConfig fromJsonStream ( InputStream configStream ) throws InvalidArgumentException , NetworkConfigurationException { logger . trace ( "NetworkConfig.fromJsonStream..." ) ; if ( configStream == null ) { throw new InvalidArgumentException ( "configStream must be specified" ) ; } try ( JsonReader read... | Creates a new NetworkConfig instance configured with details supplied in JSON format |
32,316 | public static NetworkConfig fromJsonObject ( JsonObject jsonConfig ) throws InvalidArgumentException , NetworkConfigurationException { if ( jsonConfig == null ) { throw new InvalidArgumentException ( "jsonConfig must be specified" ) ; } if ( logger . isTraceEnabled ( ) ) { logger . trace ( format ( "NetworkConfig.fromJ... | Creates a new NetworkConfig instance configured with details supplied in a JSON object |
32,317 | private static NetworkConfig fromFile ( File configFile , boolean isJson ) throws InvalidArgumentException , IOException , NetworkConfigurationException { if ( configFile == null ) { throw new InvalidArgumentException ( "configFile must be specified" ) ; } if ( logger . isTraceEnabled ( ) ) { logger . trace ( format ( ... | Loads a NetworkConfig object from a Json or Yaml file |
32,318 | private static NetworkConfig load ( JsonObject jsonConfig ) throws InvalidArgumentException , NetworkConfigurationException { if ( jsonConfig == null ) { throw new InvalidArgumentException ( "config must be specified" ) ; } return new NetworkConfig ( jsonConfig ) ; } | Returns a new NetworkConfig instance and populates it from the specified JSON object |
32,319 | public Map < String , OrgInfo > getPeerOrgInfos ( final String peerName ) throws InvalidArgumentException { if ( Utils . isNullOrEmpty ( peerName ) ) { throw new InvalidArgumentException ( "peerName can not be null or empty." ) ; } if ( organizations == null || organizations . isEmpty ( ) ) { return new HashMap < > ( )... | Find organizations for a peer . |
32,320 | public UserInfo getPeerAdmin ( String orgName ) throws NetworkConfigurationException { OrgInfo org = getOrganizationInfo ( orgName ) ; if ( org == null ) { throw new NetworkConfigurationException ( format ( "Organization %s is not defined" , orgName ) ) ; } return org . getPeerAdmin ( ) ; } | Returns the admin user associated with the specified organization |
32,321 | private void createAllOrderers ( ) throws NetworkConfigurationException { if ( orderers != null ) { throw new NetworkConfigurationException ( "INTERNAL ERROR: orderers has already been initialized!" ) ; } orderers = new HashMap < > ( ) ; JsonObject jsonOrderers = getJsonObject ( jsonConfig , "orderers" ) ; if ( jsonOrd... | Creates Node instances representing all the orderers defined in the config file |
32,322 | private void createAllPeers ( ) throws NetworkConfigurationException { if ( peers != null ) { throw new NetworkConfigurationException ( "INTERNAL ERROR: peers has already been initialized!" ) ; } peers = new HashMap < > ( ) ; JsonObject jsonPeers = getJsonObject ( jsonConfig , "peers" ) ; if ( jsonPeers != null ) { for... | Creates Node instances representing all the peers defined in the config file |
32,323 | private Map < String , JsonObject > findCertificateAuthorities ( ) throws NetworkConfigurationException { Map < String , JsonObject > ret = new HashMap < > ( ) ; JsonObject jsonCertificateAuthorities = getJsonObject ( jsonConfig , "certificateAuthorities" ) ; if ( null != jsonCertificateAuthorities ) { for ( Entry < St... | Produce a map from tag to jsonobject for the CA |
32,324 | private void createAllOrganizations ( Map < String , JsonObject > foundCertificateAuthorities ) throws NetworkConfigurationException { if ( organizations != null ) { throw new NetworkConfigurationException ( "INTERNAL ERROR: organizations has already been initialized!" ) ; } organizations = new HashMap < > ( ) ; JsonOb... | Creates JsonObjects representing all the Organizations defined in the config file |
32,325 | private Orderer getOrderer ( HFClient client , String ordererName ) throws InvalidArgumentException { Orderer orderer = null ; Node o = orderers . get ( ordererName ) ; if ( o != null ) { orderer = client . newOrderer ( o . getName ( ) , o . getUrl ( ) , o . getProperties ( ) ) ; } return orderer ; } | Returns a new Orderer instance for the specified orderer name |
32,326 | private Node createNode ( String nodeName , JsonObject jsonNode , String urlPropName ) throws NetworkConfigurationException { String url = jsonNode . getString ( urlPropName , null ) ; if ( url == null ) { return null ; } Properties props = extractProperties ( jsonNode , "grpcOptions" ) ; if ( null != props ) { String ... | Creates a new Node instance from a JSON object |
32,327 | private OrgInfo createOrg ( String orgName , JsonObject jsonOrg , Map < String , JsonObject > foundCertificateAuthorities ) throws NetworkConfigurationException { String msgPrefix = format ( "Organization %s" , orgName ) ; String mspId = getJsonValueAsString ( jsonOrg . get ( "mspid" ) ) ; OrgInfo org = new OrgInfo ( o... | Creates a new OrgInfo instance from a JSON object |
32,328 | private CAInfo createCA ( String name , JsonObject jsonCA , OrgInfo org ) throws NetworkConfigurationException { String url = getJsonValueAsString ( jsonCA . get ( "url" ) ) ; Properties httpOptions = extractProperties ( jsonCA , "httpOptions" ) ; String enrollId = null ; String enrollSecret = null ; List < JsonObject ... | Creates a new CAInfo instance from a JSON object |
32,329 | private static Properties extractProperties ( JsonObject json , String fieldName ) { Properties props = new Properties ( ) ; JsonObject options = getJsonObject ( json , fieldName ) ; if ( options != null ) { for ( Entry < String , JsonValue > entry : options . entrySet ( ) ) { String key = entry . getKey ( ) ; JsonValu... | Extracts all defined properties of the specified field and returns a Properties object |
32,330 | private Peer getPeer ( HFClient client , String peerName ) throws InvalidArgumentException { Peer peer = null ; Node p = peers . get ( peerName ) ; if ( p != null ) { peer = client . newPeer ( p . getName ( ) , p . getUrl ( ) , p . getProperties ( ) ) ; } return peer ; } | Returns a new Peer instance for the specified peer name |
32,331 | private static String getJsonValue ( JsonValue value ) { String s = null ; if ( value != null ) { s = getJsonValueAsString ( value ) ; if ( s == null ) { s = getJsonValueAsNumberString ( value ) ; } if ( s == null ) { Boolean b = getJsonValueAsBoolean ( value ) ; if ( b != null ) { s = b ? "true" : "false" ; } } } retu... | If it s anything else it returns null |
32,332 | private static JsonObject getJsonValueAsObject ( JsonValue value ) { return ( value != null && value . getValueType ( ) == ValueType . OBJECT ) ? value . asJsonObject ( ) : null ; } | Returns the specified JsonValue as a JsonObject or null if it s not an object |
32,333 | private static JsonArray getJsonValueAsArray ( JsonValue value ) { return ( value != null && value . getValueType ( ) == ValueType . ARRAY ) ? value . asJsonArray ( ) : null ; } | Returns the specified JsonValue as a JsonArray or null if it s not an array |
32,334 | private static List < JsonObject > getJsonValueAsList ( JsonValue value ) { if ( value != null ) { if ( value . getValueType ( ) == ValueType . ARRAY ) { return value . asJsonArray ( ) . getValuesAs ( JsonObject . class ) ; } else if ( value . getValueType ( ) == ValueType . OBJECT ) { List < JsonObject > ret = new Arr... | Returns the specified JsonValue as a List . Allows single or array |
32,335 | private static Boolean getJsonValueAsBoolean ( JsonValue value ) { if ( value != null ) { if ( value . getValueType ( ) == ValueType . TRUE ) { return true ; } else if ( value . getValueType ( ) == ValueType . FALSE ) { return false ; } } return null ; } | Returns the specified JsonValue as a Boolean or null if it s not a boolean |
32,336 | private static JsonObject getJsonObject ( JsonObject object , String propName ) { JsonObject obj = null ; JsonValue val = object . get ( propName ) ; if ( val != null && val . getValueType ( ) == ValueType . OBJECT ) { obj = val . asJsonObject ( ) ; } return obj ; } | Returns the specified property as a JsonObject |
32,337 | public Set < String > getChannelNames ( ) { Set < String > ret = Collections . EMPTY_SET ; JsonObject channels = getJsonObject ( jsonConfig , "channels" ) ; if ( channels != null ) { final Set < String > channelNames = channels . keySet ( ) ; if ( channelNames != null && ! channelNames . isEmpty ( ) ) { ret = new HashS... | Get the channel names found . |
32,338 | public void setTransientMap ( Map < String , byte [ ] > transientMap ) throws InvalidArgumentException { if ( null == transientMap ) { throw new InvalidArgumentException ( "Transient map may not be set to null" ) ; } this . transientMap = transientMap ; } | Transient data added to the proposal that is not added to the ledger . |
32,339 | public static LifecycleChaincodeEndorsementPolicy fromStream ( InputStream inputStream ) throws IOException { return new LifecycleChaincodeEndorsementPolicy ( ByteString . copyFrom ( IOUtils . toByteArray ( inputStream ) ) ) ; } | Construct a chaincode endorsement policy from a stream . |
32,340 | public void setChaincodeName ( String chaincodeName ) throws InvalidArgumentException { if ( Utils . isNullOrEmpty ( chaincodeName ) ) { throw new InvalidArgumentException ( "The chaincodeName parameter can not be null or empty." ) ; } this . chaincodeName = chaincodeName ; } | The name of the chaincode to approve . |
32,341 | public void setChaincodeVersion ( String chaincodeVersion ) throws InvalidArgumentException { if ( Utils . isNullOrEmpty ( chaincodeVersion ) ) { throw new InvalidArgumentException ( "The chaincodeVersion parameter can not be null or empty." ) ; } this . chaincodeVersion = chaincodeVersion ; } | The version of the chaincode to approve . |
32,342 | public void setChaincodeEndorsementPlugin ( String chaincodeEndorsementPlugin ) throws InvalidArgumentException { if ( Utils . isNullOrEmpty ( chaincodeEndorsementPlugin ) ) { throw new InvalidArgumentException ( "The getChaincodeEndorsementPlugin parameter can not be null or empty." ) ; } this . chaincodeEndorsementPl... | This is the chaincode endorsement plugin . Should default not needing set . ONLY set if there is a specific endorsement is set for your organization |
32,343 | public void setChaincodeValidationPlugin ( String chaincodeValidationPlugin ) throws InvalidArgumentException { if ( Utils . isNullOrEmpty ( chaincodeValidationPlugin ) ) { throw new InvalidArgumentException ( "The getChaincodeValidationPlugin parameter can not be null or empty." ) ; } this . chaincodeValidationPlugin ... | This is the chaincode validation plugin . Should default not needing set . ONLY set if there is a specific validation is set for your organization |
32,344 | public void setUpdateChannelConfiguration ( byte [ ] updateChannelConfigurationAsBytes ) throws InvalidArgumentException { if ( updateChannelConfigurationAsBytes == null ) { throw new InvalidArgumentException ( "UpdateChannelConfiguration updateChannelConfigurationAsBytes must be non-null" ) ; } logger . trace ( "Creat... | sets the UpdateChannelConfiguration from a byte array |
32,345 | void setChannel ( Channel channel ) throws InvalidArgumentException { if ( null != this . channel ) { throw new InvalidArgumentException ( format ( "Can not add peer %s to channel %s because it already belongs to channel %s." , name , channel . getName ( ) , this . channel . getName ( ) ) ) ; } logger . debug ( format ... | Set the channel the peer is on . |
32,346 | public PeerEventingServiceDisconnected setPeerEventingServiceDisconnected ( PeerEventingServiceDisconnected newPeerEventingServiceDisconnectedHandler ) { PeerEventingServiceDisconnected ret = disconnectedHandler ; disconnectedHandler = newPeerEventingServiceDisconnectedHandler ; return ret ; } | Set class to handle peer eventing service disconnects |
32,347 | public void setChannelConfiguration ( byte [ ] channelConfigurationAsBytes ) throws InvalidArgumentException { if ( channelConfigurationAsBytes == null ) { throw new InvalidArgumentException ( "ChannelConfiguration channelConfigurationAsBytes must be non-null" ) ; } logger . trace ( "Creating setChannelConfiguration fr... | sets the ChannelConfiguration from a byte array |
32,348 | public static RAND getRand ( ) { int seedLength = IdemixUtils . FIELD_BYTES ; SecureRandom random = new SecureRandom ( ) ; byte [ ] seed = random . generateSeed ( seedLength ) ; RAND rng = new RAND ( ) ; rng . clean ( ) ; rng . seed ( seedLength , seed ) ; return rng ; } | Returns a random number generator amcl . RAND initialized with a fresh seed . |
32,349 | public static BIG hashModOrder ( byte [ ] data ) { HASH256 hash = new HASH256 ( ) ; for ( byte b : data ) { hash . process ( b ) ; } byte [ ] hasheddata = hash . hash ( ) ; BIG ret = BIG . fromBytes ( hasheddata ) ; ret . mod ( IdemixUtils . GROUP_ORDER ) ; return ret ; } | hashModOrder hashes bytes to an amcl . BIG in 0 ... GROUP_ORDER |
32,350 | public static byte [ ] bigToBytes ( BIG big ) { byte [ ] ret = new byte [ IdemixUtils . FIELD_BYTES ] ; big . toBytes ( ret ) ; return ret ; } | bigToBytes turns a BIG into a byte array |
32,351 | static byte [ ] ecpToBytes ( ECP e ) { byte [ ] ret = new byte [ 2 * FIELD_BYTES + 1 ] ; e . toBytes ( ret , false ) ; return ret ; } | ecpToBytes turns an ECP into a byte array |
32,352 | static byte [ ] append ( byte [ ] data , byte [ ] toAppend ) { ByteArrayOutputStream stream = new ByteArrayOutputStream ( ) ; try { stream . write ( data ) ; stream . write ( toAppend ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return stream . toByteArray ( ) ; } | append appends a byte array to an existing byte array |
32,353 | static byte [ ] append ( byte [ ] data , boolean [ ] toAppend ) { byte [ ] toAppendBytes = new byte [ toAppend . length ] ; for ( int i = 0 ; i < toAppend . length ; i ++ ) { toAppendBytes [ i ] = toAppend [ i ] ? ( byte ) 1 : ( byte ) 0 ; } return append ( data , toAppendBytes ) ; } | append appends a boolean array to an existing byte array |
32,354 | static ECP transformFromProto ( Idemix . ECP w ) { byte [ ] valuex = w . getX ( ) . toByteArray ( ) ; byte [ ] valuey = w . getY ( ) . toByteArray ( ) ; return new ECP ( BIG . fromBytes ( valuex ) , BIG . fromBytes ( valuey ) ) ; } | Returns an amcl . BN256 . ECP on input of an ECP protobuf object . |
32,355 | static ECP2 transformFromProto ( Idemix . ECP2 w ) { byte [ ] valuexa = w . getXa ( ) . toByteArray ( ) ; byte [ ] valuexb = w . getXb ( ) . toByteArray ( ) ; byte [ ] valueya = w . getYa ( ) . toByteArray ( ) ; byte [ ] valueyb = w . getYb ( ) . toByteArray ( ) ; FP2 valuex = new FP2 ( BIG . fromBytes ( valuexa ) , BI... | Returns an amcl . BN256 . ECP2 on input of an ECP2 protobuf object . |
32,356 | static Idemix . ECP2 transformToProto ( ECP2 w ) { byte [ ] valueXA = new byte [ IdemixUtils . FIELD_BYTES ] ; byte [ ] valueXB = new byte [ IdemixUtils . FIELD_BYTES ] ; byte [ ] valueYA = new byte [ IdemixUtils . FIELD_BYTES ] ; byte [ ] valueYB = new byte [ IdemixUtils . FIELD_BYTES ] ; w . getX ( ) . getA ( ) . toB... | Converts an amcl . BN256 . ECP2 into an ECP2 protobuf object . |
32,357 | static Idemix . ECP transformToProto ( ECP w ) { byte [ ] valueX = new byte [ IdemixUtils . FIELD_BYTES ] ; byte [ ] valueY = new byte [ IdemixUtils . FIELD_BYTES ] ; w . getX ( ) . toBytes ( valueX ) ; w . getY ( ) . toBytes ( valueY ) ; return Idemix . ECP . newBuilder ( ) . setX ( ByteString . copyFrom ( valueX ) ) ... | Converts an amcl . BN256 . ECP into an ECP protobuf object . |
32,358 | static BIG modAdd ( BIG a , BIG b , BIG m ) { BIG c = a . plus ( b ) ; c . mod ( m ) ; return c ; } | Takes input BIGs a b m and returns a + b modulo m |
32,359 | static BIG modSub ( BIG a , BIG b , BIG m ) { return modAdd ( a , BIG . modneg ( b , m ) , m ) ; } | Modsub takes input BIGs a b m and returns a - b modulo m |
32,360 | public void fromYamlFile ( File yamlPolicyFile ) throws IOException , ChaincodeEndorsementPolicyParseException { final Yaml yaml = new Yaml ( ) ; final Map < ? , ? > load = ( Map < ? , ? > ) yaml . load ( new FileInputStream ( yamlPolicyFile ) ) ; Map < ? , ? > mp = ( Map < ? , ? > ) load . get ( "policy" ) ; if ( null... | From a yaml file |
32,361 | public static ChaincodeEndorsementPolicy fromBytes ( byte [ ] policyAsBytes ) { ChaincodeEndorsementPolicy ret = new ChaincodeEndorsementPolicy ( ) ; ret . policyBytes = new byte [ policyAsBytes . length ] ; System . arraycopy ( policyAsBytes , 0 , ret . policyBytes , 0 , policyAsBytes . length ) ; return ret ; } | sets the ChaincodeEndorsementPolicy from a byte array |
32,362 | public int read ( User registrar ) throws AffiliationException , InvalidArgumentException { if ( registrar == null ) { throw new InvalidArgumentException ( "Registrar should be a valid member" ) ; } String readAffURL = "" ; try { readAffURL = HFCA_AFFILIATION + "/" + name ; logger . debug ( format ( "affiliation url: ... | gets a specific affiliation |
32,363 | public HFCAAffiliationResp create ( User registrar , boolean force ) throws AffiliationException , InvalidArgumentException { if ( registrar == null ) { throw new InvalidArgumentException ( "Registrar should be a valid member" ) ; } String createURL = "" ; try { createURL = client . getURL ( HFCA_AFFILIATION ) ; logger... | create an affiliation |
32,364 | public HFCAAffiliationResp update ( User registrar , boolean force ) throws AffiliationException , InvalidArgumentException { if ( this . deleted ) { throw new AffiliationException ( "Affiliation has been deleted" ) ; } if ( registrar == null ) { throw new InvalidArgumentException ( "Registrar should be a valid member"... | update an affiliation |
32,365 | public HFCAAffiliationResp delete ( User registrar , boolean force ) throws AffiliationException , InvalidArgumentException { if ( this . deleted ) { throw new AffiliationException ( "Affiliation has been deleted" ) ; } if ( registrar == null ) { throw new InvalidArgumentException ( "Registrar should be a valid member"... | delete an affiliation |
32,366 | private JsonObject affToJsonObject ( ) { JsonObjectBuilder ob = Json . createObjectBuilder ( ) ; if ( client . getCAName ( ) != null ) { ob . add ( HFCAClient . FABRIC_CA_REQPROP , client . getCAName ( ) ) ; } if ( this . updateName != null ) { ob . add ( "name" , updateName ) ; this . updateName = null ; } else { ob .... | Convert the affiliation request to a JSON object |
32,367 | void validateAffiliationNames ( String name ) throws InvalidArgumentException { checkFormat ( name ) ; if ( name . startsWith ( "." ) ) { throw new InvalidArgumentException ( "Affiliation name cannot start with a dot '.'" ) ; } if ( name . endsWith ( "." ) ) { throw new InvalidArgumentException ( "Affiliation name cann... | Validate affiliation name for proper formatting |
32,368 | static final synchronized CryptoSuiteFactory getDefault ( ) throws ClassNotFoundException , IllegalAccessException , InstantiationException , NoSuchMethodException , InvocationTargetException { if ( null == theFACTORY ) { String cf = config . getDefaultCryptoSuiteFactory ( ) ; if ( null == cf || cf . isEmpty ( ) || cf ... | one and only factory . |
32,369 | public boolean verify ( BIG sk , IdemixIssuerPublicKey ipk ) { if ( ipk == null || Attrs . length != ipk . getAttributeNames ( ) . length ) { return false ; } for ( byte [ ] attr : Attrs ) { if ( attr == null ) { return false ; } } ECP bPrime = new ECP ( ) ; bPrime . copy ( IdemixUtils . genG1 ) ; bPrime . add ( ipk . ... | verify cryptographically verifies the credential |
32,370 | public int getTransactionCount ( ) { if ( isFiltered ( ) ) { int ltransactionCount = transactionCount ; if ( ltransactionCount < 0 ) { ltransactionCount = 0 ; for ( int i = filteredBlock . getFilteredTransactionsCount ( ) - 1 ; i >= 0 ; -- i ) { FilteredTransaction filteredTransactions = filteredBlock . getFilteredTran... | Number of endorser transaction found in the block . |
32,371 | public EnvelopeInfo getEnvelopeInfo ( int envelopeIndex ) throws InvalidProtocolBufferException { try { EnvelopeInfo ret ; if ( isFiltered ( ) ) { switch ( filteredBlock . getFilteredTransactions ( envelopeIndex ) . getType ( ) . getNumber ( ) ) { case Common . HeaderType . ENDORSER_TRANSACTION_VALUE : ret = new Transa... | Return a specific envelope in the block by it s index . |
32,372 | Ab . BroadcastResponse sendTransaction ( Common . Envelope transaction ) throws Exception { if ( shutdown ) { throw new TransactionException ( format ( "Orderer %s was shutdown." , name ) ) ; } logger . debug ( format ( "Orderer.sendTransaction %s" , toString ( ) ) ) ; OrdererClient localOrdererClient = getOrdererClien... | Send transaction to Order |
32,373 | public static ChaincodeCollectionConfiguration fromYamlFile ( File configFile ) throws InvalidArgumentException , IOException , ChaincodeCollectionConfigurationException { return fromFile ( configFile , false ) ; } | Creates a new ChaincodeCollectionConfiguration instance configured with details supplied in a YAML file . |
32,374 | public static ChaincodeCollectionConfiguration fromJsonFile ( File configFile ) throws InvalidArgumentException , IOException , ChaincodeCollectionConfigurationException { return fromFile ( configFile , true ) ; } | Creates a new ChaincodeCollectionConfiguration instance configured with details supplied in a JSON file . |
32,375 | public static ChaincodeCollectionConfiguration fromYamlStream ( InputStream configStream ) throws InvalidArgumentException , ChaincodeCollectionConfigurationException { logger . trace ( "ChaincodeCollectionConfiguration.fromYamlStream..." ) ; if ( configStream == null ) { throw new InvalidArgumentException ( "ConfigStr... | Creates a new ChaincodeCollectionConfiguration instance configured with details supplied in YAML format |
32,376 | public static ChaincodeCollectionConfiguration fromJsonStream ( InputStream configStream ) throws InvalidArgumentException , ChaincodeCollectionConfigurationException { logger . trace ( "ChaincodeCollectionConfiguration.fromJsonStream..." ) ; if ( configStream == null ) { throw new InvalidArgumentException ( "configStr... | Creates a new ChaincodeCollectionConfiguration instance configured with details supplied in JSON format |
32,377 | public static ChaincodeCollectionConfiguration fromJsonObject ( JsonArray jsonConfig ) throws InvalidArgumentException , ChaincodeCollectionConfigurationException { if ( jsonConfig == null ) { throw new InvalidArgumentException ( "jsonConfig must be specified" ) ; } if ( logger . isTraceEnabled ( ) ) { logger . trace (... | Creates a new ChaincodeCollectionConfiguration instance configured with details supplied in a JSON object |
32,378 | private static ChaincodeCollectionConfiguration fromFile ( File configFile , boolean isJson ) throws InvalidArgumentException , IOException , ChaincodeCollectionConfigurationException { if ( configFile == null ) { throw new InvalidArgumentException ( "configFile must be specified" ) ; } if ( logger . isTraceEnabled ( )... | Loads a ChaincodeCollectionConfiguration object from a Json or Yaml file |
32,379 | private static ChaincodeCollectionConfiguration load ( JsonArray jsonConfig ) throws InvalidArgumentException , ChaincodeCollectionConfigurationException { if ( jsonConfig == null ) { throw new InvalidArgumentException ( "jsonConfig must be specified" ) ; } return new ChaincodeCollectionConfiguration ( jsonConfig ) ; } | Returns a new ChaincodeCollectionConfiguration instance and populates it from the specified JSON object |
32,380 | public byte [ ] getValidationParameter ( ) throws ProposalException { ByteString payloadBytes = parsePayload ( ) . getValidationParameter ( ) ; if ( null == payloadBytes ) { return null ; } return payloadBytes . toByteArray ( ) ; } | The validation parameter bytes that were set when the chaincode was defined . |
32,381 | public ChaincodeCollectionConfiguration getChaincodeCollectionConfiguration ( ) throws ProposalException { Collection . CollectionConfigPackage collections = parsePayload ( ) . getCollections ( ) ; if ( null == collections || ! parsePayload ( ) . hasCollections ( ) ) { return null ; } try { return ChaincodeCollectionCo... | The collection configuration this chaincode was defined . |
32,382 | public boolean verify ( ECP nym , IdemixIssuerPublicKey ipk , byte [ ] msg ) { if ( nym == null || ipk == null || msg == null ) { return false ; } ECP t = ipk . getHsk ( ) . mul2 ( proofSSk , ipk . getHRand ( ) , proofSRNym ) ; t . sub ( nym . mul ( proofC ) ) ; byte [ ] proofData = new byte [ 0 ] ; proofData = IdemixU... | Verify this IdemixPseudonymSignature |
32,383 | public Idemix . Signature toProto ( ) { Idemix . Signature . Builder builder = Idemix . Signature . newBuilder ( ) . setAPrime ( IdemixUtils . transformToProto ( aPrime ) ) . setABar ( IdemixUtils . transformToProto ( aBar ) ) . setBPrime ( IdemixUtils . transformToProto ( bPrime ) ) . setNym ( IdemixUtils . transformT... | Convert this signature to a proto |
32,384 | private int [ ] hiddenIndices ( boolean [ ] disclosure ) { if ( disclosure == null ) { throw new IllegalArgumentException ( "cannot compute hidden indices of null disclosure" ) ; } List < Integer > hiddenIndicesList = new ArrayList < > ( ) ; for ( int i = 0 ; i < disclosure . length ; i ++ ) { if ( ! disclosure [ i ] )... | Some attributes may be hidden some disclosed . The indices of the hidden attributes will be passed . |
32,385 | public synchronized void setExecutorService ( ExecutorService executorService ) throws InvalidArgumentException { if ( executorService == null ) { throw new InvalidArgumentException ( "Executor service can not be null." ) ; } if ( this . executorService != null && this . executorService != executorService ) { throw new... | Set executor service Applications need to set the executor service prior to doing any other operations on the client . |
32,386 | public Channel newChannel ( String name ) throws InvalidArgumentException { clientCheck ( ) ; if ( Utils . isNullOrEmpty ( name ) ) { throw new InvalidArgumentException ( "Channel name can not be null or empty string." ) ; } synchronized ( channels ) { if ( channels . containsKey ( name ) ) { throw new InvalidArgumentE... | newChannel - already configured channel . |
32,387 | public Channel newChannel ( String name , Orderer orderer , ChannelConfiguration channelConfiguration , byte [ ] ... channelConfigurationSignatures ) throws TransactionException , InvalidArgumentException { clientCheck ( ) ; if ( Utils . isNullOrEmpty ( name ) ) { throw new InvalidArgumentException ( "Channel name can ... | Create a new channel |
32,388 | public Peer newPeer ( String name , String grpcURL ) throws InvalidArgumentException { clientCheck ( ) ; return Peer . createNewInstance ( name , grpcURL , null ) ; } | newPeer create a new peer |
32,389 | public Collection < LifecycleQueryInstalledChaincodeProposalResponse > sendLifecycleQueryInstalledChaincode ( LifecycleQueryInstalledChaincodeRequest lifecycleQueryInstalledChaincodeRequest , Collection < Peer > peers ) throws InvalidArgumentException , ProposalException { if ( null == lifecycleQueryInstalledChaincodeR... | Query installed chaincode on a peer . |
32,390 | public Collection < LifecycleQueryInstalledChaincodesProposalResponse > sendLifecycleQueryInstalledChaincodes ( LifecycleQueryInstalledChaincodesRequest lifecycleQueryInstalledChaincodesRequest , Collection < Peer > peers ) throws InvalidArgumentException , ProposalException { if ( null == lifecycleQueryInstalledChainc... | Query the peer for installed chaincodes information |
32,391 | public User setUserContext ( User userContext ) throws InvalidArgumentException { if ( null == cryptoSuite ) { throw new InvalidArgumentException ( "No cryptoSuite has been set." ) ; } userContextCheck ( userContext ) ; User ret = this . userContext ; this . userContext = userContext ; logger . debug ( format ( "Settin... | Set the User context for this client . |
32,392 | public Orderer newOrderer ( String name , String grpcURL ) throws InvalidArgumentException { clientCheck ( ) ; return newOrderer ( name , grpcURL , null ) ; } | Create a new urlOrderer . |
32,393 | public Orderer newOrderer ( String name , String grpcURL , Properties properties ) throws InvalidArgumentException { clientCheck ( ) ; return Orderer . createNewInstance ( name , grpcURL , properties ) ; } | Create a new orderer . |
32,394 | public Set < String > queryChannels ( Peer peer ) throws InvalidArgumentException , ProposalException { clientCheck ( ) ; if ( null == peer ) { throw new InvalidArgumentException ( "peer set to null" ) ; } try { Channel systemChannel = Channel . newSystemChannel ( this ) ; return systemChannel . queryChannels ( peer ) ... | Query the joined channels for peers |
32,395 | public List < ChaincodeInfo > queryInstalledChaincodes ( Peer peer ) throws InvalidArgumentException , ProposalException { clientCheck ( ) ; if ( null == peer ) { throw new InvalidArgumentException ( "peer set to null" ) ; } try { Channel systemChannel = Channel . newSystemChannel ( this ) ; return systemChannel . quer... | Query the peer for installed chaincode information |
32,396 | public byte [ ] getChannelConfigurationSignature ( ChannelConfiguration channelConfiguration , User signer ) throws InvalidArgumentException { clientCheck ( ) ; Channel systemChannel = Channel . newSystemChannel ( this ) ; return systemChannel . getChannelConfigurationSignature ( channelConfiguration , signer ) ; } | Get signature for channel configuration |
32,397 | public byte [ ] getUpdateChannelConfigurationSignature ( UpdateChannelConfiguration updateChannelConfiguration , User signer ) throws InvalidArgumentException { clientCheck ( ) ; Channel systemChannel = Channel . newSystemChannel ( this ) ; return systemChannel . getUpdateChannelConfigurationSignature ( updateChannelCo... | Get signature for update channel configuration |
32,398 | private String getProperty ( String property ) { String ret = sdkProperties . getProperty ( property ) ; if ( null == ret ) { logger . warn ( String . format ( "No configuration value found for '%s'" , property ) ) ; } return ret ; } | getProperty return back property for the given value . |
32,399 | public byte [ ] getPayload ( ) { ByteString ret = getChaincodeEvent ( ) . getPayload ( ) ; if ( null == ret ) { return null ; } return ret . toByteArray ( ) ; } | Binary data associated with this event . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.