mirror of
https://github.com/codex-storage/codex-testnet-starter.git
synced 2025-02-24 16:18:53 +00:00
* script updates for *nix * workshop instructions update * add "0x" before address output * windows script translation from AI -- not tested! * Setting up for-codexers folder * yes --------- Co-authored-by: Ben <thatbenbierens@gmail.com>
14 lines
649 B
Batchfile
14 lines
649 B
Batchfile
@echo off
|
|
setlocal enabledelayedexpansion
|
|
|
|
echo Generating private key...
|
|
|
|
:: Use PowerShell to make the API call and process the response
|
|
powershell -Command "& { $response = Invoke-RestMethod -Uri 'https://api.blockcypher.com/v1/eth/main/addrs' -Method Post; $privateKey = $response.private; $address = $response.address; $privateKey | Out-File -FilePath '.\eth.key' -NoNewline; Write-Host ' * your private key has been saved to %cd%\eth.key'; Write-Host (' * your ethereum address is 0x' + $address); }"
|
|
|
|
:: Set file permissions to read-only for the current user
|
|
icacls .\eth.key /inheritance:r
|
|
icacls .\eth.key /grant:r %USERNAME%:R
|
|
|
|
exit /b 0
|