mirror of
https://github.com/hyperledger/fabric-samples.git
synced 2026-06-17 07:25:10 +00:00
- Updated build to use Go 1.18 since Go 1.16 is no longer supported. - Use Java 11 in updated samples, and take advantage of new language features. Signed-off-by: Mark S. Lewis <mark_lewis@uk.ibm.com>
27 lines
818 B
Java
27 lines
818 B
Java
/*
|
|
* Copyright IBM Corp. All Rights Reserved.
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
import io.grpc.Channel;
|
|
|
|
import java.io.IOException;
|
|
import java.security.InvalidKeyException;
|
|
import java.security.cert.CertificateException;
|
|
|
|
public final class Transact implements Command {
|
|
@Override
|
|
public void run(final Channel grpcChannel)
|
|
throws CertificateException, IOException, InvalidKeyException {
|
|
try (var gateway = Connections.newGatewayBuilder(grpcChannel).connect()) {
|
|
var network = gateway.getNetwork(Connections.CHANNEL_NAME);
|
|
var contract = network.getContract(Connections.CHAINCODE_NAME);
|
|
|
|
var smartContract = new AssetTransferBasic(contract);
|
|
|
|
var app = new TransactApp(smartContract);
|
|
app.run();
|
|
}
|
|
}
|
|
}
|