From 03b6a333a3c7ed8f8334726f6bede2e200096150 Mon Sep 17 00:00:00 2001 From: Robby Zambito Date: Sun, 28 Feb 2021 21:07:20 +0000 Subject: Added wallet generator --- algo_wallet_gen.go | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 algo_wallet_gen.go diff --git a/algo_wallet_gen.go b/algo_wallet_gen.go new file mode 100644 index 0000000..631b9d9 --- /dev/null +++ b/algo_wallet_gen.go @@ -0,0 +1,34 @@ +package main + +import ( + "fmt" + "github.com/algorand/go-algorand-sdk/crypto" + "github.com/algorand/go-algorand-sdk/mnemonic" + "os" + "regexp" + "runtime" +) + +func main() { + walletChan := make(chan string) + pattern := os.Args[1] + for i := 0; i < runtime.NumCPU(); i++ { + go func() { + for { + account := crypto.GenerateAccount() + go func(acc crypto.Account) { + m, _ := mnemonic.FromPrivateKey(acc.PrivateKey) + wallet := fmt.Sprintf("%s:%s\n", acc.Address, m) + matched, _ := regexp.MatchString(pattern, wallet) + if matched { + walletChan <- wallet + } + }(account) + } + }() + } + + fmt.Println(<-walletChan) + os.Exit(0) + +} -- cgit v1.2.3