We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
stdin
Now, a lot of sub-commands of ckb-cli require exporting data into files before pass them into next sub-commands.
ckb-cli
In current, I have to write code like this:
ckb-cli tx init --tx-file "${ckb_tmp_txfile}" echo "${privkey}" > "${privkey_file}" ckb-tx sign-inputs --tx-file "${ckb_tmp_txfile}" \ --privkey-path "${privkey_file}" \ --add-signatures rm "${privkey_file}" cat "${ckb_tmp_txfile}" \ | jq -r ".transaction.outputs[0].lock.code_hash = \"0x${lock_code_hash}\"" \ | jq -r ".transaction.outputs[0].lock.hash_type = \"data\"" \ | jq -r ".transaction.outputs[0].lock.args = \"0x\"" \ | jq -r ".transaction.outputs[0].type = null" \ | jq -r ".transaction.outputs_data[0] = \"0x\"" \ > "${ckb_tmp_txfile}.tmp" mv "${ckb_tmp_txfile}.tmp" "${ckb_tmp_txfile}" ckb-cli tx send --tx-file "${ckb_tmp_txfile}" --skip-check rm "${ckb_tmp_txfile}"
But, if ckb-cli support using stdin as a input argument, all temporary files are unnecessary.
For example, if - means stdin, the above code can be rewrite like this:
-
ckb-cli tx init --tx-file - \ | ckb-tx sign-inputs --tx-file - --privkey "${privkey}" --add-signatures \ | jq -r ".transaction.outputs[0].lock.code_hash = \"0x${lock_code_hash}\"" \ | jq -r ".transaction.outputs[0].lock.hash_type = \"data\"" \ | jq -r ".transaction.outputs[0].lock.args = \"0x\"" \ | jq -r ".transaction.outputs[0].type = null" \ | jq -r ".transaction.outputs_data[0] = \"0x\"" \ | ckb-cli tx send --tx-file - --skip-check
The text was updated successfully, but these errors were encountered:
stdout
--debug
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.
Sorry, something went wrong.
This issue was closed because it has been stalled for 5 days with no activity.
No branches or pull requests
Now, a lot of sub-commands of
ckb-cli
require exporting data into files before pass them into next sub-commands.In current, I have to write code like this:
But, if
ckb-cli
support usingstdin
as a input argument, all temporary files are unnecessary.For example, if
-
meansstdin
, the above code can be rewrite like this:The text was updated successfully, but these errors were encountered: