5

I'm trying to run a service that processes a bunch of ETH private keys and need to create send transactions via the command line. I know about geth, but are there other easier to use command line apps that just can pass in a private key, sender address, and amount as a parameter.

Metamask for command line would be nice as one can import a private key into the wallet and make transactions.

3 Answers 3

4
+25

The eth-cli project is what you are searching for.

This is a command-line tool that gives you some shortcut to do common tasks, and in particular, there is the transaction:send method that takes precisely the three parameters you have (private key, recipient, amount):

eth transaction:send --pk 3daa79a26454a5528a3523f9e6345efdbd636e63f8c24a835204e6ccb5c88f9e --to 0x828DaF877f46fdFB5F1239cd9cB8f0D6E1adfb80 --value 1000000000000000000

Please note that you need to connect to a node to send the transactions created this way.

3
  • what if I wanted to do a send from the polygon, avalanche, or BSC network? Jan 21, 2022 at 4:32
  • I don't know Avalanche, but Polygon and BSC are EVM based so the only real difference should be the chainID (or networkID). You can use network command to add your custom network (github.com/protofire/eth-cli/blob/master/docs/…) and then specity that when sending transactions. Jan 23, 2022 at 21:57
  • whats the difference with eth-cli vs hardhat? Or what other ones do other people use? Jan 27, 2022 at 16:14
1

The dapp.tools has a command line tool called seth. I can recommend a video by Mariano Conti on how to set it up:

You can send ether by running:

 seth send --value 0.1  to-address

In my opinion, the official documentation lacks a quickstart, but the Maker team has created a nice section about the tool.

You should also install duppgrade to take full advantage of the suite and join the chat!

0

Unfortunately, JRPC is the only widely adopted way to interact with the blockchain.

The "easiest" would be to setup a default environment with something like hardhat, and writing a javascript script to do what you want.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.