@nori-zk/proof-conversion
Version:
Verifying zkVM proofs inside o1js circuits, to generate Mina compatible proof
50 lines • 1.67 kB
JavaScript
import * as os from 'os';
export class PlatformFeatureDetectionComputationalPlan {
constructor() {
this.name = 'PlatformFeatureDetection';
this.stages = [
{
type: 'main-thread',
name: 'PlatformDetection',
execute: (state) => {
state.platformName = os.platform();
},
},
{
type: 'serial-cmd',
name: 'NumaCtlCheck',
prerequisite: (state) => state.platformName === 'linux',
processCmd: {
cmd: 'numactl',
args: ['echo'],
emit: false,
capture: true,
},
callback: (state, result) => {
if (result.error || result.stdErr)
state.numactl = false;
else
state.numactl = true;
},
},
{
type: 'serial-cmd',
name: 'NumaCtlNodeCheck',
prerequisite: (state) => state.numactl == true,
processCmd: {
cmd: '/bin/bash',
args: ['-c', "numactl --hardware | grep -oP '(?<=available: )\\d+'"],
emit: false,
capture: true,
},
callback: (state, result) => {
state.numaNodes = parseInt(result.stdOut?.trim() || 'NaN');
},
},
];
}
async then(state) {
return state;
}
}
//# sourceMappingURL=index.js.map