Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions cli.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
#!/usr/bin/env node

// Polyfill for up8-ticket compatibility with Node.js crypto module
// up8-ticket expects crypto.rng() but Node.js provides crypto.randomBytes()
const crypto = require('crypto');
crypto.rng = crypto.randomBytes;
global.crypto = crypto;

const {files} = require('./utils')

require('yargs')
Expand Down
3 changes: 0 additions & 3 deletions cmds/generate_cmds/network-key.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ const ticket = require('up8-ticket');
const _ = require('lodash')
const {files, validate, findPoints} = require('../../utils')

// needs to be required explicitly for up8-ticket to work
global.crypto = require('crypto')

exports.command = 'network-key'
exports.desc = 'Generates network keys and the associated network key file, used for booting the ship.'
exports.builder = (yargs) =>{
Expand Down
3 changes: 0 additions & 3 deletions cmds/generate_cmds/wallet.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ const ticket = require('up8-ticket');
const _ = require('lodash')
const {files, validate} = require('../../utils')

// needs to be required explicitly for up8-ticket to work
global.crypto = require('crypto')

exports.command = 'wallet'
exports.desc = 'Generates Urbit HD wallets as JSON files for a set of points.'
exports.builder = (yargs) =>{
Expand Down
Loading