Last active
October 8, 2020 11:42
-
-
Save nolim1t/b741183584732760381266e5e07b249d to your computer and use it in GitHub Desktop.
Push transaction with full node
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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