每当我尝试提交交易时。它给出了一个错误,即摘要应该是 32 个字节,我尝试提交摘要的二进制值,然后它给出了一个错误,即提交摘要与 qldb (Ledger) 摘要不匹配。
public function insert()
{
$client = AwsFacade::createClient('qldb-session');
$clientA = AwsFacade::createClient('qldb');
$result = $client->sendCommand([
'StartSession' => [
'LedgerName' => 'LawHq',
],
]);
$sessiontoken = ((object)$result->get('StartSession'))->SessionToken;
$result = $client->sendCommand([
'StartTransaction' =>
[],
'SessionToken' => $sessiontoken
]);
$transectiontoken = ((object)$result->get('StartTransaction'))->TransactionId;
$result = $client->sendCommand([
'ExecuteStatement' => [
'Statement' => 'INSERT INTO Employee {`Name`:`wow`,`Designation`:`ok`, `Address`:`hmm`}',
'TransactionId' => $transectiontoken,
],
'SessionToken' => $sessiontoken
]);
$result = $clientA->getDigest([
'Name' => 'LawHq',
]);
$digest = $result->get("Digest");
$diges = base64_encode($result->get("Digest"));
$result = $client->sendCommand([
'CommitTransaction' => [
'CommitDigest' => $digest,
'TransactionId' => $transectiontoken
],
'SessionToken' => $sessiontoken
]);
}