Use the SDKs contract router Main, not a local entrypoint

Signed-off-by: Josh Kneubuhl <jkneubuh@us.ibm.com>
This commit is contained in:
Josh Kneubuhl 2022-04-26 09:34:43 -04:00
parent f7a2eb38f8
commit 088e1d51b4
2 changed files with 1 additions and 24 deletions

View file

@ -31,7 +31,7 @@ repositories {
}
application {
mainClass = 'org.hyperledger.fabric.samples.assettransfer.ContractMain'
mainClass = 'org.hyperledger.fabric.contract.ContractRouter'
}
checkstyle {

View file

@ -1,23 +0,0 @@
/*
* SPDX-License-Identifier: Apache-2.0
*/
package org.hyperledger.fabric.samples.assettransfer;
import org.hyperledger.fabric.contract.ContractRouter;
public final class ContractMain {
private ContractMain() {
}
public static void main(final String[] args) throws Exception {
if (!System.getenv().containsKey("CHAINCODE_SERVER_ADDRESS")) {
throw new IllegalArgumentException("Missing required 'CHAINCODE_SERVER_ADDRESS' parameter from env");
} else if (!System.getenv().containsKey("CORE_CHAINCODE_ID_NAME")) {
throw new IllegalArgumentException("Missing required 'CORE_CHAINCODE_ID_NAME' parameter from env");
}
ContractRouter.main(args);
}
}