区块广播:

【教程】LBTC创建token功能使用教程

Lbtc社区版主发布在 LBTC/闪电比特币来自App
 36015  0
LBTC创建token功能已初步开发完成,现部署于测试网.欢迎社区技术爱好者使用并测试创建token功能。

区块浏览器:http://47.96.169.139:9699/

全节点钱包下载址:
https://pan.baidu.com/s/1j9DJ-K4OAAnx8o7jt6nhfQ

视频教程下载链接:https://pan.baidu.com/s/1cCAny9THXTUSniIiTnxlCA

1. Registername(创建token之前需要注册名字,花费1LBTC)

Arguments(参数):
1. "address" (string, required) The lbtc address.
2. "name" (string, required) The address name.

Result(返回结果):
"txid:" (string) The transaction id.

Examples(实例):
> bitcoin-cli registername "1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd" "testname"
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "registername", "params": ["1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd", "testname"] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/

cli cmd(cli命令):
./bitcoin-cli registername mi5HWG19ocB81cqFqLeD6NRqM6nqYk2Rug owner


2. Createtoken(创建Token 需花费10LBTC)

Arguments(参数):
{
1. "tokenSymbol" (string, required) The token symbol. 8位 数字+英文字母
2. "tokenName" (string, required) The token name. 32位 数字+英文字母
3. "ownerAddress" (string, required) Creater's address.
4. "tokenAddress" (string, required) Token contract address.
5. "totalSupply" (numeric, required) Total amount of the token. 1-1千亿 (如果小数输入会取整)
6. "decimal" (numeric, required) The token fund amount decimal. 0-8整数
}

Result(返回结果):

"result" (string) The result description.

Examples(实例):
> bitcoin-cli createtoken "tokenSymbol" "tokenName" "1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd" "1LtvqCaApEdUGFkpKMM4MstjcaL4dKg8SP" "100000000" "2"
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "createtoken", "params": ["tokenSymbol", "tokenName", "1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd", "1LtvqCaApEdUGFkpKMM4MstjcaL4dKg8SP", "100000000", "2"] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/

cli cmd(cli命令):
./bitcoin-cli createtoken BTC BTCtoken mi5HWG19ocB81cqFqLeD6NRqM6nqYk2Rug mvycp4LXckLZ98atxj6SvMFSCoijG4d6yB 10000 8

注释:
创建一个标识为BTC,token名为BTC token,owneraddress为mi5HWG19ocB81cqFqLeD6NRqM6nqYk2Rug ,tokenaddress为mvycp4LXckLZ98atxj6SvMFSCoijG4d6yB 数量10000 小数8位的token


3. Sendtoken (发送token需花费0.01LBTC)

sendtoken tokenAddress fromAddress toAddress amount changeAddress commnet

Sent an amount from an address to another address.

Arguments(参数):
1. "tokenAddress" (string, required) The token contract address.
2. "fromAddress" (string, required) The address to send funds from.
3. "toAddress" (string, required) The address to send funds to.
4. "amount" (numeric or string, required) The amount to send (transaction fee is added on top).
5. "changeAddress" (string, optional) The change address. (目前不支持)
6. "comment" (string, optional) A comment used to store what the transaction is for.
This is not part of the transaction, just kept in your wallet.

Result(返回结果):
"txid" (string) The transaction id.

Examples(实例):
> bitcoin-cli sendtoken "1LtvqCaApEdUGFkpKMM4MstjcaL4dKg8SP" "1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd" "1LtvqCaApEdUGFkpKMM4MstjcaL4dKg8SP" 0.01 "1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd" "Comment"

cli cmd(cli命令):
./bitcoin-cli sendtoken
mvycp4LXckLZ98atxj6SvMFSCoijG4d6yB mvycp4LXckLZ98atxj6SvMFSCoijG4d6yB mi5HWG19ocB81cqFqLeD6NRqM6nqYk2Rug 10.999

注释:
向mi5HWG19ocB81cqFqLeD6NRqM6nqYk2Rug发送10.999个BTCtoken

4. Locktoken(锁仓token,需花费0.01LBTC)

locktoken tokenAddress fromAddress toAddress amount changeAddress commnet

lock an amount from an address to another address.

Arguments(参数):
1. "tokenAddress" (string, required) The token contract address.
2. "fromAddress" (string, required) The address to lock funds from.
3. "toAddress" (string, required) The address to lock funds to.
4. "amount" (string, required) The amount to lock (transaction fee is added on top).
5. "heights" (string, required) Lock heights. (绝对块高整形)
6. "changeAddress" (string, optional) The change address. (目前不支持)
7. "comment" (string, optional) A comment used to store what the transaction is for.
This is not part of the transaction, just kept in your wallet.

Result(返回结果):
"txid" (string) The transaction id.

Examples(实例):
> bitcoin-cli locktoken "1LtvqCaApEdUGFkpKMM4MstjcaL4dKg8SP" "1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd" "1LtvqCaApEdUGFkpKMM4MstjcaL4dKg8SP" 0.01 100 "1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd" "Comment
cli cmd(cli命令):
./bitcoin-cli locktoken mvycp4LXckLZ98atxj6SvMFSCoijG4d6yB mvycp4LXckLZ98atxj6SvMFSCoijG4d6yB n212T8EGcoRGSAD31aSfBWiKtnGptXsjL6 999 100

注释:
在n212T8EGcoRGSAD31aSfBWiKtnGptXsjL6地址上锁币999,100块高之后解锁

5. Gettokeninfo (查询token详细信息)

gettokeninfo "tokenAddress" )

Get token info.

Arguments(参数):
1. "tokenAddress" (string, optional) The token address.

Result(返回结果):
[ (json array) Token info array.
{
"tokenSymbol" (string) The token symbol.
"tokenName" (string) The token name.
"ownerAddress" (string) Creater's address.
"tokenAddress" (string) Token address.
"decimal" (numeric) The token fund amount decimal.
"totalSupply" (numeric) Total amount of the token.
}
]

Examples(实例):
> bitcoin-cli gettokeninfo "1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd"

cli cmd(cli命令):
./bitcoin-cli gettokeninfo mvycp4LXckLZ98atxj6SvMFSCoijG4d6yB


6. Gettokenbalance (查询token地址余额)

gettokenbalance "useraddress" )

Get token balance.

Arguments(参数):
1. "userAddress" (string, required) The target address.
2. "tokenAddress" (string, optional) The token contract address.

Result(返回结果):
[ (json array) Token balance array.
{
"tokenSymbol" (string) The token symbol.
"availableBalance" (numeric) Available balance.
"lockBalance:" (json array) Lock balance array.
[
{
"expiryHeight" (numeric) Expiry height.
"lockAmount" (numeric) Lock token amount.
}
]
}
]

Examples(实例):
> bitcoin-cli gettokenbalance "1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd"
> bitcoin-cli gettokenbalance "1LtvqCaApEdUGFkpKMM4MstjcaL4dKg8SP" "1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd"

cli cmd(cli命令):
./bitcoin-cli gettokenbalance n212T8EGcoRGSAD31aSfBWiKtnGptXsjL6 mvycp4LXckLZ98atxj6SvMFSCoijG4d6yB
本帖子中包含更多资源, 请登录查看,还没账号,立即免费注册
本主题由 等一轮残月 于 2019-03-02 17:47:47 审核通过
  • 正序
  • 最新
帖子暂无回复,回帖抢沙发
登录 账号发表你的看法,还没有账号?立即免费 注册