2024-06-25 20:17:48 +10:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -e
|
|
|
|
|
|
|
|
echo "Generating private key..."
|
|
|
|
|
|
|
|
response=$(curl -sX POST https://api.blockcypher.com/v1/eth/main/addrs)
|
|
|
|
echo -n "${response}" | grep -o '"private":.*"' | cut -d'"' -f4 > ./eth.key
|
2024-06-25 15:20:30 +02:00
|
|
|
echo -n "${response}" | grep -o '"address":.*"' | cut -d'"' -f4 > ./eth.address
|
2024-06-25 20:17:48 +10:00
|
|
|
chmod 600 ./eth.key
|
|
|
|
|
|
|
|
echo " * your private key has been saved to ${PWD}/eth.key"
|
2024-06-25 15:20:30 +02:00
|
|
|
echo " * your ethereum address has been saved to ${PWD}/eth.address"
|
2024-06-25 20:17:48 +10:00
|
|
|
echo " * your ethereum address is 0x${address}"
|