|
@@ -1,7 +1,7 @@
|
|
|
import axios, { AxiosInstance } from 'axios'
|
|
|
import dotenv from 'dotenv'
|
|
|
import polly from 'polly-js'
|
|
|
-import { solveChallenge } from 'shawnlu96-altcha-lib'
|
|
|
+import { solveChallenge, solveChallengeWorkers } from 'shawnlu96-altcha-lib'
|
|
|
dotenv.config()
|
|
|
|
|
|
const googlekey = '6LdLhtYpAAAAAOe1xmceNR-i6MTtzq7N6AYztoVI'
|
|
@@ -45,14 +45,16 @@ export async function getAltchaPayload(client: AxiosInstance) {
|
|
|
'https://faucet-api.initiation-1.initia.xyz/create_challenge',
|
|
|
)
|
|
|
const challenge = challengeResp.data
|
|
|
+
|
|
|
// console.log(challenge)
|
|
|
- const { promise } = solveChallenge(
|
|
|
+ const solution = await solveChallengeWorkers(
|
|
|
+ './build/src/faucet/worker.js',
|
|
|
+ 4,
|
|
|
challenge.challenge,
|
|
|
challenge.salt,
|
|
|
challenge.max,
|
|
|
challenge.start,
|
|
|
)
|
|
|
- const solution = await promise
|
|
|
const payload = {
|
|
|
algorithm: 'SHA-256',
|
|
|
challenge: challenge.challenge,
|