Kurate/packages/contracts/scripts/download-snark-artifacts.ts
Vojtech Simetka 657b850a4e
feat: add group verification and message posting through smart contract (#80)
Co-authored-by: Philippe Schommers <philippe@schommers.be>
2023-01-24 07:51:42 +01:00

25 lines
705 B
TypeScript

import download from "download"
import fs from "fs"
import { config } from "../package.json"
async function main() {
const snarkArtifactsPath = config.paths.build["snark-artifacts"]
const url = `http://www.trusted-setup-pse.org/semaphore/${20}`
if (!fs.existsSync(snarkArtifactsPath)) {
fs.mkdirSync(snarkArtifactsPath, { recursive: true })
}
if (!fs.existsSync(`${snarkArtifactsPath}/semaphore.zkey`)) {
await download(`${url}/semaphore.wasm`, snarkArtifactsPath)
await download(`${url}/semaphore.zkey`, snarkArtifactsPath)
}
}
main()
.then(() => process.exit(0))
.catch((error) => {
console.error(error)
process.exit(1)
})