|
@@ -4,17 +4,32 @@ import { faucetAccount } from './faucet/faucet'
|
|
|
import { MnemonicKey } from '@initia/initia.js'
|
|
|
import { InitiaClient } from './InitiaClient'
|
|
|
import polly from 'polly-js'
|
|
|
+import { DBClient } from './singletons'
|
|
|
+
|
|
|
+// await polly()
|
|
|
+// .waitAndRetry(4)
|
|
|
+// .executeForPromise(async () => {
|
|
|
+// const key = new MnemonicKey()
|
|
|
+// console.log(key.accAddress)
|
|
|
+// console.log(key.mnemonic)
|
|
|
+// await faucetAccount(key.accAddress)
|
|
|
+// })
|
|
|
+
|
|
|
+async function createAccounts(count: number) {
|
|
|
+ const accounts = []
|
|
|
+ for (let i = 0; i < count; i++) {
|
|
|
+ console.log(`creating account ${i}/${count}`)
|
|
|
+ const key = new MnemonicKey()
|
|
|
+ const account = {
|
|
|
+ mnemonic: key.mnemonic,
|
|
|
+ address: key.accAddress,
|
|
|
+ }
|
|
|
+ accounts.push(account)
|
|
|
+ }
|
|
|
+ await DBClient.instance.account.createMany({ data: accounts })
|
|
|
+}
|
|
|
+
|
|
|
+await createAccounts(20000)
|
|
|
+
|
|
|
+
|
|
|
|
|
|
-await polly()
|
|
|
- .waitAndRetry(4)
|
|
|
- .executeForPromise(async () => {
|
|
|
- // const key = new MnemonicKey()
|
|
|
- // console.log(key.accAddress)
|
|
|
- // console.log(key.mnemonic)
|
|
|
- await faucetAccount('init1yvmuhk70rp7n84qws7ws6emqtve0u22cthfwck')
|
|
|
- })
|
|
|
-// const client = new InitiaClient(
|
|
|
-// 'evil pact small brass now dirt gun horror route screen camp rookie crouch valid feel useful ladder robot slide adjust pact salad horse gesture',
|
|
|
-// )
|
|
|
-// console.log(client.key.accAddress)
|
|
|
-// await client.transfer('init1yvmuhk70rp7n84qws7ws6emqtve0u22cthfwck', 4)
|