docs(connector-ethereum): fix Testing API calls with container tutorial #3407
Open
Description
Description
The readme has a series of steps to execute on the command line that users can run through to see the connector in action.
The steps are very similar to the ones the Besu connector have, but they don't work unfortunately.
Logs on the Back-end
[2024-07-12T19:26:59.056Z] ERROR (RunTransactionEndpoint): Crash while serving post - /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/run-transaction MissingGasError: Invalid value given "gas: 0x5208, gasPrice: undefined, maxPriorityFeePerGas: undefined, maxFeePerGas: undefined". Error: "gas" is missing.
at validateGas (/tmp/org/hyperledger/cactus/plugins/some-unique-besu-connector-instance-id/node_modules/web3-eth/lib/commonjs/validation.js:237:15)
... 4 lines matching cause stack trace ...
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
cause: MissingGasInnerError: Missing properties in transaction, either define "gas" and "gasPrice" for type 0 transactions or "gas", "maxPriorityFeePerGas" and "maxFeePerGas" for type 2 transactions
at new MissingGasError (/tmp/org/hyperledger/cactus/plugins/some-unique-besu-connector-instance-id/node_modules/web3-errors/lib/commonjs/errors/transaction_errors.js:211:22)
at validateGas (/tmp/org/hyperledger/cactus/plugins/some-unique-besu-connector-instance-id/node_modules/web3-eth/lib/commonjs/validation.js:237:15)
at validateTransactionForSigning (/tmp/org/hyperledger/cactus/plugins/some-unique-besu-connector-instance-id/node_modules/web3-eth/lib/commonjs/validation.js:268:29)
at /tmp/org/hyperledger/cactus/plugins/some-unique-besu-connector-instance-id/node_modules/web3-eth/lib/commonjs/utils/prepare_transaction_for_signing.js:107:55
at Generator.next (<anonymous>)
at fulfilled (/tmp/org/hyperledger/cactus/plugins/some-unique-besu-connector-instance-id/node_modules/web3-eth/lib/commonjs/utils/prepare_transaction_for_signing.js:21:58)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
cause: undefined,
code: 440
},
code: 415
}
[2024-07-12T19:27:29.729Z] ERROR (RunTransactionEndpoint): Crash while serving post - /api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/run-transaction MissingGasError: Invalid value given "gas: 0x5208, gasPrice: undefined, maxPriorityFeePerGas: undefined, maxFeePerGas: undefined". Error: "gas" is missing.
at validateGas (/tmp/org/hyperledger/cactus/plugins/some-unique-besu-connector-instance-id/node_modules/web3-eth/lib/commonjs/validation.js:237:15)
... 4 lines matching cause stack trace ...
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
cause: MissingGasInnerError: Missing properties in transaction, either define "gas" and "gasPrice" for type 0 transactions or "gas", "maxPriorityFeePerGas" and "maxFeePerGas" for type 2 transactions
at new MissingGasError (/tmp/org/hyperledger/cactus/plugins/some-unique-besu-connector-instance-id/node_modules/web3-errors/lib/commonjs/errors/transaction_errors.js:211:22)
at validateGas (/tmp/org/hyperledger/cactus/plugins/some-unique-besu-connector-instance-id/node_modules/web3-eth/lib/commonjs/validation.js:237:15)
at validateTransactionForSigning (/tmp/org/hyperledger/cactus/plugins/some-unique-besu-connector-instance-id/node_modules/web3-eth/lib/commonjs/validation.js:268:29)
at /tmp/org/hyperledger/cactus/plugins/some-unique-besu-connector-instance-id/node_modules/web3-eth/lib/commonjs/utils/prepare_transaction_for_signing.js:107:55
at Generator.next (<anonymous>)
at fulfilled (/tmp/org/hyperledger/cactus/plugins/some-unique-besu-connector-instance-id/node_modules/web3-eth/lib/commonjs/utils/prepare_transaction_for_signing.js:21:58)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
cause: undefined,
code: 440
},
code: 415
}
Logs on the cURL terminal
$ curl --location --request POST 'http://127.0.0.1:4000/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-ethereum/run-transaction' \
--header 'Content-Type: application/json' \
--data-raw '{
"web3SigningCredential": {
"ethAccount": "627306090abaB3A6e1400e9345bC60c78a8BEf57",
"secret": "c87509a1c067bbde78beb793e6fa76530b6382a4c0241e5e4a9ec0a0f44dc0d3",
"type": "PRIVATE_KEY_HEX"
},
"transactionConfig": {
"from": "627306090abaB3A6e1400e9345bC60c78a8BEf57",
"to": "f17f52151EbEF6C7334FAD080c5704D77216b732",
"value": "1",
"maxPriorityFeePerGas": "0",
"maxFeePerGas": "40000000",
"gasLimit": "21000",
"type": 2
}
}'
{"message":"Internal Server Error","error":"{\"name\":\"MissingGasError\",\"code\":415,\"message\":\"Invalid value given \\\"gas: 0x5208, gasPrice: undefined, maxPriorityFeePerGas: undefined, maxFeePerGas: undefined\\\". Error: \\\"gas\\\" is missing.\",\"cause\":{\"name\":\"MissingGasInnerError\",\"code\":440,\"message\":\"Missing properties in transaction, either define \\\"gas\\\" and \\\"gasPrice\\\" for type 0 transactions or \\\"gas\\\", \\\"maxPriorityFeePerGas\\\" and \\\"maxFeePerGas\\\" for type 2 transactions\"},\"innerError\":{\"name\":\"MissingGasInnerError\",\"code\":440,\"message\":\"Missing properties in transaction, either define \\\"gas\\\" and \\\"gasPrice\\\" for type 0 transactions or \\\"gas\\\", \\\"maxPriorityFeePerGas\\\" and \\\"maxFeePerGas\\\" for type 2 transactions\"}}"}
Acceptance Criteria
- The steps explained in the readme are working as intended.