40 lines
847 B
JavaScript
Executable file
40 lines
847 B
JavaScript
Executable file
#!/usr/bin/env node
|
|
|
|
'use strict';
|
|
|
|
const path = require('path');
|
|
const os = require('os');
|
|
const Config = require('bcfg');
|
|
const Seeder = require('../lib/node/seeder');
|
|
const config = new Config('hs-seeder');
|
|
|
|
config.load({
|
|
argv: true
|
|
});
|
|
|
|
const network = config.str(['-n', '--network'], 'main');
|
|
|
|
const defaultPrefix = path.join(
|
|
os.homedir(),
|
|
'.hsd',
|
|
network === 'main' ? '' : network
|
|
);
|
|
const prefix = config.str('prefix', defaultPrefix);
|
|
|
|
(async () => {
|
|
const seeder = new Seeder({
|
|
network,
|
|
prefix,
|
|
filename: config.str(['-f', '--filename']),
|
|
zone: config.str(['--zone']),
|
|
ns: config.str(['--ns']),
|
|
ip: config.str(['--ip']),
|
|
host: config.str(['-h', '--host']),
|
|
port: config.uint(['-p', '--port'])
|
|
});
|
|
|
|
await seeder.open();
|
|
})().catch((err) => {
|
|
console.error(err.stack);
|
|
process.exit(1);
|
|
});
|