1234567891011121314151617181920212223242526272829303132333435 |
- import { getCaptcha } from './faucet/recaptcha'
- 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)
|