Skip to content

Instantly share code, notes, and snippets.

@nolim1t
Last active October 8, 2020 11:42
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 nolim1t/b741183584732760381266e5e07b249d to your computer and use it in GitHub Desktop.
Save nolim1t/b741183584732760381266e5e07b249d to your computer and use it in GitHub Desktop.
Push transaction with full node
#!/bin/sh
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
if [ $# -eq 0 ]; then
echo "Please specify hex id"
exit 1
fi
PASSWORD=`cat $HOME/.password`
if [ -z $PASSWORD ]; then
echo "Please place password in .password"
exit 1
fi
echo "Sending transaction... stand by"
curl --user lncm:$PASSWORD \
--data-binary \
'{"jsonrpc": "1.0", "id":"CURL", "method": "sendrawtransaction", "params": ["'$1'"] }' -H 'content-type: text/plain;' \
http://127.0.0.1:8332/ \
2>/dev/null | jq
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment