I have the IOU sample app deployed to DAML Hub and am trying to use the Java app to interact with it. I am getting a error of “io.grpc.StatusRuntimeException: PERMISSION_DENIED: An error occurred. Please contact the operator and inquire about the request ” when it tries to make this request
client
.getActiveContractSetClient()
.getActiveContracts(iouFilter, true)
.blockingForEach(
response → {
response
.getOffset()
.ifPresent(offset → acsOffset.set(new LedgerOffset.Absolute(offset)));
response.getCreatedEvents().stream()
.map(Iou.Contract::fromCreatedEvent)
.forEach(
contract → {
long id = idCounter.getAndIncrement();
contracts.put(id, contract.data);
idMap.put(id, contract.id);
});
});
I am connecting as is suggested in another post and it is connecting fine -
DamlLedgerClient client =
DamlLedgerClient.newBuilder(ledgerhost, ledgerport)
// use the roots of trust already present on the system,
// ledgers running on *.daml.app domains use certs
// provided by Let’s Encrypt
.withSslContext(GrpcSslContexts.forClient().build())
// on Daml Hub, you will still need an access token;
// it can be supplied here or per operation
.withAccessToken(accessToken)
.build();
My thought is maybe I need to pass the access token on the request as well? I am not finding in the documentation how to try that though.