Skip to content

Instantly share code, notes, and snippets.

@cryptcoin-junkey
Created July 31, 2017 08:29
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cryptcoin-junkey/f9175ddc2be77014e62bad2315d87dc1 to your computer and use it in GitHub Desktop.
Save cryptcoin-junkey/f9175ddc2be77014e62bad2315d87dc1 to your computer and use it in GitHub Desktop.

You must use Bash as your shell. Because /dev/tcp is a magic provided by Bash.

$ exec 5<>/dev/tcp/{server_host}/{tcp_port}
$ echo '{"jsonrpc":"2.0","id":"1","method":"server.version","params":[]}' >&5; cat <&5

You'll get the result like this.

{"jsonrpc": "2.0", "id": "1", "result": "ElectrumX 1.0.15"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment