Skip to content

Instantly share code, notes, and snippets.

@aknirmal90
Created March 1, 2019 10:47
Show Gist options
  • Save aknirmal90/6964d8f5b12c83bd7d834c9fad374e64 to your computer and use it in GitHub Desktop.
Save aknirmal90/6964d8f5b12c83bd7d834c9fad374e64 to your computer and use it in GitHub Desktop.
cat transactions.json | jq -cr 'del(.inputs, .outputs)' > txns.json
cat transactions.json | jq -cr '{hash: .hash, outputs: .outputs[]} | {hash: .hash, index: .outputs.index, addresses: .outputs.addresses, required_signatures: .outputs.required_signatures, type: .outputs.type, value: .outputs.value}' > outputs.json
cat transactions.json | jq -cr '{hash: .hash, outputs: .outputs[]} | {hash: .hash, index: .outputs.index, addresses: .outputs.addresses[]}' > outputs_addresses.json
cat transactions.json | jq -cr '{hash: .hash, inputs: .inputs[]} | { hash: .hash, index: .inputs.index, spent_transaction_hash: .inputs.spent_transaction_hash, spent_output_index: .inputs.spent_output_index }' > inputs.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment