最近发现了一个不错的项目fibos.io,兑换对于小白来说比较复杂,如果你想兑换又不懂编程可以联系我帮你兑换(QQ:1440097381)。接下来写一下详细的兑换教程,需要有一定编程基础的,官方的兑换教程太繁琐好多人都失败了。
eos捐赠地址abcdef555555
eos开发者群QQ群:705376456
笔者是ubantu系统
1、安装fibos
root@amen:~# curl -s https://fibos.io/download/installer.sh |sh
2、查看版本确认是否安装成功、
root@amen:~# fibos --version
v0.27.0-dev//成功
3、package.json 配置初始化(一路回车即可)
root@amen:~# fibos --init
Press ^C at any time to quit.
name: (amen)
version: (1.0.0)
description: (amen)
repository: (amen)
keywords: (456258men)
author: (amen)
license: (amen)
About to write to $[f}:
{
"name": "amen",
"version": "1.0.0",
"description": "amen",
"repository": "amen",
"keywords": "456258men",
"author": "amen",
"license": "amen"
}
Is this ok? (yes)
4.安装 fibos.js(fibos --install fibos.js好多人都会报错,请用npm代替fibos)
root@amen:~# npm install fibos.js
loadRequestedDeps → mapTo ▄ ╢███████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░loadRequestedDeps → fetch ▄ ╢███████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░loadRequestedDeps → netwo ▌ ╢███████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
兑换
1、生成一个 FIBOS 公私钥
输入fibos进入命令行窗口
root@amen:~# fibos
Welcome to FIBOS. Based on fibjs 0.27.0-dev.
Type ".help" for more information.
> var FIBOS = require("fibos.js");
> var prikey = FIBOS.modules.ecc.randomKeySync(); //私钥
> var pubkey = FIBOS.modules.ecc.privateToPublic(prikey); //公钥
> prikey
"5JAtrFRBKXGozR7r5bXcWajkBSeXw1S34PGyTFUv33ms9Ea9nSY"
> pubkey
"FO7t7LQn5u7DJFPriE7TD4rWT7KN9sjepvQc2xwWMocJPk33CeVo"
>
保存好你的私钥公钥
接着输入.exit退出控制台
> .exit
2、生成fibos账号
创建文件 CreatFibos.js
root@amen:~# vim CreatFibos.js
复制粘贴如下代码,注意:你要创建的FIBOS 账户数字必须是1-5,字母a-z(小写),长度必须为12位
var http = require('http');
var httpClient = new http.Client();
var httpServerHost = "http://tunnel.fibos.io/1.0/app/token/create";
var account = "fuckeoshhhhh"; //你要创建的 FIBOS 账户名例如fuckeoshhhhh
var pubkey = "FO7t7LQn5u7DJFPriE7TD4rWT7KN9sjepvQc2xwWMocJPk33CeVo"; //兑换的步骤一生成的你的 FIBOS 公钥
var rep = httpClient.post(httpServerHost, {
json: {
account: account,
pubkey: pubkey
}
}).json()
console.log(rep);
输入
root@amen:~# fibos CreatFibos.js
创建成功打印结果为:
{
"message": "success",
"pubkey": "FO7t7LQn5u7DJFPriE7TD4rWT7KN9sjepvQc2xwWMocJPk33CeVo",
"account": "fuckeoshhhhh"
}
3、转账eos到fibos官方账号
收款方:fiboscouncil
重点!!!! 重点!!!!重点!!!! memo填写刚才生成的你的fibos账号 fuckeoshhhhh(转一两个测试一下)
4、查询余额
创建文件 getBalance.js
root@amen:~# vim getBalance.js
复制粘贴如下代码,代码需改动部分看注释
var FIBOS = require("fibos.js");
var config = {
chainId: "6aa7bd33b6b45192465afa3553dedb531acaaff8928cf64b70bd4c5e49b7ec6a",
priKey: "",//你的兑换部分步骤一生成的fibos私钥
httpEndpoint: "http://ca-rpc.fibos.io:8870",
verbose: false,
}
var fibos_client = FIBOS({
chainId: config.chainId,
keyProvider: config.priKey,
httpEndpoint: config.httpEndpoint,
verbose: false,
logger: {
log: null,
error: null
}
})
var rs = fibos_client.getTableRowsSync(true, "eosio.token", "你的 FIBOS 账户名例如fuckeoshhhhh", "accounts");
console.log(rs);
输入 ibos getBalance.js查询余额(返回结果是笔者兑换成功后的)
root@amen:~# fibos getBalance.js
{
"rows": [
{
"primary": 0,
"balance": {
"quantity": "0.0000 EOS",
"contract": "eosio"
}
},
{
"primary": 1,
"balance": {
"quantity": "88322.0823 FO",
"contract": "eosio"
}
}
],
"more": false
}
5、兑换
创建文件 eosToFibos.js
root@amen:~# vim eosToFibos.js
复制粘贴如下代码,改动部分看注释
//输入私钥、 账户名、兑换数量其他不用改;
var FIBOS = require("fibos.js");
var config = {
chainId: "6aa7bd33b6b45192465afa3553dedb531acaaff8928cf64b70bd4c5e49b7ec6a",
priKey: "你的 FIBOS 私钥",
httpEndpoint: "http://ca-rpc.fibos.io:8870",
verbose: false,
}
var fibos_client = FIBOS({
chainId: config.chainId,
keyProvider: config.priKey,
httpEndpoint: config.httpEndpoint,
verbose: false,
logger: {
log: null,
error: null
}
})
let ctx = fibos_client.contractSync("eosio.token");
var result = ctx.exchangeSync("你的 FIBOS 账户名", `150.0000 EOS@eosio`, `0.0000 FO@eosio`, `exchange EOS to FO`, {
authorization: "你的FIBOS账户名"
});
console.log(result);
输入 fibos eosToFibos.js进行兑换
root@amen:~# fibos eosToFibos.js
6、兑换成功,执行步骤5的查询命令,查询是否兑换成功
root@amen:~# fibos getBalance.js