-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
54 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,5 @@ coverage.out | |
.idea | ||
*.swp | ||
*.swo | ||
|
||
wallets.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package fund | ||
|
||
// defaultPrivateKey is the default private key used to fund wallets. | ||
const defaultPrivateKey = "42b6e34dc21598a807dc19d7784c71b2a7a01f6480dc6f58258f78e539f1a1fa" | ||
|
||
// cmdParams holds the command-line parameters for the fund command. | ||
type cmdFundParams struct { | ||
RpcUrl *string | ||
PrivateKey *string | ||
|
||
WalletCount *uint64 | ||
WalletFundingAmount *float64 | ||
WalletFundingGas *uint64 | ||
ConcurrencyLevel *uint64 | ||
OutputFile *string | ||
} | ||
|
||
var params cmdFundParams | ||
|
||
func init() { | ||
p := new(cmdFundParams) | ||
flagSet := FundCmd.Flags() | ||
|
||
p.RpcUrl = flagSet.StringP("rpc-url", "r", "http://localhost:8545", "The RPC endpoint url") | ||
p.PrivateKey = flagSet.String("private-key", defaultPrivateKey, "The hex encoded private key that we'll use to send transactions") | ||
|
||
// Wallet parameters. | ||
p.WalletCount = flagSet.Uint64P("wallets", "w", 2, "The number of wallets to fund") | ||
p.WalletFundingAmount = flagSet.Float64P("amount", "a", 0.05, "The amount of eth to send to each wallet") | ||
p.WalletFundingGas = flagSet.Uint64P("gas", "g", 21000, "The cost of funding a wallet") | ||
p.ConcurrencyLevel = flagSet.Uint64P("concurrency", "c", 2, "The concurrency level for speeding up funding wallets") | ||
p.OutputFile = flagSet.StringP("file", "f", "wallets.json", "The output JSON file path for storing the addresses and private keys of funded wallets") | ||
|
||
params = *p | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters