24 lines
697 B
JavaScript
Executable file
24 lines
697 B
JavaScript
Executable file
#!/usr/bin/env node
|
|
|
|
const { exec } = require('child_process');
|
|
const path = require('path');
|
|
const fs = require('fs');
|
|
|
|
async function compileCircuit() {
|
|
console.log('Compiling circuit...');
|
|
|
|
const circuitPath = path.join(__dirname, '../circuits/license_verification.circom');
|
|
const outputDir = path.join(__dirname, '../circuits');
|
|
|
|
// Compile circuit
|
|
exec(`circom ${circuitPath} --r1cs --wasm --sym -o ${outputDir}`, (error, stdout, stderr) => {
|
|
if (error) {
|
|
console.error(`Compilation error: ${error}`);
|
|
return;
|
|
}
|
|
console.log('Circuit compiled successfully');
|
|
console.log(stdout);
|
|
});
|
|
}
|
|
|
|
compileCircuit();
|