public class LifecycleChaincodePackage extends Object
Modifier and Type | Method and Description |
---|---|
static LifecycleChaincodePackage |
fromBytes(byte[] packageBytes)
Sets the LifecycleChaincodePackage from a byte array
|
static LifecycleChaincodePackage |
fromFile(File policyFile)
constructs a ChaincodeEndorsementPolicy object with the actual policy gotten from the file system
|
static LifecycleChaincodePackage |
fromSource(String label,
Path chaincodeSource,
TransactionRequest.Type chaincodeType,
String chaincodePath,
Path chaincodeMetaInfLocation) |
static LifecycleChaincodePackage |
fromStream(InputStream inputStream)
Construct a LifecycleChaincodePackage from a stream.
|
byte[] |
getAsBytes()
Lifecycle chaincode package as bytes
|
byte[] |
getChaincodePayloadBytes() |
String |
getLabel() |
javax.json.JsonObject |
getMetaInfJson() |
String |
getPath() |
TransactionRequest.Type |
getType() |
void |
toFile(Path path,
OpenOption... options)
Write Lifecycle chaincode package bytes to file.
|
public static LifecycleChaincodePackage fromFile(File policyFile) throws IOException, InvalidArgumentException
policyFile
- The file containing the policyIOException
InvalidArgumentException
public static LifecycleChaincodePackage fromStream(InputStream inputStream) throws IOException, InvalidArgumentException
inputStream
- The stream containing the lifecycle chaincode package. This stream is NOT closed.IOException
InvalidArgumentException
public static LifecycleChaincodePackage fromBytes(byte[] packageBytes) throws InvalidArgumentException
packageBytes
- the byte array containing the serialized policyInvalidArgumentException
public byte[] getAsBytes()
public void toFile(Path path, OpenOption... options) throws IOException
path
- of the file to write to.options
- Options on creating file.IOException
public static LifecycleChaincodePackage fromSource(String label, Path chaincodeSource, TransactionRequest.Type chaincodeType, String chaincodePath, Path chaincodeMetaInfLocation) throws IOException, InvalidArgumentException
label
- Any name you like to identify this package.chaincodeSource
- Chaincode source directory.chaincodeType
- Chaincode type GO, JAVA.chaincodePath
- Only valid for GO LANG chaincode. Otherwise, null.chaincodeMetaInfLocation
- MetaInf location. Can be null.IOException
InvalidArgumentException
public javax.json.JsonObject getMetaInfJson() throws IOException
IOException
public byte[] getChaincodePayloadBytes() throws IOException
IOException
public TransactionRequest.Type getType() throws IOException
IOException
public String getLabel() throws IOException
IOException
public String getPath() throws IOException
IOException
Copyright © 2022. All rights reserved.