Files
salvium-rs/test/test-miner-import.js
T
Matt Hess 7730b6993f ● Add AssemblyScript WASM VM for RandomX full mode
- Create assembly/vm.ts with full RandomX VM implementation
    - 256 instructions, 2048 iterations per hash
    - Native u64/f64 operations in WebAssembly
    - Full mode dataset lookups (2GB pre-computed)

  - Update miner to use WASM VM for full mode
    - mining-worker-asm.js uses pre-compiled WASM
    - ~32 H/s per thread (4x faster than light mode)
    - 8 threads achieves ~260 H/s

  - Clean up redundant code
    - Remove mining-worker-full.js (old JIT approach)
    - Consolidate 'asm' mode into 'full' mode
2026-01-18 01:16:10 +00:00

40 lines
1.1 KiB
JavaScript

/**
* Test miner imports and configuration
*/
import { StratumMiner, getAvailableCores } from '../src/stratum/miner.js';
import { RandomXFullMode, RANDOMX_DATASET_SIZE } from '../src/randomx/full-mode.js';
console.log('=== Miner Import Test ===\n');
console.log('Available cores:', getAvailableCores());
console.log('Dataset size:', (RANDOMX_DATASET_SIZE / 1024 / 1024 / 1024).toFixed(2), 'GB');
// Test light mode miner creation
console.log('\nCreating light mode miner...');
const lightMiner = new StratumMiner({
pool: 'stratum+tcp://localhost:3333',
wallet: 'SAL1test...',
threads: 2,
mode: 'light'
});
console.log('Light mode miner created:', {
mode: lightMiner.options.mode,
threads: lightMiner.options.threads
});
// Test full mode miner creation
console.log('\nCreating full mode miner...');
const fullMiner = new StratumMiner({
pool: 'stratum+tcp://localhost:3333',
wallet: 'SAL1test...',
threads: 4,
mode: 'full'
});
console.log('Full mode miner created:', {
mode: fullMiner.options.mode,
threads: fullMiner.options.threads
});
console.log('\n=== All imports successful ===');