Skip to content

Instantly share code, notes, and snippets.

@dseg
Created March 28, 2018 07:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dseg/8e7d0ffcf1571a7b39a3fcda68ee2a5e to your computer and use it in GitHub Desktop.
Save dseg/8e7d0ffcf1571a7b39a3fcda68ee2a5e to your computer and use it in GitHub Desktop.
Estimate Gas (of Ethereum)
#!/bin/sh
# Requirements: geth
fee=$(geth attach ipc:/home/ubuntu/main_net/geth.ipc --exec 'web3.fromWei(web3.eth.gasPrice*web3.eth.estimateGas({from:"0xc1912fee45d61c87cc5ea59dae31190fffff232d"}))')
date
echo -n $fee | tr -d \"
echo \ ETH.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment