Created
August 29, 2018 10:57
-
-
Save evilcos/11582f5013a0a556d9455421deafa35f to your computer and use it in GitHub Desktop.
Script to create FIBOS account.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// by cos, 2018/08/29 | |
// first please: https://fibos.io/docs/guide/basic/install.md.html | |
var http = require('http'); | |
var FIBOS = require("fibos.js"); | |
var prikey = FIBOS.modules.ecc.randomKeySync(); | |
var pubkey = FIBOS.modules.ecc.privateToPublic(prikey); | |
console.log(prikey); | |
console.log(pubkey); | |
var argvs = process.argv.splice(2); | |
var account = argvs[0]; | |
console.log(account); | |
var httpClient = new http.Client(); | |
var httpServerHost = "http://tunnel.fibos.io/1.0/app/token/create"; | |
var rep = httpClient.post(httpServerHost, { | |
json: { | |
account: account, | |
pubkey: pubkey | |
} | |
}).json() | |
console.log(rep); |
Author
evilcos
commented
Aug 29, 2018
•
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment