Skip to content

Instantly share code, notes, and snippets.

@nealfennimore
Created December 10, 2017 22:07
Show Gist options
  • Save nealfennimore/3317eda5bce6a2ce3cef7d67b4aa2313 to your computer and use it in GitHub Desktop.
Save nealfennimore/3317eda5bce6a2ce3cef7d67b4aa2313 to your computer and use it in GitHub Desktop.
IOTA Full Node scripts
function addNeighbor() {
payload=$(jq -n --arg uris "$1" '{"command":"addNeighbors", "uris":[ $uris ]}')
curl http://localhost:14265 -H "X-IOTA-API-VERSION: 1.4" -d "$payload" | jq
}
function removeNeighbor() {
payload=$(jq -n --arg uris "$1" '{"command":"removeNeighbors", "uris":[ $uris ]}')
curl http://localhost:14265 -H "X-IOTA-API-VERSION: 1.4" -d "$payload" | jq
}
function getNodeInfo(){
curl http://localhost:14265 -X POST -H 'X-IOTA-API-Version: 1.4' -d '{"command": "getNodeInfo"}' | jq
}
function getNeighbors(){
curl http://localhost:14265 -X POST -H 'X-IOTA-API-Version: 1.4' -d '{"command": "getNeighbors"}' | jq
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment