Skip to content
This repository has been archived by the owner on Mar 11, 2024. It is now read-only.
/ swirl Public archive

Make curl easier with ethereum bash completions.

License

Notifications You must be signed in to change notification settings

trufflesuite/swirl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

swirl

Make curl easier with ethereum bash completions.

Usage

Enter any valid JSON RPC method and parameters

Options

-a newAddress -p port -P protocol

Full Example

swirl -a localhost -p 7545 -P https eth_getTransactionByHash 0x0...
curl -H "Content-Type: application/json" -X POST --data '{"id":120,"jsonrpc":"2.0","method":"eth_getTransactionByHash","params":"0x0.."}' https://localhost:7545
swirl eth_getTransactionByHash 0x0...
curl -H "Content-Type: application/json" -X POST --data '{"id":120,"jsonrpc":"2.0","method":"eth_getTransactionByHash","params":"0x0.."}' http://localhost:8545
swirl eth_getBlockByNumber 0xb true
curl -H "Content-Type: application/json" -X POST --data '{"id":120,"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["0xb", true]}' http://localhost:8545

Rich Parameters:

swirl eth_sendTransaction "{'value': '0x10000000', 'gas': '0xf4240', 'from': '0x...' etc.. }"
curl -H "Content-Type: application/json" -X POST --data '{"id":120,"jsonrpc":"2.0","method":"eth_sendTransaction","params":[{"value": "0x10000000", "gas": "0xf4240", "from": "0x..." etc...}]}' http://localhost:8545

Run consecutive calls:

swirl eth_getTransactionByHash 0x0...  eth_sendTransaction '{"value": "0x10000000", "as": "0xf4240", "from" "0x..." etc.. }'

Installation:

chmod +x install.sh
./install.sh

Manual installation

mkdir -p ~/bin
cp swirl ~/bin && chmod +x ~/bin/swirl

Manual Install Bash Completion

touch ~/.bash_completion && cat swirl_completion >> ~/.bash_completion && source ~/.bashrc

TODO

zsh support

About

Make curl easier with ethereum bash completions.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages