Skip to content

Instantly share code, notes, and snippets.

@evilcos
Created August 29, 2018 10:57
Show Gist options
  • Save evilcos/11582f5013a0a556d9455421deafa35f to your computer and use it in GitHub Desktop.
Save evilcos/11582f5013a0a556d9455421deafa35f to your computer and use it in GitHub Desktop.
Script to create FIBOS account.
// 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);
@evilcos
Copy link
Author

evilcos commented Aug 29, 2018

var http = require('http');
var FIBOS = require("fibos.js");

var pubkey = 'FO6k19up1AhKL5AUYcHxAnoVi3YMXfjuAvpWKStt1gvz7ZZNQ1sK'; // set to your 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 account = "hiiamahacker";
var rep = httpClient.post(httpServerHost, {
    json: {
        account: account,
        pubkey: pubkey
    }   
}).json()
console.log(rep);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment