A collection of command line utilities to interact with Ethereum and account management
-
Install the .Net CLI (Windows, Mac, Linux) https://www.microsoft.com/net/download/core#/sdk
-
Clone directory / download source
-
Navigate to Nethereum.Console (directory containing Nethereum.Console.csproj)
-
Restore Dependencies
dotnet restore
-
Build
dotnet build
Once it is built you can run any command directly from the same directory
-
Run
dotnet run create-account -p "superpassword" -dd "c:\Users\JuanFran\NewAccount"
You can find the list of commands by executing dotnet Nethereum.Console.dll -h
.
accounts-dir-total-balance
Calculates the total Ether balance of all the accounts in a given directoryaccounts-total-balance
Calculates the total Ether balance of an account or accounts using the addresses providedaccount-total-token-balance
Returns the token balance of an account from a compliant ERC20 smart contractaccount-transfer-from-account-file
Transfers ether from a given acccount file (key store file) to another accountaccount-transfer-from-account-private-key
Transfers ether using the account's private keycreate-acccounts-mix-balances
Generates new accounts in a given directory, and mixes and transfer balances from the accounts in the source directorycreate-account
Creates an account and stores it in a given directorycreate-account-key-pair
Generates a new private key and ethereum addresssend-transaction-from-account-file
Sends a transaction using the account's key store filesend-transaction-from-account-private-key
Sends a transaction using the account's private key
- Create Account
- Account or Accounts Total Balance
- Account or Accounts in Directory Total Balance
- Account Transfer from Account File
Creates an account and stores it in a given folder
create-account
- -p | --password The password used for the account files
- -dd | --destinationDirectory Optional: The directory to create the account key store file
- -? | -h | --help Show help information
create-account -p "superpassword" -dd "c:\Users\JuanFran\NewAccount"
Calculates the total balance (in Ether) of an account or accounts using the address or addresses provided
accounts-total-balance
- -a | --addr The address or addresses to calculate the total balance
- -url The rpc address to connect
- -? | -h | --help Show help information
accounts-total-balance -url "https://mainnet.infura.io/v3/7238211010344719ad14a89db874158c:8545" -a 0xb794f5ea0ba39494ce839613fffba74279579268 -a 0xe853c56864a2ebe4576a807d26fdc4a0ada51919
Calculates the total Ether balance of all the accounts in a given directory
accounts-dir-total-balance
- -sd | --sourceDirectory The directory containing the source accounts
- -url The rpc address to connect
- -? | -h | --help Show help information
accounts-dir-total-balance -url "https://mainnet.infura.io/v3/7238211010344719ad14a89db874158c:8545" -sd "c:\Users\JuanFran\NewAccount"
Transfers ether from a given acccount file (key store file) to another account
account-transfer-from-account-file
- -af | --accountFile The account key store file
- -ta | --toAddress The address to send the ether to
- -p | --password The account file password
- --url The rpc address to connect
- --amount The amount in Ether to send
- -? | -h | --help Show help information
dotnet run account-transfer-from-account-file --url "http://localhost:8545" -af "C:\testchain\devChain\keystore\UTC--2015-11-25T05-05-03.116905600Z--12890d2cce102216644c59dae5baed380d84830c" -p "password" -ta 0x13f022d72158410433cbd66f5dd8bf6d2d129924 --amount 0.1
This is a security feature, for a quick and simple way to move of All the ether balances from a set of accounts to a newly created set of accounts. The amounts are transfered also randomly, achieving a "mix".
TODO: Add a delay function for transfers
create-acccounts-mix-balances
- -sd | --sourceDirectory The directory containing the source accounts
- -dd | --destinationDirectory The directory to create new accounts
- -p | --password The generic password used for all the account files
- --url The rpc address to connect
- -na Optional: The number of accounts to create, defaults to 4
- -? | -h | --help Show help information
- SendTransaction (added for private key and key store file, this is done add readme usage)
- ERC20 balance (done, add readme usage), transfer
- Generare keystore file from private key, password (done add readme usage)
- Generate private key, address (done, todo add readme usage)
- Retrieve private key from key storage
- Message sign
- Deploy contract
- Generic Smart contract call / transfer using abi and method
Note: in this sample, a special INFURA API key is used: 7238211010344719ad14a89db874158c
. If you wish to use this sample in your own project you’ll need to sign up on INFURA and use your own key.
MIT
The MIT License (MIT)
Copyright (c) 2016 Nethereum.com (Juan Blanco) , Logo by Cass (https://github.com/cassiopaia)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.