VOTING POWER100.00%
DOWNVOTE POWER100.00%
RESOURCE CREDITS100.00%
REPUTATION PROGRESS0.00%
Net Worth
46.376USD
HIVE
36.272HIVE
HBD
0.803HBD
Own HP
77.662HP
Detailed Balance
| HIVE | ||
| balance | 36.272HIVE | HIVE |
| market_balance | 0.000HIVE | HIVE |
| savings_balance | 0.000HIVE | HIVE |
| reward_hive_balance | 0.000HIVE | HIVE |
| HIVE POWER | ||
| Own HP | 77.662HP | HP |
| Delegated Out | 0.000HP | HP |
| Delegation In | 0.000HP | HP |
| Effective Power | 77.662HP | HP |
| Reward HP (pending) | 0.000HP | HP |
| HBD | ||
| hbd_balance | 0.803HBD | HBD |
| hbd_conversions | 0.000HBD | HBD |
| hbd_market_balance | 0.000HBD | HBD |
| savings_hbd_balance | 0.000HBD | HBD |
| reward_hbd_balance | 0.000HBD | HBD |
{
"balance": "36.272 HIVE",
"savings_balance": "0.000 HIVE",
"reward_hive_balance": "0.000 HIVE",
"vesting_shares": "126025.635732 VESTS",
"delegated_vesting_shares": "0.000000 VESTS",
"received_vesting_shares": "0.000000 VESTS",
"hbd_balance": "0.803 HBD",
"savings_hbd_balance": "0.000 HBD",
"reward_hbd_balance": "0.000 HBD"
}Account Info
| name | ankar |
| id | 131886 |
| rank | 0 |
| reputation | 0 |
| created | 2017-02-10T06:35:36 |
| recovery_account | steem |
| proxy | None |
| invited_by | null |
| post_count | 16 |
| comment_count | 0 |
| lifetime_vote_count | 0 |
| witnesses_voted_for | 0 |
| last_post | 2018-01-26T10:45:54 |
| last_root_post | 2018-01-26T10:45:54 |
| last_vote_time | 2018-01-26T10:45:54 |
| proxied_vsf_votes | 0, 0, 0, 0 |
| can_vote | 1 |
| voting_power | 9,800 |
| delayed_votes | None |
| governance_vote_expiration_ts | 1969-12-31T23:59:59 |
| balance | 36.272 HIVE |
| savings_balance | 0.000 HIVE |
| hbd_balance | 0.803 HBD |
| savings_hbd_balance | 0.000 HBD |
| vesting_shares | 126025.635732 VESTS |
| delegated_vesting_shares | 0.000000 VESTS |
| received_vesting_shares | 0.000000 VESTS |
| reward_vesting_balance | 0.000000 VESTS |
| vesting_balance | 0.000 HIVE |
| vesting_withdraw_rate | 0.000000 VESTS |
| next_vesting_withdrawal | 1969-12-31T23:59:59 |
| withdrawn | 0 |
| to_withdraw | 0 |
| withdraw_routes | 0 |
| savings_withdraw_requests | 0 |
| last_account_recovery | 1970-01-01T00:00:00 |
| reset_account | null |
| last_owner_update | 1970-01-01T00:00:00 |
| last_account_update | 2018-01-02T08:35:27 |
| mined | No |
| hbd_seconds | 0 |
| hbd_last_interest_payment | 2018-03-01T08:51:51 |
| savings_hbd_last_interest_payment | 1970-01-01T00:00:00 |
{
"active": {
"account_auths": [],
"key_auths": [
[
"STM78P9YGUT2Hi8xZd3Qo7UqpUJHsbqVWTJ7qPyQT5e2bC5m3CXT6",
1
]
],
"weight_threshold": 1
},
"balance": "36.272 HIVE",
"can_vote": true,
"comment_count": 0,
"created": "2017-02-10T06:35:36",
"curation_rewards": 1,
"delayed_votes": [],
"delegated_vesting_shares": "0.000000 VESTS",
"downvote_manabar": {
"current_mana": 0,
"last_update_time": 1486708533
},
"governance_vote_expiration_ts": "1969-12-31T23:59:59",
"guest_bloggers": [],
"hbd_balance": "0.803 HBD",
"hbd_last_interest_payment": "2018-03-01T08:51:51",
"hbd_seconds": "0",
"hbd_seconds_last_update": "2018-03-01T08:51:51",
"id": 131886,
"json_metadata": "{\"profile\":{\"profile_image\":\"https://i.imgur.com/aI2eaY6.jpg\",\"name\":\"Anderson\"}}",
"last_account_recovery": "1970-01-01T00:00:00",
"last_account_update": "2018-01-02T08:35:27",
"last_owner_update": "1970-01-01T00:00:00",
"last_post": "2018-01-26T10:45:54",
"last_root_post": "2018-01-26T10:45:54",
"last_vote_time": "2018-01-26T10:45:54",
"lifetime_vote_count": 0,
"market_history": [],
"memo_key": "STM5XEXcd4jih5gqUj98tcK5AfKjmFbMjytVMRVy7wdB1t2Q7x7ft",
"mined": false,
"name": "ankar",
"next_vesting_withdrawal": "1969-12-31T23:59:59",
"open_recurrent_transfers": 0,
"other_history": [],
"owner": {
"account_auths": [],
"key_auths": [
[
"STM67peFvhJTUKFv26sQ5bAM2vqhF1sCAd1vXfAudkEy32TZvzMzh",
1
]
],
"weight_threshold": 1
},
"pending_claimed_accounts": 0,
"pending_transfers": 0,
"post_bandwidth": 10000,
"post_count": 16,
"post_history": [],
"post_voting_power": "126025.635732 VESTS",
"posting": {
"account_auths": [],
"key_auths": [
[
"STM8GpX5u9ZLpHSqNXk2LCV7YDcnyaMJkWEraUurU9tHdmeEq5GQR",
1
]
],
"weight_threshold": 1
},
"posting_json_metadata": "{\"profile\":{\"profile_image\":\"https://i.imgur.com/aI2eaY6.jpg\",\"name\":\"Anderson\"}}",
"posting_rewards": 49030,
"previous_owner_update": "1970-01-01T00:00:00",
"proxied_vsf_votes": [
0,
0,
0,
0
],
"proxy": "",
"received_vesting_shares": "0.000000 VESTS",
"recovery_account": "steem",
"reputation": 0,
"reset_account": "null",
"reward_hbd_balance": "0.000 HBD",
"reward_hive_balance": "0.000 HIVE",
"reward_vesting_balance": "0.000000 VESTS",
"reward_vesting_hive": "0.000 HIVE",
"savings_balance": "0.000 HIVE",
"savings_hbd_balance": "0.000 HBD",
"savings_hbd_last_interest_payment": "1970-01-01T00:00:00",
"savings_hbd_seconds": "0",
"savings_hbd_seconds_last_update": "1970-01-01T00:00:00",
"savings_withdraw_requests": 0,
"tags_usage": [],
"to_withdraw": 0,
"transfer_history": [],
"vesting_balance": "0.000 HIVE",
"vesting_shares": "126025.635732 VESTS",
"vesting_withdraw_rate": "0.000000 VESTS",
"vote_history": [],
"voting_manabar": {
"current_mana": 9800,
"last_update_time": 1516963554
},
"voting_power": 9800,
"withdraw_routes": 0,
"withdrawn": 0,
"witness_votes": [],
"witnesses_voted_for": 0,
"rank": 0
}Withdraw Routes
| Incoming | Outgoing |
|---|---|
Empty | Empty |
{
"incoming": [],
"outgoing": []
}From Date
To Date
2023/01/31 18:13:00
2023/01/31 18:13:00
| to | ankar |
| from | earn.hive |
| memo | Did you know that you can get rewarded for your witness vote? Cast your witness vote on @earn.hive and start to receive HIVE tokens everyday. |
| amount | 0.001 HIVE |
| Transaction Info | Block #71905599/Trx 6d423368cf87d893d70d9fdb6a5b3ef7acd23f9a |
View Raw JSON Data
{
"op": [
"transfer",
{
"to": "ankar",
"from": "earn.hive",
"memo": "Did you know that you can get rewarded for your witness vote? Cast your witness vote on @earn.hive and start to receive HIVE tokens everyday.",
"amount": "0.001 HIVE"
}
],
"block": 71905599,
"trx_id": "6d423368cf87d893d70d9fdb6a5b3ef7acd23f9a",
"op_in_trx": 0,
"timestamp": "2023-01-31T18:13:00",
"virtual_op": false,
"trx_in_block": 16
}2020/04/05 00:21:21
2020/04/05 00:21:21
| to | ankar |
| from | engrave |
| memo | I've noticed you have a recovery account set to @steem, which is a security issue! Review your recovery account if you don't want to lose your tokens! Read more: https://peakd.com/witness-update/@engrave/review-your-recovery-account-if-you-dont-want-to-lose-your-assets |
| amount | 0.001 HIVE |
| Transaction Info | Block #42260511/Trx e8e8263bb928b7334e1dc73faf14de0dd6f91208 |
View Raw JSON Data
{
"op": [
"transfer",
{
"to": "ankar",
"from": "engrave",
"memo": "I've noticed you have a recovery account set to @steem, which is a security issue! Review your recovery account if you don't want to lose your tokens! Read more: https://peakd.com/witness-update/@engrave/review-your-recovery-account-if-you-dont-want-to-lose-your-assets",
"amount": "0.001 HIVE"
}
],
"block": 42260511,
"trx_id": "e8e8263bb928b7334e1dc73faf14de0dd6f91208",
"op_in_trx": 64,
"timestamp": "2020-04-05T00:21:21",
"virtual_op": false,
"trx_in_block": 0
}2020/02/10 07:13:54
2020/02/10 07:13:54
| body | Congratulations @ankar! You received a personal award! <table><tr><td>https://steemitimages.com/70x70/http://steemitboard.com/@ankar/birthday3.png</td><td>Happy Birthday! - You are on the Steem blockchain for 3 years!</td></tr></table> <sub>_You can view [your badges on your Steem Board](https://steemitboard.com/@ankar) and compare to others on the [Steem Ranking](https://steemitboard.com/ranking/index.php?name=ankar)_</sub> ###### [Vote for @Steemitboard as a witness](https://v2.steemconnect.com/sign/account-witness-vote?witness=steemitboard&approve=1) to get one more award and increased upvotes! |
| title | |
| author | steemitboard |
| permlink | steemitboard-notify-ankar-20200210t071351000z |
| json metadata | {"image":["https://steemitboard.com/img/notify.png"]} |
| parent author | ankar |
| parent permlink | ethereum-infura-web3-js |
| Transaction Info | Block #40690683/Trx a9a3ac68665a8497e304de379bdab68617737fa4 |
View Raw JSON Data
{
"op": [
"comment",
{
"body": "Congratulations @ankar! You received a personal award!\n\n<table><tr><td>https://steemitimages.com/70x70/http://steemitboard.com/@ankar/birthday3.png</td><td>Happy Birthday! - You are on the Steem blockchain for 3 years!</td></tr></table>\n\n<sub>_You can view [your badges on your Steem Board](https://steemitboard.com/@ankar) and compare to others on the [Steem Ranking](https://steemitboard.com/ranking/index.php?name=ankar)_</sub>\n\n\n###### [Vote for @Steemitboard as a witness](https://v2.steemconnect.com/sign/account-witness-vote?witness=steemitboard&approve=1) to get one more award and increased upvotes!",
"title": "",
"author": "steemitboard",
"permlink": "steemitboard-notify-ankar-20200210t071351000z",
"json_metadata": "{\"image\":[\"https://steemitboard.com/img/notify.png\"]}",
"parent_author": "ankar",
"parent_permlink": "ethereum-infura-web3-js"
}
],
"block": 40690683,
"trx_id": "a9a3ac68665a8497e304de379bdab68617737fa4",
"op_in_trx": 0,
"timestamp": "2020-02-10T07:13:54",
"virtual_op": false,
"trx_in_block": 10
}2019/02/10 07:48:21
2019/02/10 07:48:21
| body | Congratulations @ankar! You received a personal award! <table><tr><td>https://steemitimages.com/70x70/http://steemitboard.com/@ankar/birthday2.png</td><td>Happy Birthday! - You are on the Steem blockchain for 2 years!</td></tr></table> <sub>_[Click here to view your Board](https://steemitboard.com/@ankar)_</sub> > Support [SteemitBoard's project](https://steemit.com/@steemitboard)! **[Vote for its witness](https://v2.steemconnect.com/sign/account-witness-vote?witness=steemitboard&approve=1)** and **get one more award**! |
| title | |
| author | steemitboard |
| permlink | steemitboard-notify-ankar-20190210t074817000z |
| json metadata | {"image":["https://steemitboard.com/img/notify.png"]} |
| parent author | ankar |
| parent permlink | ethereum-infura-web3-js |
| Transaction Info | Block #30219426/Trx 80596335e1878f0bd097d779cb939045c3d3829c |
View Raw JSON Data
{
"op": [
"comment",
{
"body": "Congratulations @ankar! You received a personal award!\n\n<table><tr><td>https://steemitimages.com/70x70/http://steemitboard.com/@ankar/birthday2.png</td><td>Happy Birthday! - You are on the Steem blockchain for 2 years!</td></tr></table>\n\n<sub>_[Click here to view your Board](https://steemitboard.com/@ankar)_</sub>\n\n\n> Support [SteemitBoard's project](https://steemit.com/@steemitboard)! **[Vote for its witness](https://v2.steemconnect.com/sign/account-witness-vote?witness=steemitboard&approve=1)** and **get one more award**!",
"title": "",
"author": "steemitboard",
"permlink": "steemitboard-notify-ankar-20190210t074817000z",
"json_metadata": "{\"image\":[\"https://steemitboard.com/img/notify.png\"]}",
"parent_author": "ankar",
"parent_permlink": "ethereum-infura-web3-js"
}
],
"block": 30219426,
"trx_id": "80596335e1878f0bd097d779cb939045c3d3829c",
"op_in_trx": 0,
"timestamp": "2019-02-10T07:48:21",
"virtual_op": false,
"trx_in_block": 2
}2018/04/15 09:41:39
2018/04/15 09:41:39
| body | 区块链开发、以太坊开发的技术资料资源汇总 一个适合区块链新手的以太坊DApp开发教程: http://xc.hubwiz.com/course/5a952991adb3847553d205d1?affid=20180415steemit 一个用区块链、星际文件系统(IPFS)、Node.js和MongoDB来构建电商平台: http://xc.hubwiz.com/course/5abbb7acc02e6b6a59171dd6/?affid=20180415steemit |
| title | |
| author | jimi2018 |
| permlink | re-ankar-ethereum-remix-20180415t094410128z |
| json metadata | {"tags":["cn"],"links":["http://xc.hubwiz.com/course/5a952991adb3847553d205d1?affid=20180415steemit","http://xc.hubwiz.com/course/5abbb7acc02e6b6a59171dd6/?affid=20180415steemit"],"app":"steemit/0.1"} |
| parent author | ankar |
| parent permlink | ethereum-remix |
| Transaction Info | Block #21585149/Trx c2b65960f594c48ed86cceb4e0f6bc00fd845a8d |
View Raw JSON Data
{
"op": [
"comment",
{
"body": "区块链开发、以太坊开发的技术资料资源汇总\n\n一个适合区块链新手的以太坊DApp开发教程:\nhttp://xc.hubwiz.com/course/5a952991adb3847553d205d1?affid=20180415steemit\n\n一个用区块链、星际文件系统(IPFS)、Node.js和MongoDB来构建电商平台:\nhttp://xc.hubwiz.com/course/5abbb7acc02e6b6a59171dd6/?affid=20180415steemit",
"title": "",
"author": "jimi2018",
"permlink": "re-ankar-ethereum-remix-20180415t094410128z",
"json_metadata": "{\"tags\":[\"cn\"],\"links\":[\"http://xc.hubwiz.com/course/5a952991adb3847553d205d1?affid=20180415steemit\",\"http://xc.hubwiz.com/course/5abbb7acc02e6b6a59171dd6/?affid=20180415steemit\"],\"app\":\"steemit/0.1\"}",
"parent_author": "ankar",
"parent_permlink": "ethereum-remix"
}
],
"block": 21585149,
"trx_id": "c2b65960f594c48ed86cceb4e0f6bc00fd845a8d",
"op_in_trx": 0,
"timestamp": "2018-04-15T09:41:39",
"virtual_op": false,
"trx_in_block": 27
}2018/04/13 09:49:24
2018/04/13 09:49:24
| body | 6666.......主要是為了更新合約嗎? |
| title | |
| author | pupujiang |
| permlink | re-ankar-ethereum-infura-web3-js-20180413t094922090z |
| json metadata | {"tags":["cn"],"app":"steemit/0.1"} |
| parent author | ankar |
| parent permlink | ethereum-infura-web3-js |
| Transaction Info | Block #21527718/Trx d255e8b89ff382ff84e45a18d4776e94b9f74f32 |
View Raw JSON Data
{
"op": [
"comment",
{
"body": "6666.......主要是為了更新合約嗎?",
"title": "",
"author": "pupujiang",
"permlink": "re-ankar-ethereum-infura-web3-js-20180413t094922090z",
"json_metadata": "{\"tags\":[\"cn\"],\"app\":\"steemit/0.1\"}",
"parent_author": "ankar",
"parent_permlink": "ethereum-infura-web3-js"
}
],
"block": 21527718,
"trx_id": "d255e8b89ff382ff84e45a18d4776e94b9f74f32",
"op_in_trx": 0,
"timestamp": "2018-04-13T09:49:24",
"virtual_op": false,
"trx_in_block": 47
}pupujiangupvoted (100.00%) @ankar / ethereum-infura-web3-js2018/04/13 09:49:00
pupujiangupvoted (100.00%) @ankar / ethereum-infura-web3-js
2018/04/13 09:49:00
| voter | pupujiang |
| author | ankar |
| weight | 10000 (100.00%) |
| permlink | ethereum-infura-web3-js |
| Transaction Info | Block #21527710/Trx 85c39d9865ce870fd4dc0eb044ea99804bebd36d |
View Raw JSON Data
{
"op": [
"vote",
{
"voter": "pupujiang",
"author": "ankar",
"weight": 10000,
"permlink": "ethereum-infura-web3-js"
}
],
"block": 21527710,
"trx_id": "85c39d9865ce870fd4dc0eb044ea99804bebd36d",
"op_in_trx": 0,
"timestamp": "2018-04-13T09:49:00",
"virtual_op": false,
"trx_in_block": 62
}2018/03/22 04:48:03
2018/03/22 04:48:03
| id | follow |
| json | ["follow",{"follower":"ankar","following":"gaoduzhu","what":["blog"]}] |
| required auths | [] |
| required posting auths | ["ankar"] |
| Transaction Info | Block #20888568/Trx 4baa459680a7eb68d614873f3095312195417850 |
View Raw JSON Data
{
"op": [
"custom_json",
{
"id": "follow",
"json": "[\"follow\",{\"follower\":\"ankar\",\"following\":\"gaoduzhu\",\"what\":[\"blog\"]}]",
"required_auths": [],
"required_posting_auths": [
"ankar"
]
}
],
"block": 20888568,
"trx_id": "4baa459680a7eb68d614873f3095312195417850",
"op_in_trx": 0,
"timestamp": "2018-03-22T04:48:03",
"virtual_op": false,
"trx_in_block": 36
}2018/03/20 04:40:54
2018/03/20 04:40:54
| voter | ankar |
| author | gaoduzhu |
| weight | 10000 (100.00%) |
| permlink | status |
| Transaction Info | Block #20831297/Trx 380a838e6c74d303bc8cc2f6b9d932f08948b71c |
View Raw JSON Data
{
"op": [
"vote",
{
"voter": "ankar",
"author": "gaoduzhu",
"weight": 10000,
"permlink": "status"
}
],
"block": 20831297,
"trx_id": "380a838e6c74d303bc8cc2f6b9d932f08948b71c",
"op_in_trx": 0,
"timestamp": "2018-03-20T04:40:54",
"virtual_op": false,
"trx_in_block": 24
}ankarclaimed reward balance: 0.055 HBD, 0.016 HP2018/03/01 08:51:54
ankarclaimed reward balance: 0.055 HBD, 0.016 HP
2018/03/01 08:51:54
| account | ankar |
| reward hbd | 0.055 HBD |
| reward hive | 0.000 HIVE |
| reward vests | 26.601435 VESTS |
| Transaction Info | Block #20289657/Trx 39a000f09f980986f350f583562947eb37f2eaa5 |
View Raw JSON Data
{
"op": [
"claim_reward_balance",
{
"account": "ankar",
"reward_hbd": "0.055 HBD",
"reward_hive": "0.000 HIVE",
"reward_vests": "26.601435 VESTS"
}
],
"block": 20289657,
"trx_id": "39a000f09f980986f350f583562947eb37f2eaa5",
"op_in_trx": 0,
"timestamp": "2018-03-01T08:51:54",
"virtual_op": false,
"trx_in_block": 9
}2018/02/18 22:33:45
2018/02/18 22:33:45
| body | Thanks need to know this. |
| title | |
| author | g0t4y |
| permlink | re-ankar-buy-steem-with-bitcoin-on-steemit-com-step-by-step-20180218t223338882z |
| json metadata | {"tags":["steem"],"app":"steemit/0.1"} |
| parent author | ankar |
| parent permlink | buy-steem-with-bitcoin-on-steemit-com-step-by-step |
| Transaction Info | Block #19989537/Trx 2b5a02e3c36917fbec6a0cefcc158bcdc3f2e40e |
View Raw JSON Data
{
"op": [
"comment",
{
"body": "Thanks need to know this.",
"title": "",
"author": "g0t4y",
"permlink": "re-ankar-buy-steem-with-bitcoin-on-steemit-com-step-by-step-20180218t223338882z",
"json_metadata": "{\"tags\":[\"steem\"],\"app\":\"steemit/0.1\"}",
"parent_author": "ankar",
"parent_permlink": "buy-steem-with-bitcoin-on-steemit-com-step-by-step"
}
],
"block": 19989537,
"trx_id": "2b5a02e3c36917fbec6a0cefcc158bcdc3f2e40e",
"op_in_trx": 0,
"timestamp": "2018-02-18T22:33:45",
"virtual_op": false,
"trx_in_block": 63
}2018/02/10 07:11:24
2018/02/10 07:11:24
| body | Congratulations @ankar! You have received a personal award! [](http://steemitboard.com/@ankar) 1 Year on Steemit Click on the badge to view your own Board of Honor on SteemitBoard. > By upvoting this notification, you can help all Steemit users. Learn how [here](https://steemit.com/steemitboard/@steemitboard/http-i-cubeupload-com-7ciqeo-png)! |
| title | |
| author | steemitboard |
| permlink | steemitboard-notify-ankar-20180210t071120000z |
| json metadata | {"image":["https://steemitboard.com/img/notifications.png"]} |
| parent author | ankar |
| parent permlink | ethereum-infura-web3-js |
| Transaction Info | Block #19740878/Trx 5a2f30e630a67dc7878bf4f70128d02dec3bf032 |
View Raw JSON Data
{
"op": [
"comment",
{
"body": "Congratulations @ankar! You have received a personal award!\n\n[](http://steemitboard.com/@ankar) 1 Year on Steemit\nClick on the badge to view your own Board of Honor on SteemitBoard.\n\n> By upvoting this notification, you can help all Steemit users. Learn how [here](https://steemit.com/steemitboard/@steemitboard/http-i-cubeupload-com-7ciqeo-png)!",
"title": "",
"author": "steemitboard",
"permlink": "steemitboard-notify-ankar-20180210t071120000z",
"json_metadata": "{\"image\":[\"https://steemitboard.com/img/notifications.png\"]}",
"parent_author": "ankar",
"parent_permlink": "ethereum-infura-web3-js"
}
],
"block": 19740878,
"trx_id": "5a2f30e630a67dc7878bf4f70128d02dec3bf032",
"op_in_trx": 0,
"timestamp": "2018-02-10T07:11:24",
"virtual_op": false,
"trx_in_block": 13
}2018/02/05 07:36:45
2018/02/05 07:36:45
| voter | ankar |
| author | dan |
| weight | 10000 (100.00%) |
| permlink | eos-io-developer-update-support-for-apple-s-secure-enclave-and-similar-technologies |
| Transaction Info | Block #19597683/Trx 334372c89f60019bbff5db68a21c57989dba118d |
View Raw JSON Data
{
"op": [
"vote",
{
"voter": "ankar",
"author": "dan",
"weight": 10000,
"permlink": "eos-io-developer-update-support-for-apple-s-secure-enclave-and-similar-technologies"
}
],
"block": 19597683,
"trx_id": "334372c89f60019bbff5db68a21c57989dba118d",
"op_in_trx": 0,
"timestamp": "2018-02-05T07:36:45",
"virtual_op": false,
"trx_in_block": 22
}ankarupdated payout for ethereum-infura-web3-js2018/02/02 10:45:54
ankarupdated payout for ethereum-infura-web3-js
2018/02/02 10:45:54
| author | ankar |
| permlink | ethereum-infura-web3-js |
| Transaction Info | Block #19515231/Virtual Operation 4294967295:20 |
View Raw JSON Data
{
"op": [
"comment_payout_update",
{
"author": "ankar",
"permlink": "ethereum-infura-web3-js"
}
],
"block": 19515231,
"trx_id": "0000000000000000000000000000000000000000",
"op_in_trx": 20,
"timestamp": "2018-02-02T10:45:54",
"virtual_op": true,
"trx_in_block": 4294967295
}ankarreceived 0.034 HBD reward share for ethereum-infura-web3-js2018/02/02 10:45:54
ankarreceived 0.034 HBD reward share for ethereum-infura-web3-js
2018/02/02 10:45:54
| author | ankar |
| payout | 0.034 HBD |
| permlink | ethereum-infura-web3-js |
| author rewards | 7 |
| total payout value | 0.033 HBD |
| curator payout value | 0.000 HBD |
| beneficiary payout value | 0.000 HBD |
| Transaction Info | Block #19515231/Virtual Operation 4294967295:19 |
View Raw JSON Data
{
"op": [
"comment_reward",
{
"author": "ankar",
"payout": "0.034 HBD",
"permlink": "ethereum-infura-web3-js",
"author_rewards": 7,
"total_payout_value": "0.033 HBD",
"curator_payout_value": "0.000 HBD",
"beneficiary_payout_value": "0.000 HBD"
}
],
"block": 19515231,
"trx_id": "0000000000000000000000000000000000000000",
"op_in_trx": 19,
"timestamp": "2018-02-02T10:45:54",
"virtual_op": true,
"trx_in_block": 4294967295
}ankarreceived 0.014 HBD, 0.005 HP author reward for @ankar / ethereum-infura-web3-js2018/02/02 10:45:54
ankarreceived 0.014 HBD, 0.005 HP author reward for @ankar / ethereum-infura-web3-js
2018/02/02 10:45:54
| author | ankar |
| permlink | ethereum-infura-web3-js |
| hbd payout | 0.014 HBD |
| hive payout | 0.000 HIVE |
| vesting payout | 8.183509 VESTS |
| payout must be claimed | true |
| curators vesting payout | 0.000000 VESTS |
| Transaction Info | Block #19515231/Virtual Operation 4294967295:18 |
View Raw JSON Data
{
"op": [
"author_reward",
{
"author": "ankar",
"permlink": "ethereum-infura-web3-js",
"hbd_payout": "0.014 HBD",
"hive_payout": "0.000 HIVE",
"vesting_payout": "8.183509 VESTS",
"payout_must_be_claimed": true,
"curators_vesting_payout": "0.000000 VESTS"
}
],
"block": 19515231,
"trx_id": "0000000000000000000000000000000000000000",
"op_in_trx": 18,
"timestamp": "2018-02-02T10:45:54",
"virtual_op": true,
"trx_in_block": 4294967295
}ankarupdated payout for decentraland2018/01/31 02:47:42
ankarupdated payout for decentraland
2018/01/31 02:47:42
| author | ankar |
| permlink | decentraland |
| Transaction Info | Block #19448157/Virtual Operation 4294967295:7 |
View Raw JSON Data
{
"op": [
"comment_payout_update",
{
"author": "ankar",
"permlink": "decentraland"
}
],
"block": 19448157,
"trx_id": "0000000000000000000000000000000000000000",
"op_in_trx": 7,
"timestamp": "2018-01-31T02:47:42",
"virtual_op": true,
"trx_in_block": 4294967295
}ankarreceived 0.057 HBD reward share for decentraland2018/01/31 02:47:42
ankarreceived 0.057 HBD reward share for decentraland
2018/01/31 02:47:42
| author | ankar |
| payout | 0.057 HBD |
| permlink | decentraland |
| author rewards | 10 |
| total payout value | 0.056 HBD |
| curator payout value | 0.000 HBD |
| beneficiary payout value | 0.000 HBD |
| Transaction Info | Block #19448157/Virtual Operation 4294967295:6 |
View Raw JSON Data
{
"op": [
"comment_reward",
{
"author": "ankar",
"payout": "0.057 HBD",
"permlink": "decentraland",
"author_rewards": 10,
"total_payout_value": "0.056 HBD",
"curator_payout_value": "0.000 HBD",
"beneficiary_payout_value": "0.000 HBD"
}
],
"block": 19448157,
"trx_id": "0000000000000000000000000000000000000000",
"op_in_trx": 6,
"timestamp": "2018-01-31T02:47:42",
"virtual_op": true,
"trx_in_block": 4294967295
}ankarreceived 0.028 HBD, 0.006 HP author reward for @ankar / decentraland2018/01/31 02:47:42
ankarreceived 0.028 HBD, 0.006 HP author reward for @ankar / decentraland
2018/01/31 02:47:42
| author | ankar |
| permlink | decentraland |
| hbd payout | 0.028 HBD |
| hive payout | 0.000 HIVE |
| vesting payout | 10.230617 VESTS |
| payout must be claimed | true |
| curators vesting payout | 0.000000 VESTS |
| Transaction Info | Block #19448157/Virtual Operation 4294967295:5 |
View Raw JSON Data
{
"op": [
"author_reward",
{
"author": "ankar",
"permlink": "decentraland",
"hbd_payout": "0.028 HBD",
"hive_payout": "0.000 HIVE",
"vesting_payout": "10.230617 VESTS",
"payout_must_be_claimed": true,
"curators_vesting_payout": "0.000000 VESTS"
}
],
"block": 19448157,
"trx_id": "0000000000000000000000000000000000000000",
"op_in_trx": 5,
"timestamp": "2018-01-31T02:47:42",
"virtual_op": true,
"trx_in_block": 4294967295
}ankarpublished a new post: ethereum-infura-web3-js2018/01/29 03:57:45
ankarpublished a new post: ethereum-infura-web3-js
2018/01/29 03:57:45
| body | @@ -5311,103 +5311,16 @@ dTx. -function function function toString() %7B %5Bnative code%5D %7D() %7B %5Bnative code%5D %7D() %7B %5Bnative code%5D %7D +toString ('he @@ -5462,16 +5462,29 @@ %7D);%0A%0A +#### Result%0A%0A %E6%88%90%E5%8A%9F%E5%B0%B1%E6%9C%83%E5%9B%9E%E5%82%B3%E4%B8%80%E5%80%8B |
| title | 【Ethereum 智能合約開發筆記】不用自己跑節點,使用 Infura 和 web3.js 呼叫合約 |
| author | ankar |
| permlink | ethereum-infura-web3-js |
| json metadata | {"tags":["cn","blockchain","ethereum","infura","web3"],"image":["https://i.imgur.com/doEO8gu.jpg","https://i.imgur.com/yz9kOFo.png","https://i.imgur.com/vVx5L4A.png","https://i.imgur.com/YRtWIGr.png","https://i.imgur.com/RdDK54y.png"],"links":["https://infura.io/signup","https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_sendtransaction","https://github.com/ethereum/wiki/wiki/JavaScript-API#web3versionapi","https://medium.com/taipei-ethereum-meetup/%E4%BD%BF%E7%94%A8ethereum-browser%E8%A8%88%E7%AE%97gas-cost-9122950a04f7","https://medium.com/@twedusuck/%E5%9C%A8%E5%8D%80%E5%A1%8A%E9%8F%88%E4%B8%8A%E5%BB%BA%E7%AB%8B%E5%8F%AF%E6%9B%B4%E6%96%B0%E7%9A%84%E6%99%BA%E6%85%A7%E5%90%88%E7%B4%84-cbe015bdb339","https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_gettransactioncount","https://github.com/ethereum/wiki/wiki/JavaScript-API"],"app":"steemit/0.1","format":"markdown"} |
| parent author | |
| parent permlink | cn |
| Transaction Info | Block #19392015/Trx 208b8ba0e64e787f156288bf76ed99fc0704741e |
View Raw JSON Data
{
"op": [
"comment",
{
"body": "@@ -5311,103 +5311,16 @@\n dTx.\n-function function function toString() %7B %5Bnative code%5D %7D() %7B %5Bnative code%5D %7D() %7B %5Bnative code%5D %7D\n+toString\n ('he\n@@ -5462,16 +5462,29 @@\n %7D);%0A%0A\n+#### Result%0A%0A\n %E6%88%90%E5%8A%9F%E5%B0%B1%E6%9C%83%E5%9B%9E%E5%82%B3%E4%B8%80%E5%80%8B\n",
"title": "【Ethereum 智能合約開發筆記】不用自己跑節點,使用 Infura 和 web3.js 呼叫合約",
"author": "ankar",
"permlink": "ethereum-infura-web3-js",
"json_metadata": "{\"tags\":[\"cn\",\"blockchain\",\"ethereum\",\"infura\",\"web3\"],\"image\":[\"https://i.imgur.com/doEO8gu.jpg\",\"https://i.imgur.com/yz9kOFo.png\",\"https://i.imgur.com/vVx5L4A.png\",\"https://i.imgur.com/YRtWIGr.png\",\"https://i.imgur.com/RdDK54y.png\"],\"links\":[\"https://infura.io/signup\",\"https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_sendtransaction\",\"https://github.com/ethereum/wiki/wiki/JavaScript-API#web3versionapi\",\"https://medium.com/taipei-ethereum-meetup/%E4%BD%BF%E7%94%A8ethereum-browser%E8%A8%88%E7%AE%97gas-cost-9122950a04f7\",\"https://medium.com/@twedusuck/%E5%9C%A8%E5%8D%80%E5%A1%8A%E9%8F%88%E4%B8%8A%E5%BB%BA%E7%AB%8B%E5%8F%AF%E6%9B%B4%E6%96%B0%E7%9A%84%E6%99%BA%E6%85%A7%E5%90%88%E7%B4%84-cbe015bdb339\",\"https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_gettransactioncount\",\"https://github.com/ethereum/wiki/wiki/JavaScript-API\"],\"app\":\"steemit/0.1\",\"format\":\"markdown\"}",
"parent_author": "",
"parent_permlink": "cn"
}
],
"block": 19392015,
"trx_id": "208b8ba0e64e787f156288bf76ed99fc0704741e",
"op_in_trx": 0,
"timestamp": "2018-01-29T03:57:45",
"virtual_op": false,
"trx_in_block": 12
}coin.infoeffective vote applied for @ankar / ethereum-infura-web3-js2018/01/26 12:15:48
coin.infoeffective vote applied for @ankar / ethereum-infura-web3-js
2018/01/26 12:15:48
| voter | coin.info |
| author | ankar |
| weight | 1095 (10.95%) |
| rshares | 143575508 |
| permlink | ethereum-infura-web3-js |
| pending payout | 0.040 HBD |
| total vote weight | 63305 |
| Transaction Info | Block #19315620/Trx 01e86d56e60ac8893e8d4152767ec63f3ce2e938 |
View Raw JSON Data
{
"op": [
"effective_comment_vote",
{
"voter": "coin.info",
"author": "ankar",
"weight": 1095,
"rshares": 143575508,
"permlink": "ethereum-infura-web3-js",
"pending_payout": "0.040 HBD",
"total_vote_weight": 63305
}
],
"block": 19315620,
"trx_id": "01e86d56e60ac8893e8d4152767ec63f3ce2e938",
"op_in_trx": 1,
"timestamp": "2018-01-26T12:15:48",
"virtual_op": true,
"trx_in_block": 26
}coin.infoupvoted (6.94%) @ankar / ethereum-infura-web3-js2018/01/26 12:15:48
coin.infoupvoted (6.94%) @ankar / ethereum-infura-web3-js
2018/01/26 12:15:48
| voter | coin.info |
| author | ankar |
| weight | 694 (6.94%) |
| permlink | ethereum-infura-web3-js |
| Transaction Info | Block #19315620/Trx 01e86d56e60ac8893e8d4152767ec63f3ce2e938 |
View Raw JSON Data
{
"op": [
"vote",
{
"voter": "coin.info",
"author": "ankar",
"weight": 694,
"permlink": "ethereum-infura-web3-js"
}
],
"block": 19315620,
"trx_id": "01e86d56e60ac8893e8d4152767ec63f3ce2e938",
"op_in_trx": 0,
"timestamp": "2018-01-26T12:15:48",
"virtual_op": false,
"trx_in_block": 26
}2018/01/26 12:15:45
2018/01/26 12:15:45
| body | **Coins mentioned in post:** Coin | | Price (USD) | 📉 24h | 📈 7d - | - | - | - | - **AE** | Aeternity | 2.179$ | _4.49%_ | _41.71%_ **EOS** | EOS | 13.420$ | _-4.43%_ | _21.64%_ **ETH** | Ethereum | 1014.840$ | _-4.38%_ | _-4.61%_ **ZRX** | 0x | 1.567$ | _-3.62%_ | _-11.2%_ |
| title | |
| author | coin.info |
| permlink | re-ankar-ethereum-infura-web3-js-20180126t121542019z |
| json metadata | {"app":"coininfo/1.0.0","format":"markdown"} |
| parent author | ankar |
| parent permlink | ethereum-infura-web3-js |
| Transaction Info | Block #19315619/Trx a2add390a8944f97c427e398f7809afe69e58bf4 |
View Raw JSON Data
{
"op": [
"comment",
{
"body": "**Coins mentioned in post:**\n\nCoin | | Price (USD) | 📉 24h | 📈 7d\n- | - | - | - | -\n**AE** | Aeternity | 2.179$ | _4.49%_ | _41.71%_\n**EOS** | EOS | 13.420$ | _-4.43%_ | _21.64%_\n**ETH** | Ethereum | 1014.840$ | _-4.38%_ | _-4.61%_\n**ZRX** | 0x | 1.567$ | _-3.62%_ | _-11.2%_",
"title": "",
"author": "coin.info",
"permlink": "re-ankar-ethereum-infura-web3-js-20180126t121542019z",
"json_metadata": "{\"app\":\"coininfo/1.0.0\",\"format\":\"markdown\"}",
"parent_author": "ankar",
"parent_permlink": "ethereum-infura-web3-js"
}
],
"block": 19315619,
"trx_id": "a2add390a8944f97c427e398f7809afe69e58bf4",
"op_in_trx": 0,
"timestamp": "2018-01-26T12:15:45",
"virtual_op": false,
"trx_in_block": 12
}xiaoshancuneffective vote applied for @ankar / ethereum-infura-web3-js2018/01/26 11:52:27
xiaoshancuneffective vote applied for @ankar / ethereum-infura-web3-js
2018/01/26 11:52:27
| voter | xiaoshancun |
| author | ankar |
| weight | 2397 (23.97%) |
| rshares | 314151102 |
| permlink | ethereum-infura-web3-js |
| pending payout | 0.039 HBD |
| total vote weight | 62210 |
| Transaction Info | Block #19315154/Trx cb184b9711216eafea6033afd3197548687b5199 |
View Raw JSON Data
{
"op": [
"effective_comment_vote",
{
"voter": "xiaoshancun",
"author": "ankar",
"weight": 2397,
"rshares": 314151102,
"permlink": "ethereum-infura-web3-js",
"pending_payout": "0.039 HBD",
"total_vote_weight": 62210
}
],
"block": 19315154,
"trx_id": "cb184b9711216eafea6033afd3197548687b5199",
"op_in_trx": 1,
"timestamp": "2018-01-26T11:52:27",
"virtual_op": true,
"trx_in_block": 30
}xiaoshancunupvoted (100.00%) @ankar / ethereum-infura-web3-js2018/01/26 11:52:27
xiaoshancunupvoted (100.00%) @ankar / ethereum-infura-web3-js
2018/01/26 11:52:27
| voter | xiaoshancun |
| author | ankar |
| weight | 10000 (100.00%) |
| permlink | ethereum-infura-web3-js |
| Transaction Info | Block #19315154/Trx cb184b9711216eafea6033afd3197548687b5199 |
View Raw JSON Data
{
"op": [
"vote",
{
"voter": "xiaoshancun",
"author": "ankar",
"weight": 10000,
"permlink": "ethereum-infura-web3-js"
}
],
"block": 19315154,
"trx_id": "cb184b9711216eafea6033afd3197548687b5199",
"op_in_trx": 0,
"timestamp": "2018-01-26T11:52:27",
"virtual_op": false,
"trx_in_block": 30
}ankarupvoted (100.00%) @ankar / ethereum-remix2018/01/26 10:46:57
ankarupvoted (100.00%) @ankar / ethereum-remix
2018/01/26 10:46:57
| voter | ankar |
| author | ankar |
| weight | 10000 (100.00%) |
| permlink | ethereum-remix |
| Transaction Info | Block #19313847/Trx b6fbc0866a5c69cd00d4944362997d47433b3418 |
View Raw JSON Data
{
"op": [
"vote",
{
"voter": "ankar",
"author": "ankar",
"weight": 10000,
"permlink": "ethereum-remix"
}
],
"block": 19313847,
"trx_id": "b6fbc0866a5c69cd00d4944362997d47433b3418",
"op_in_trx": 0,
"timestamp": "2018-01-26T10:46:57",
"virtual_op": false,
"trx_in_block": 41
}cn-naughty.boyreplied to @ankar / 20180126t104551219z-post2018/01/26 10:46:21
cn-naughty.boyreplied to @ankar / 20180126t104551219z-post
2018/01/26 10:46:21
| body | @ankar, 帅呆了! |
| title | |
| author | cn-naughty.boy |
| permlink | 20180126t104551219z-post |
| json metadata | {"tags":["cn"]} |
| parent author | ankar |
| parent permlink | ethereum-infura-web3-js |
| Transaction Info | Block #19313835/Trx dba5bbc1aeec1b5c2dc782b0b2fef5b3dc69e7d4 |
View Raw JSON Data
{
"op": [
"comment",
{
"body": "@ankar, 帅呆了!",
"title": "",
"author": "cn-naughty.boy",
"permlink": "20180126t104551219z-post",
"json_metadata": "{\"tags\":[\"cn\"]}",
"parent_author": "ankar",
"parent_permlink": "ethereum-infura-web3-js"
}
],
"block": 19313835,
"trx_id": "dba5bbc1aeec1b5c2dc782b0b2fef5b3dc69e7d4",
"op_in_trx": 0,
"timestamp": "2018-01-26T10:46:21",
"virtual_op": false,
"trx_in_block": 38
}cn-naughty.boyeffective vote applied for @ankar / ethereum-infura-web3-js2018/01/26 10:46:18
cn-naughty.boyeffective vote applied for @ankar / ethereum-infura-web3-js
2018/01/26 10:46:18
| voter | cn-naughty.boy |
| author | ankar |
| weight | 91 (0.91%) |
| rshares | 1024924445 |
| permlink | ethereum-infura-web3-js |
| pending payout | 0.035 HBD |
| total vote weight | 59813 |
| Transaction Info | Block #19313834/Trx faec64cab2f466256c0ab33db51408a2cc7458c0 |
View Raw JSON Data
{
"op": [
"effective_comment_vote",
{
"voter": "cn-naughty.boy",
"author": "ankar",
"weight": 91,
"rshares": 1024924445,
"permlink": "ethereum-infura-web3-js",
"pending_payout": "0.035 HBD",
"total_vote_weight": 59813
}
],
"block": 19313834,
"trx_id": "faec64cab2f466256c0ab33db51408a2cc7458c0",
"op_in_trx": 1,
"timestamp": "2018-01-26T10:46:18",
"virtual_op": true,
"trx_in_block": 43
}cn-naughty.boyupvoted (5.79%) @ankar / ethereum-infura-web3-js2018/01/26 10:46:18
cn-naughty.boyupvoted (5.79%) @ankar / ethereum-infura-web3-js
2018/01/26 10:46:18
| voter | cn-naughty.boy |
| author | ankar |
| weight | 579 (5.79%) |
| permlink | ethereum-infura-web3-js |
| Transaction Info | Block #19313834/Trx faec64cab2f466256c0ab33db51408a2cc7458c0 |
View Raw JSON Data
{
"op": [
"vote",
{
"voter": "cn-naughty.boy",
"author": "ankar",
"weight": 579,
"permlink": "ethereum-infura-web3-js"
}
],
"block": 19313834,
"trx_id": "faec64cab2f466256c0ab33db51408a2cc7458c0",
"op_in_trx": 0,
"timestamp": "2018-01-26T10:46:18",
"virtual_op": false,
"trx_in_block": 43
}ankareffective vote applied for @ankar / ethereum-infura-web3-js2018/01/26 10:45:57
ankareffective vote applied for @ankar / ethereum-infura-web3-js
2018/01/26 10:45:57
| voter | ankar |
| author | ankar |
| weight | 0 (0.00%) |
| rshares | 2519980685 |
| permlink | ethereum-infura-web3-js |
| pending payout | 0.025 HBD |
| total vote weight | 51993 |
| Transaction Info | Block #19313827/Trx 6c84acbcfa90885767424cb74be326f9cd3ee2e6 |
View Raw JSON Data
{
"op": [
"effective_comment_vote",
{
"voter": "ankar",
"author": "ankar",
"weight": 0,
"rshares": 2519980685,
"permlink": "ethereum-infura-web3-js",
"pending_payout": "0.025 HBD",
"total_vote_weight": 51993
}
],
"block": 19313827,
"trx_id": "6c84acbcfa90885767424cb74be326f9cd3ee2e6",
"op_in_trx": 2,
"timestamp": "2018-01-26T10:45:57",
"virtual_op": true,
"trx_in_block": 15
}ankarupvoted (100.00%) @ankar / ethereum-infura-web3-js2018/01/26 10:45:57
ankarupvoted (100.00%) @ankar / ethereum-infura-web3-js
2018/01/26 10:45:57
| voter | ankar |
| author | ankar |
| weight | 10000 (100.00%) |
| permlink | ethereum-infura-web3-js |
| Transaction Info | Block #19313827/Trx 6c84acbcfa90885767424cb74be326f9cd3ee2e6 |
View Raw JSON Data
{
"op": [
"vote",
{
"voter": "ankar",
"author": "ankar",
"weight": 10000,
"permlink": "ethereum-infura-web3-js"
}
],
"block": 19313827,
"trx_id": "6c84acbcfa90885767424cb74be326f9cd3ee2e6",
"op_in_trx": 1,
"timestamp": "2018-01-26T10:45:57",
"virtual_op": false,
"trx_in_block": 15
}ankarpublished a new post: ethereum-infura-web3-js2018/01/26 10:45:57
ankarpublished a new post: ethereum-infura-web3-js
2018/01/26 10:45:57
| body |  > Infura 提供公開的 Ethereum 主網和測試網路節點。到 [Infura 官網申請](https://infura.io/signup),只要輸入一點基本資料和 Email,就可以收到 API-key。  --- ## 使用 RPC 查詢合約內儲存的狀態 最常需要查詢的狀態就是 Token 的餘額啦。我就用 EOS 代幣合約最為範例試看看。 ### 取得合約資訊 可以透過 Etherscan,大部分知名的合約可以直接搜尋到。  要呼叫合約,至少需要: - **合約地址**,例如 0x86Fa049857E0209aa7D9e616F7eb3b3B78ECfdb0 - **要呼叫的 function signature**,例如以 ERC 20 代幣合約來說,查詢餘額要呼叫的 function 是 `balanceOf(address)`,其對應的 function signature 是 `70a08231`。 如何取得 function signature 呢?以 `balanceOf(address)` 為例: 1. 把 `balanceOf(address)` 經過 sha3 0x70a08231b98ef4ca268c9cc3f6b4590e4bfec28280db06bb5d45e689f2a360be 2. 取除了 `0x` 外,前面的 8 位 70a08231 以上流程可以用任何工具完成,以 web3.js 為例: var functionSig = we3.sha3("balanceOf(address)").substr(2,8) 另外也可以把 contract code 貼到 remix。在合約的 Details 中可以看到完整的合約介面和對應的 function signature。  ### 使用 RPC 可以透過一個簡單的 POST 用 Infura 提供的節點呼叫一個 RPC。有哪些 RPC method 可以看 [Ethereum RPC doc](https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_sendtransaction)。 如果要呼叫的 function 只是查詢,而沒有要更新合約的狀態,那就用 `eth_call` 這個 RPC。POST Data 如下: { "jsonrpc":"2.0", "method":"eth_call", "params":[ { "to":"0x86Fa049857E0209aa7D9e616F7eb3b3B78ECfdb0", "data":"0x70a0823100000000000000000000000033b8287511ac7F003902e83D642Be4603afCd876" }, "latest" ], "id":123 } 其中 `params` 的值包含: - `"to"`:合約地址 - `"data"`:丟給合約的參數。由三個部分組成:`0x`、`70a08231`和一個 32 bytes 的參數 `00000000000000000000000033b8287511ac7F003902e83D642Be46`(也就是我要查詢的帳戶) - `"latest"`,代表使用最新的區塊鏈資料 #### 範例 // Request curl https://mainnet.infura.io/<your-api-key> -X POST --data '{"jsonrpc":"2.0","method":"eth_call","params":[{"to":"0x86Fa049857E0209aa7D9e616F7eb3b3B78ECfdb0", "data":"0x70a0823100000000000000000000000033b8287511ac7F003902e83D642Be4603afCd876"}, "latest"],"id":123 }' // Result { "jsonrpc": "2.0", "id": 123, "result": "0x000000000000000000000000000000000000000000000000b1d16ec625a59d3e" } `0x000000000000000000000000000000000000000000000000b1d16ec625a59d3e` 是十六進位,換算成十進位是 `12813144212159962430`。也就是小弟只有少少的 **12.x** 個 EOS token。 --- ## web3.js(JavaScript API) 如果要更新合約的狀態,就需要送 transaction,要送 transaction 就需要錢包或是說 private key 來 sign transaction 和提供 Ether 做手續費。因為送 transaction 要手續費,為了省點錢,我就部一個合約在 **Ropsten 測試鏈**上做這次的試驗。以上步驟比較麻煩,**我就用 web3.js 寫兩個簡單的程式,一個查詢合約狀態、一個更新合約狀態**。web3.js 的功能和 RPC 差不多,但是個 JavaScript 套件。有哪些 API 可以用請看 [JavaScript API doc](https://github.com/ethereum/wiki/wiki/JavaScript-API#web3versionapi)。 ### 安裝 npm install web3, ethereumjs-tx ### 官方建議的初始化方式 var Web3 = require('web3'); if (typeof web3 !== 'undefined') { web3 = new Web3(web3.currentProvider); } else { // set the provider you want from Web3.providers web3 = new Web3(new Web3.providers.HttpProvider("https://ropsten.infura.io/<your-api-key>")); } ### 部署測試合約 這次部署一個很簡單的合約。合約只儲存一個狀態 `data`,並可透過 `set()` 更新狀態。 合約程式碼: pragma solidity ^0.4.19; contract SimpleStorage { uint public data; function set(uint x) public { data = x; } } 合約地址:`0x5fb30123b9efedcd15094266948fb7c862279ee1` 合約的 function signatures: { "73d4a13a": "data()", "60fe47b1": "set(uint256)" } --- ### 查詢合約狀態 使用 `web3.eth.call`。 // Request var result = web3.eth.call({ to: "0x5fb30123b9efedcd15094266948fb7c862279ee1", data: "0x" + "73d4a13a" }); // Print Result console.log(parseInt(result, 16)); Print 出來結果會是 `0`,因為還沒更新過狀態。 --- ### 更新合約狀態 使用 `web3.eth.sendRawTransaction`。 > RPC 和 web3.js 提供的 `SendTransaction` 都是連到一節點,使用節點中的帳戶發送 transaction。而如果要用自己的帳戶就要用 `sendRawTransaction`,也就是說要自己建立 transaction、自己 sign 過,再透過 `sendRawTransaction` 發送。 #### Define raw transaction var rawTx = { nonce: '0x14', gasPrice: '0x3B9ACA00', gasLimit: '0xC20A', to: '0x5fb30123b9efedcd15094266948fb7c862279ee1', value: '0x00', data: '0x' + '60fe47b1' + '000000000000000000000000000000000000000000000000000000000000000a' } `rawTx` 中包含: - `nonce`:紀錄目前帳戶送出的交易數,用來避免 replay attack,每次送要加 1。可以用 RPC `eth_getTransactionCount` 查詢目前帳戶的 nonce。也可以用 Etherscan 查,但 Etherscan 顯示的 `No Of Transactions` 會包含送出去但沒有成功的交易,所以會不準 - `gasPrice`:一般用 1 Gwei(= 1000000000 = 0x3B9ACA00) - `gasLimit`:gaslimit 估算可參考 [使用ethereum browser計算gas cost](https://medium.com/taipei-ethereum-meetup/%E4%BD%BF%E7%94%A8ethereum-browser%E8%A8%88%E7%AE%97gas-cost-9122950a04f7) - `to`:合約地址 - `value`:要送的 Ether 數量,因為只是要呼叫合約所以設 0 - `data`:丟給合約的參數。由三個部分組成:`0x`、`60fe47b1`和一個 32 bytes 的參數 `000000000000000000000000000000000000000000000000000000000000000a`(我要更新的值,這邊設 10) #### Create and Sign raw transaction 要引入另一個套件 `ethereumjs-tx`。記得先用 npm 安裝。 var Tx = require('ethereumjs-tx'); 建立 raw transaction。 var tx = new Tx(rawTx); 用自己的 private key sign。 const privateKey = new Buffer('<your-private-key>', 'hex') tx.sign(privateKey); #### Send raw transaction var serializedTx = tx.serialize(); web3.eth.sendRawTransaction('0x' + serializedTx.function function function toString() { [native code] }() { [native code] }() { [native code] }('hex'), function(err, hash) { if (!err) { console.log(hash); } else { console.log(err) } }); 成功就會回傳一個 transaction hash,像是: 0x2a9d89b0f329853b5c0f83c83cea4cfa2e38ddd1041d9abd0afcc9af5ed1bf1b 交易成功送出且被收進 block 後,再次查詢合約狀態,Print 出來結果就會是 **10**。 可以透過 Etherscan 確認交易有沒有被收進 block 以及合約執行的結果(可能因為參數錯誤導致執行失敗)。  ## References - [在區塊鏈上建立可更新的智慧合約(一)](https://medium.com/@twedusuck/%E5%9C%A8%E5%8D%80%E5%A1%8A%E9%8F%88%E4%B8%8A%E5%BB%BA%E7%AB%8B%E5%8F%AF%E6%9B%B4%E6%96%B0%E7%9A%84%E6%99%BA%E6%85%A7%E5%90%88%E7%B4%84-cbe015bdb339) - [Ethereum JSON RPC Document](https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_gettransactioncount) - [We3.js API Document](https://github.com/ethereum/wiki/wiki/JavaScript-API) |
| title | 【Ethereum 智能合約開發筆記】不用自己跑節點,使用 Infura 和 web3.js 呼叫合約 |
| author | ankar |
| permlink | ethereum-infura-web3-js |
| json metadata | {"tags":["cn","blockchain","ethereum","infura","web3"],"image":["https://i.imgur.com/doEO8gu.jpg","https://i.imgur.com/yz9kOFo.png","https://i.imgur.com/vVx5L4A.png","https://i.imgur.com/YRtWIGr.png","https://i.imgur.com/RdDK54y.png"],"links":["https://infura.io/signup","https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_sendtransaction","https://github.com/ethereum/wiki/wiki/JavaScript-API#web3versionapi","https://medium.com/taipei-ethereum-meetup/%E4%BD%BF%E7%94%A8ethereum-browser%E8%A8%88%E7%AE%97gas-cost-9122950a04f7","https://medium.com/@twedusuck/%E5%9C%A8%E5%8D%80%E5%A1%8A%E9%8F%88%E4%B8%8A%E5%BB%BA%E7%AB%8B%E5%8F%AF%E6%9B%B4%E6%96%B0%E7%9A%84%E6%99%BA%E6%85%A7%E5%90%88%E7%B4%84-cbe015bdb339","https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_gettransactioncount","https://github.com/ethereum/wiki/wiki/JavaScript-API"],"app":"steemit/0.1","format":"markdown"} |
| parent author | |
| parent permlink | cn |
| Transaction Info | Block #19313827/Trx 6c84acbcfa90885767424cb74be326f9cd3ee2e6 |
View Raw JSON Data
{
"op": [
"comment",
{
"body": "\n\n> Infura 提供公開的 Ethereum 主網和測試網路節點。到 [Infura 官網申請](https://infura.io/signup),只要輸入一點基本資料和 Email,就可以收到 API-key。\n\n\n\n---\n\n## 使用 RPC 查詢合約內儲存的狀態\n\n最常需要查詢的狀態就是 Token 的餘額啦。我就用 EOS 代幣合約最為範例試看看。\n\n### 取得合約資訊\n\n可以透過 Etherscan,大部分知名的合約可以直接搜尋到。\n\n\n\n要呼叫合約,至少需要:\n\n- **合約地址**,例如 0x86Fa049857E0209aa7D9e616F7eb3b3B78ECfdb0\n- **要呼叫的 function signature**,例如以 ERC 20 代幣合約來說,查詢餘額要呼叫的 function 是 `balanceOf(address)`,其對應的 function signature 是 `70a08231`。\n\n如何取得 function signature 呢?以 `balanceOf(address)` 為例:\n1. 把 `balanceOf(address)` 經過 sha3\n\n 0x70a08231b98ef4ca268c9cc3f6b4590e4bfec28280db06bb5d45e689f2a360be\n\n2. 取除了 `0x` 外,前面的 8 位\n \n 70a08231\n\n以上流程可以用任何工具完成,以 web3.js 為例:\n\n var functionSig = we3.sha3(\"balanceOf(address)\").substr(2,8)\n\n另外也可以把 contract code 貼到 remix。在合約的 Details 中可以看到完整的合約介面和對應的 function signature。\n\n\n\n### 使用 RPC\n\n可以透過一個簡單的 POST 用 Infura 提供的節點呼叫一個 RPC。有哪些 RPC method 可以看 [Ethereum RPC doc](https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_sendtransaction)。\n\n如果要呼叫的 function 只是查詢,而沒有要更新合約的狀態,那就用 `eth_call` 這個 RPC。POST Data 如下:\n\n {\n \"jsonrpc\":\"2.0\",\n \"method\":\"eth_call\",\n \"params\":[\n {\n \"to\":\"0x86Fa049857E0209aa7D9e616F7eb3b3B78ECfdb0\",\n \"data\":\"0x70a0823100000000000000000000000033b8287511ac7F003902e83D642Be4603afCd876\"\n },\n \"latest\"\n ],\n \"id\":123\n }\n\n其中 `params` 的值包含:\n\n- `\"to\"`:合約地址\n- `\"data\"`:丟給合約的參數。由三個部分組成:`0x`、`70a08231`和一個 32 bytes 的參數 `00000000000000000000000033b8287511ac7F003902e83D642Be46`(也就是我要查詢的帳戶)\n- `\"latest\"`,代表使用最新的區塊鏈資料\n\n#### 範例\n\n // Request\n curl https://mainnet.infura.io/<your-api-key> -X POST --data '{\"jsonrpc\":\"2.0\",\"method\":\"eth_call\",\"params\":[{\"to\":\"0x86Fa049857E0209aa7D9e616F7eb3b3B78ECfdb0\", \"data\":\"0x70a0823100000000000000000000000033b8287511ac7F003902e83D642Be4603afCd876\"}, \"latest\"],\"id\":123 }'\n\n // Result\n {\n \"jsonrpc\": \"2.0\",\n \"id\": 123,\n \"result\": \"0x000000000000000000000000000000000000000000000000b1d16ec625a59d3e\"\n }\n\n`0x000000000000000000000000000000000000000000000000b1d16ec625a59d3e` 是十六進位,換算成十進位是 `12813144212159962430`。也就是小弟只有少少的 **12.x** 個 EOS token。\n\n---\n\n## web3.js(JavaScript API)\n\n如果要更新合約的狀態,就需要送 transaction,要送 transaction 就需要錢包或是說 private key 來 sign transaction 和提供 Ether 做手續費。因為送 transaction 要手續費,為了省點錢,我就部一個合約在 **Ropsten 測試鏈**上做這次的試驗。以上步驟比較麻煩,**我就用 web3.js 寫兩個簡單的程式,一個查詢合約狀態、一個更新合約狀態**。web3.js 的功能和 RPC 差不多,但是個 JavaScript 套件。有哪些 API 可以用請看 [JavaScript API doc](https://github.com/ethereum/wiki/wiki/JavaScript-API#web3versionapi)。\n\n### 安裝\n\n npm install web3, ethereumjs-tx\n \n### 官方建議的初始化方式\n\n var Web3 = require('web3');\n\n if (typeof web3 !== 'undefined') {\n web3 = new Web3(web3.currentProvider);\n } else {\n // set the provider you want from Web3.providers\n web3 = new Web3(new Web3.providers.HttpProvider(\"https://ropsten.infura.io/<your-api-key>\"));\n }\n\n### 部署測試合約\n\n這次部署一個很簡單的合約。合約只儲存一個狀態 `data`,並可透過 `set()` 更新狀態。\n\n合約程式碼:\n\n pragma solidity ^0.4.19;\n\n contract SimpleStorage {\n uint public data;\n \n function set(uint x) public {\n data = x;\n }\n }\n\n合約地址:`0x5fb30123b9efedcd15094266948fb7c862279ee1`\n\n合約的 function signatures:\n\n {\n \"73d4a13a\": \"data()\",\n \"60fe47b1\": \"set(uint256)\"\n }\n\n---\n\n### 查詢合約狀態\n\n使用 `web3.eth.call`。\n\n // Request\n var result = web3.eth.call({\n to: \"0x5fb30123b9efedcd15094266948fb7c862279ee1\", \n data: \"0x\" + \"73d4a13a\"\n });\n\n // Print Result\n console.log(parseInt(result, 16));\n\nPrint 出來結果會是 `0`,因為還沒更新過狀態。\n\n---\n\n### 更新合約狀態\n\n使用 `web3.eth.sendRawTransaction`。\n\n> RPC 和 web3.js 提供的 `SendTransaction` 都是連到一節點,使用節點中的帳戶發送 transaction。而如果要用自己的帳戶就要用 `sendRawTransaction`,也就是說要自己建立 transaction、自己 sign 過,再透過 `sendRawTransaction` 發送。\n\n#### Define raw transaction\n\n var rawTx = {\n nonce: '0x14',\n gasPrice: '0x3B9ACA00', \n gasLimit: '0xC20A',\n to: '0x5fb30123b9efedcd15094266948fb7c862279ee1', \n value: '0x00', \n data: '0x' + '60fe47b1' + '000000000000000000000000000000000000000000000000000000000000000a'\n }\n\n`rawTx` 中包含:\n\n- `nonce`:紀錄目前帳戶送出的交易數,用來避免 replay attack,每次送要加 1。可以用 RPC `eth_getTransactionCount` 查詢目前帳戶的 nonce。也可以用 Etherscan 查,但 Etherscan 顯示的 `No Of Transactions` 會包含送出去但沒有成功的交易,所以會不準\n- `gasPrice`:一般用 1 Gwei(= 1000000000 = 0x3B9ACA00)\n- `gasLimit`:gaslimit 估算可參考 [使用ethereum browser計算gas cost](https://medium.com/taipei-ethereum-meetup/%E4%BD%BF%E7%94%A8ethereum-browser%E8%A8%88%E7%AE%97gas-cost-9122950a04f7)\n- `to`:合約地址\n- `value`:要送的 Ether 數量,因為只是要呼叫合約所以設 0\n- `data`:丟給合約的參數。由三個部分組成:`0x`、`60fe47b1`和一個 32 bytes 的參數 `000000000000000000000000000000000000000000000000000000000000000a`(我要更新的值,這邊設 10)\n\n#### Create and Sign raw transaction\n\n要引入另一個套件 `ethereumjs-tx`。記得先用 npm 安裝。\n \n var Tx = require('ethereumjs-tx');\n\n建立 raw transaction。\n\n var tx = new Tx(rawTx);\n\n用自己的 private key sign。\n\n const privateKey = new Buffer('<your-private-key>', 'hex')\n tx.sign(privateKey);\n\n#### Send raw transaction\n\n var serializedTx = tx.serialize();\n web3.eth.sendRawTransaction('0x' + serializedTx.function function function toString() { [native code] }() { [native code] }() { [native code] }('hex'), function(err, hash) {\n if (!err) {\n console.log(hash);\n } else {\n console.log(err)\n }\n });\n\n成功就會回傳一個 transaction hash,像是:\n\n 0x2a9d89b0f329853b5c0f83c83cea4cfa2e38ddd1041d9abd0afcc9af5ed1bf1b\n\n交易成功送出且被收進 block 後,再次查詢合約狀態,Print 出來結果就會是 **10**。\n\n可以透過 Etherscan 確認交易有沒有被收進 block 以及合約執行的結果(可能因為參數錯誤導致執行失敗)。\n\n\n\n## References\n\n- [在區塊鏈上建立可更新的智慧合約(一)](https://medium.com/@twedusuck/%E5%9C%A8%E5%8D%80%E5%A1%8A%E9%8F%88%E4%B8%8A%E5%BB%BA%E7%AB%8B%E5%8F%AF%E6%9B%B4%E6%96%B0%E7%9A%84%E6%99%BA%E6%85%A7%E5%90%88%E7%B4%84-cbe015bdb339)\n- [Ethereum JSON RPC Document](https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_gettransactioncount)\n- [We3.js API Document](https://github.com/ethereum/wiki/wiki/JavaScript-API)",
"title": "【Ethereum 智能合約開發筆記】不用自己跑節點,使用 Infura 和 web3.js 呼叫合約",
"author": "ankar",
"permlink": "ethereum-infura-web3-js",
"json_metadata": "{\"tags\":[\"cn\",\"blockchain\",\"ethereum\",\"infura\",\"web3\"],\"image\":[\"https://i.imgur.com/doEO8gu.jpg\",\"https://i.imgur.com/yz9kOFo.png\",\"https://i.imgur.com/vVx5L4A.png\",\"https://i.imgur.com/YRtWIGr.png\",\"https://i.imgur.com/RdDK54y.png\"],\"links\":[\"https://infura.io/signup\",\"https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_sendtransaction\",\"https://github.com/ethereum/wiki/wiki/JavaScript-API#web3versionapi\",\"https://medium.com/taipei-ethereum-meetup/%E4%BD%BF%E7%94%A8ethereum-browser%E8%A8%88%E7%AE%97gas-cost-9122950a04f7\",\"https://medium.com/@twedusuck/%E5%9C%A8%E5%8D%80%E5%A1%8A%E9%8F%88%E4%B8%8A%E5%BB%BA%E7%AB%8B%E5%8F%AF%E6%9B%B4%E6%96%B0%E7%9A%84%E6%99%BA%E6%85%A7%E5%90%88%E7%B4%84-cbe015bdb339\",\"https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_gettransactioncount\",\"https://github.com/ethereum/wiki/wiki/JavaScript-API\"],\"app\":\"steemit/0.1\",\"format\":\"markdown\"}",
"parent_author": "",
"parent_permlink": "cn"
}
],
"block": 19313827,
"trx_id": "6c84acbcfa90885767424cb74be326f9cd3ee2e6",
"op_in_trx": 0,
"timestamp": "2018-01-26T10:45:57",
"virtual_op": false,
"trx_in_block": 15
}tyzerneffective vote applied for @ankar / decentraland2018/01/24 12:29:03
tyzerneffective vote applied for @ankar / decentraland
2018/01/24 12:29:03
| voter | tyzern |
| author | ankar |
| weight | 394 (3.94%) |
| rshares | 51553990 |
| permlink | decentraland |
| pending payout | 0.049 HBD |
| total vote weight | 77470 |
| Transaction Info | Block #19258308/Trx ee5c8f24e7c115025a15b477e79efa1b45efd07e |
View Raw JSON Data
{
"op": [
"effective_comment_vote",
{
"voter": "tyzern",
"author": "ankar",
"weight": 394,
"rshares": 51553990,
"permlink": "decentraland",
"pending_payout": "0.049 HBD",
"total_vote_weight": 77470
}
],
"block": 19258308,
"trx_id": "ee5c8f24e7c115025a15b477e79efa1b45efd07e",
"op_in_trx": 1,
"timestamp": "2018-01-24T12:29:03",
"virtual_op": true,
"trx_in_block": 28
}tyzernupvoted (100.00%) @ankar / decentraland2018/01/24 12:29:03
tyzernupvoted (100.00%) @ankar / decentraland
2018/01/24 12:29:03
| voter | tyzern |
| author | ankar |
| weight | 10000 (100.00%) |
| permlink | decentraland |
| Transaction Info | Block #19258308/Trx ee5c8f24e7c115025a15b477e79efa1b45efd07e |
View Raw JSON Data
{
"op": [
"vote",
{
"voter": "tyzern",
"author": "ankar",
"weight": 10000,
"permlink": "decentraland"
}
],
"block": 19258308,
"trx_id": "ee5c8f24e7c115025a15b477e79efa1b45efd07e",
"op_in_trx": 0,
"timestamp": "2018-01-24T12:29:03",
"virtual_op": false,
"trx_in_block": 28
}ankarupdated payout for ethereum-remix2018/01/24 08:45:24
ankarupdated payout for ethereum-remix
2018/01/24 08:45:24
| author | ankar |
| permlink | ethereum-remix |
| Transaction Info | Block #19253835/Virtual Operation 4294967295:27 |
View Raw JSON Data
{
"op": [
"comment_payout_update",
{
"author": "ankar",
"permlink": "ethereum-remix"
}
],
"block": 19253835,
"trx_id": "0000000000000000000000000000000000000000",
"op_in_trx": 27,
"timestamp": "2018-01-24T08:45:24",
"virtual_op": true,
"trx_in_block": 4294967295
}ankarreceived 0.031 HBD reward share for ethereum-remix2018/01/24 08:45:24
ankarreceived 0.031 HBD reward share for ethereum-remix
2018/01/24 08:45:24
| author | ankar |
| payout | 0.031 HBD |
| permlink | ethereum-remix |
| author rewards | 7 |
| total payout value | 0.030 HBD |
| curator payout value | 0.000 HBD |
| beneficiary payout value | 0.000 HBD |
| Transaction Info | Block #19253835/Virtual Operation 4294967295:26 |
View Raw JSON Data
{
"op": [
"comment_reward",
{
"author": "ankar",
"payout": "0.031 HBD",
"permlink": "ethereum-remix",
"author_rewards": 7,
"total_payout_value": "0.030 HBD",
"curator_payout_value": "0.000 HBD",
"beneficiary_payout_value": "0.000 HBD"
}
],
"block": 19253835,
"trx_id": "0000000000000000000000000000000000000000",
"op_in_trx": 26,
"timestamp": "2018-01-24T08:45:24",
"virtual_op": true,
"trx_in_block": 4294967295
}ankarreceived 0.013 HBD, 0.005 HP author reward for @ankar / ethereum-remix2018/01/24 08:45:24
ankarreceived 0.013 HBD, 0.005 HP author reward for @ankar / ethereum-remix
2018/01/24 08:45:24
| author | ankar |
| permlink | ethereum-remix |
| hbd payout | 0.013 HBD |
| hive payout | 0.000 HIVE |
| vesting payout | 8.187309 VESTS |
| payout must be claimed | true |
| curators vesting payout | 0.000000 VESTS |
| Transaction Info | Block #19253835/Virtual Operation 4294967295:25 |
View Raw JSON Data
{
"op": [
"author_reward",
{
"author": "ankar",
"permlink": "ethereum-remix",
"hbd_payout": "0.013 HBD",
"hive_payout": "0.000 HIVE",
"vesting_payout": "8.187309 VESTS",
"payout_must_be_claimed": true,
"curators_vesting_payout": "0.000000 VESTS"
}
],
"block": 19253835,
"trx_id": "0000000000000000000000000000000000000000",
"op_in_trx": 25,
"timestamp": "2018-01-24T08:45:24",
"virtual_op": true,
"trx_in_block": 4294967295
}cqfeffective vote applied for @ankar / decentraland2018/01/24 02:55:42
cqfeffective vote applied for @ankar / decentraland
2018/01/24 02:55:42
| voter | cqf |
| author | ankar |
| weight | 5119 (51.19%) |
| rshares | 2531951758 |
| permlink | decentraland |
| pending payout | 0.050 HBD |
| total vote weight | 77076 |
| Transaction Info | Block #19246844/Trx 9cda2eb01525f9493fce4f94f4140079e755036f |
View Raw JSON Data
{
"op": [
"effective_comment_vote",
{
"voter": "cqf",
"author": "ankar",
"weight": 5119,
"rshares": 2531951758,
"permlink": "decentraland",
"pending_payout": "0.050 HBD",
"total_vote_weight": 77076
}
],
"block": 19246844,
"trx_id": "9cda2eb01525f9493fce4f94f4140079e755036f",
"op_in_trx": 1,
"timestamp": "2018-01-24T02:55:42",
"virtual_op": true,
"trx_in_block": 0
}cqfupvoted (1.00%) @ankar / decentraland2018/01/24 02:55:42
cqfupvoted (1.00%) @ankar / decentraland
2018/01/24 02:55:42
| voter | cqf |
| author | ankar |
| weight | 100 (1.00%) |
| permlink | decentraland |
| Transaction Info | Block #19246844/Trx 9cda2eb01525f9493fce4f94f4140079e755036f |
View Raw JSON Data
{
"op": [
"vote",
{
"voter": "cqf",
"author": "ankar",
"weight": 100,
"permlink": "decentraland"
}
],
"block": 19246844,
"trx_id": "9cda2eb01525f9493fce4f94f4140079e755036f",
"op_in_trx": 0,
"timestamp": "2018-01-24T02:55:42",
"virtual_op": false,
"trx_in_block": 0
}ankarpublished a new post: decentraland2018/01/24 02:54:45
ankarpublished a new post: decentraland
2018/01/24 02:54:45
| body | @@ -3389,16 +3389,55 @@ epaper%5D( +https://decentraland.org/whitepaper.pdf )%0A- %5BDec |
| title | 【白皮书略读笔记】如何构成 Decentraland? |
| author | ankar |
| permlink | decentraland |
| json metadata | {"tags":["cn","decentraland","blockchain","ethereum","vr"],"image":["https://i.imgur.com/tnCzltI.jpg","https://i.imgur.com/rDTlz5v.png","https://i.imgur.com/KOlfo0g.png","https://i.imgur.com/HtbJ5RU.png"],"links":["https://decentraland.org/whitepaper.pdf","https://decentraland.org/","https://mp.weixin.qq.com/s/ke-j4UBXrj1TO-EPXa_IBg","https://www.youtube.com/watch?v=esjFLqNx4e8","https://github.com/decentraland/land","https://etherscan.io/address/0xf87e31492faf9a91b02ee0deaad50d51d56d5d4d#code","https://etherscan.io/address/0x7e06a9512086bc44c51c07c2bf0af338420c2a13#code","https://wiki.decentraland.org/index.php?title=The_Genesis_City_Auction","https://wiki.decentraland.org/index.php?title=Buying_Land","https://blog.decentraland.org/why-we-use-a-frame-fc5c1d4c3e90","https://cn.bitcoin.com/archives/5678","https://github.com/decentraland/marketplace","https://wiki.decentraland.org/index.php?title=Main_Page","https://blog.decentraland.org/"],"app":"steemit/0.1","format":"markdown"} |
| parent author | |
| parent permlink | cn |
| Transaction Info | Block #19246825/Trx c759e2c60351ef800c5141ac49fe5f55a2c20ab8 |
View Raw JSON Data
{
"op": [
"comment",
{
"body": "@@ -3389,16 +3389,55 @@\n epaper%5D(\n+https://decentraland.org/whitepaper.pdf\n )%0A- %5BDec\n",
"title": "【白皮书略读笔记】如何构成 Decentraland?",
"author": "ankar",
"permlink": "decentraland",
"json_metadata": "{\"tags\":[\"cn\",\"decentraland\",\"blockchain\",\"ethereum\",\"vr\"],\"image\":[\"https://i.imgur.com/tnCzltI.jpg\",\"https://i.imgur.com/rDTlz5v.png\",\"https://i.imgur.com/KOlfo0g.png\",\"https://i.imgur.com/HtbJ5RU.png\"],\"links\":[\"https://decentraland.org/whitepaper.pdf\",\"https://decentraland.org/\",\"https://mp.weixin.qq.com/s/ke-j4UBXrj1TO-EPXa_IBg\",\"https://www.youtube.com/watch?v=esjFLqNx4e8\",\"https://github.com/decentraland/land\",\"https://etherscan.io/address/0xf87e31492faf9a91b02ee0deaad50d51d56d5d4d#code\",\"https://etherscan.io/address/0x7e06a9512086bc44c51c07c2bf0af338420c2a13#code\",\"https://wiki.decentraland.org/index.php?title=The_Genesis_City_Auction\",\"https://wiki.decentraland.org/index.php?title=Buying_Land\",\"https://blog.decentraland.org/why-we-use-a-frame-fc5c1d4c3e90\",\"https://cn.bitcoin.com/archives/5678\",\"https://github.com/decentraland/marketplace\",\"https://wiki.decentraland.org/index.php?title=Main_Page\",\"https://blog.decentraland.org/\"],\"app\":\"steemit/0.1\",\"format\":\"markdown\"}",
"parent_author": "",
"parent_permlink": "cn"
}
],
"block": 19246825,
"trx_id": "c759e2c60351ef800c5141ac49fe5f55a2c20ab8",
"op_in_trx": 0,
"timestamp": "2018-01-24T02:54:45",
"virtual_op": false,
"trx_in_block": 52
}bitcoinboxeffective vote applied for @ankar / decentraland2018/01/24 02:49:33
bitcoinboxeffective vote applied for @ankar / decentraland
2018/01/24 02:49:33
| voter | bitcoinbox |
| author | ankar |
| weight | 129 (1.29%) |
| rshares | 282655635 |
| permlink | decentraland |
| pending payout | 0.028 HBD |
| total vote weight | 57759 |
| Transaction Info | Block #19246721/Trx dfbbd614eac6af5ceb9dcb237be1d101812a725d |
View Raw JSON Data
{
"op": [
"effective_comment_vote",
{
"voter": "bitcoinbox",
"author": "ankar",
"weight": 129,
"rshares": 282655635,
"permlink": "decentraland",
"pending_payout": "0.028 HBD",
"total_vote_weight": 57759
}
],
"block": 19246721,
"trx_id": "dfbbd614eac6af5ceb9dcb237be1d101812a725d",
"op_in_trx": 1,
"timestamp": "2018-01-24T02:49:33",
"virtual_op": true,
"trx_in_block": 42
}bitcoinboxupvoted (100.00%) @ankar / decentraland2018/01/24 02:49:33
bitcoinboxupvoted (100.00%) @ankar / decentraland
2018/01/24 02:49:33
| voter | bitcoinbox |
| author | ankar |
| weight | 10000 (100.00%) |
| permlink | decentraland |
| Transaction Info | Block #19246721/Trx dfbbd614eac6af5ceb9dcb237be1d101812a725d |
View Raw JSON Data
{
"op": [
"vote",
{
"voter": "bitcoinbox",
"author": "ankar",
"weight": 10000,
"permlink": "decentraland"
}
],
"block": 19246721,
"trx_id": "dfbbd614eac6af5ceb9dcb237be1d101812a725d",
"op_in_trx": 0,
"timestamp": "2018-01-24T02:49:33",
"virtual_op": false,
"trx_in_block": 42
}ajah025effective vote applied for @ankar / decentraland2018/01/24 02:49:27
ajah025effective vote applied for @ankar / decentraland
2018/01/24 02:49:27
| voter | ajah025 |
| author | ankar |
| weight | 204 (2.04%) |
| rshares | 473070085 |
| permlink | decentraland |
| pending payout | 0.026 HBD |
| total vote weight | 55603 |
| Transaction Info | Block #19246719/Trx 76d0fd2896e559a01a7eb2463a856119f7eb1780 |
View Raw JSON Data
{
"op": [
"effective_comment_vote",
{
"voter": "ajah025",
"author": "ankar",
"weight": 204,
"rshares": 473070085,
"permlink": "decentraland",
"pending_payout": "0.026 HBD",
"total_vote_weight": 55603
}
],
"block": 19246719,
"trx_id": "76d0fd2896e559a01a7eb2463a856119f7eb1780",
"op_in_trx": 1,
"timestamp": "2018-01-24T02:49:27",
"virtual_op": true,
"trx_in_block": 52
}ajah025upvoted (100.00%) @ankar / decentraland2018/01/24 02:49:27
ajah025upvoted (100.00%) @ankar / decentraland
2018/01/24 02:49:27
| voter | ajah025 |
| author | ankar |
| weight | 10000 (100.00%) |
| permlink | decentraland |
| Transaction Info | Block #19246719/Trx 76d0fd2896e559a01a7eb2463a856119f7eb1780 |
View Raw JSON Data
{
"op": [
"vote",
{
"voter": "ajah025",
"author": "ankar",
"weight": 10000,
"permlink": "decentraland"
}
],
"block": 19246719,
"trx_id": "76d0fd2896e559a01a7eb2463a856119f7eb1780",
"op_in_trx": 0,
"timestamp": "2018-01-24T02:49:27",
"virtual_op": false,
"trx_in_block": 52
}ankareffective vote applied for @ankar / decentraland2018/01/24 02:47:57
ankareffective vote applied for @ankar / decentraland
2018/01/24 02:47:57
| voter | ankar |
| author | ankar |
| weight | 346 (3.46%) |
| rshares | 2519980685 |
| permlink | decentraland |
| pending payout | 0.022 HBD |
| total vote weight | 51993 |
| Transaction Info | Block #19246689/Trx 76479517a3840ad174eaacb1f2e29931cc71b8ba |
View Raw JSON Data
{
"op": [
"effective_comment_vote",
{
"voter": "ankar",
"author": "ankar",
"weight": 346,
"rshares": 2519980685,
"permlink": "decentraland",
"pending_payout": "0.022 HBD",
"total_vote_weight": 51993
}
],
"block": 19246689,
"trx_id": "76479517a3840ad174eaacb1f2e29931cc71b8ba",
"op_in_trx": 1,
"timestamp": "2018-01-24T02:47:57",
"virtual_op": true,
"trx_in_block": 41
}ankarupvoted (100.00%) @ankar / decentraland2018/01/24 02:47:57
ankarupvoted (100.00%) @ankar / decentraland
2018/01/24 02:47:57
| voter | ankar |
| author | ankar |
| weight | 10000 (100.00%) |
| permlink | decentraland |
| Transaction Info | Block #19246689/Trx 76479517a3840ad174eaacb1f2e29931cc71b8ba |
View Raw JSON Data
{
"op": [
"vote",
{
"voter": "ankar",
"author": "ankar",
"weight": 10000,
"permlink": "decentraland"
}
],
"block": 19246689,
"trx_id": "76479517a3840ad174eaacb1f2e29931cc71b8ba",
"op_in_trx": 0,
"timestamp": "2018-01-24T02:47:57",
"virtual_op": false,
"trx_in_block": 41
}ankarpublished a new post: decentraland2018/01/24 02:47:45
ankarpublished a new post: decentraland
2018/01/24 02:47:45
| body |  > Decentraland 是架构于 Ethereum 区块链上的虚拟世界。Decentraland 的土地(Land)是纪录在区块链上的虚拟资产,所有权可以像真实世界中一样转移。土地是数量固定的有限资源,每ㄧ笔土地都有固定的座标(x, y)。土地拥有者可以任意创造土地上呈现的内容,像是静态的 3D 场景或是一间虚拟电商甚至一个可和使用者互动的游戏(请发挥想像力)。**本篇希望根据[白皮书](https://decentraland.org/whitepaper.pdf),了解构成 Decentraland 主要的技术架构。**  本篇专注在技术上如何构成 Decentraland。想从其他面向了解 Decentraland 可以先参考[官网](https://decentraland.org/),也可以听听创办人怎么说: - [对谈 Project Lead of Decentraland - Ari Meilich](https://mp.weixin.qq.com/s/ke-j4UBXrj1TO-EPXa_IBg) - [SF WebVR/AR Monthly: Esteban Ordano - Decentraland](https://www.youtube.com/watch?v=esjFLqNx4e8) ## 在 Decentraland 之上 Decentraland 的架构包含三层: - Consensus layer(共识层):管理土地(所有权、内容的连结等)和 MANA 代币。 - Land content layer(内容层):透过分布式的档案系统储存内容。 - Real-time layer(实时呈现层):让使用者能实际体验这个虚拟世界(所有土地上的内容),并与其他使用者彼此互动。  ### Consensus layer(共识层) #### 土地(LAND) Decentraland 使用 Ethereum 智能合约来管理土地,将土地的所有权和交易历史等记录在难以窜改的区块链上。在他们撰写的 [LAND 智能合约](https://github.com/decentraland/land) 中,定义 **土地(Land)** 为一种虚拟资产,且是不可替代的(non-fungible)。都有唯一的(x, y)座标、一个拥有者和一个参考(可以是一个 IPFS Hash 或是一个 HTTPS 网址等)连结到描述内容的文件。Decentraland Client(目前还没实作出来) 会连结这个 LAND 智能合约,取得土地最新的参考,并从参考下载描述土地上内容的文件,再将内容呈现给使用者。 另外实际上 LAND 智能合约分成两部分:[LANDProxy](https://etherscan.io/address/0xf87e31492faf9a91b02ee0deaad50d51d56d5d4d#code) 和 [LANDRegistry](https://etherscan.io/address/0x7e06a9512086bc44c51c07c2bf0af338420c2a13#code),目的是让实作管理土地的 LANDRegistry 合约可以更新。使用者透过 LANDProxy 调用 LANDRegistry,当要更新 LANDRegistry 时只需重新部署并取得新的合约地址,再更新 LANDProxy 中纪录的合约地址就可以了。 #### MANA Decentraland 另外使用 Ethereum 智能合约发行一种代币叫 **MANA**。MANA 是符合 ERC20 的代币,用来购买土地。起初可以透过花掉 1000 MANA 取得一块土地(MANA 会被销毁,这个角度来看购买 MANA 就像预购土地)。另外[ Genesis City 的土地在 2017 年底时透过拍卖出售](https://wiki.decentraland.org/index.php?title=The_Genesis_City_Auction)。关于购买土地详细请看 [wiki](https://wiki.decentraland.org/index.php?title=Buying_Land)。 ### Land content layer(内容层) 每块土地都有对应的文件描述土地的内容,这份文件可用 IPFS(Inter-Planetary File System) 来储存。这让 Decentraland 的运行不需要中心化的 server,避免 single-point of faliure,且可以做到 censorship-resistance。至于 IPFS 对提供储存空间、频宽的人缺发奖励机制,未来可望用 Filecoin 这类 protocol 解决。 实际上一块土地实际需要多份文件才能描述其完整的内容,这些内容包括: - 物件内容:描述土地上物件的 3D 模型、纹理或一切渲染所需要的资讯。目前官方正在开发一个[基于 A-Frame 的土地编辑器](https://blog.decentraland.org/why-we-use-a-frame-fc5c1d4c3e90)。 - 脚本:描述的土地上的物件如何放置、移动,还有每个物件和使用者互动的行为。这让在 Decentraland 的世界中制作动画或是游戏成为可能。这个脚本语言也正在开发中。 - P2P 互动:这部分官方描述比较模糊,应该还没定案。目的是希望使用者可以彼此互动,像是语音、讯息甚至支付的功能。可能就要描述由哪个 server 提供服务,如何使用等。 ### Real-time layer(实时呈现层) 除了用各种 3D 渲染技术呈现内容(主要透过虚拟实境装置),还希望使用者之间可以彼此互动透过讯息或语音等。比较可行的方式是土地拥有者架设 server,让使用者透过 server 进行互动。但在 Decentraland 中使用者需要透过 centralized 的 server 才能互动,这个世界好像就不这么美丽了,所以白皮书中计划未来会开发一个 P2P 沟通系统。此外,还要开发在 Decentraland 中的支付网路,提供快速、低手续费的支付方式。用来购买 P2P 服务或奖励内容提供者。虽然已经有 MANA 这个代币,但作为一个 ERC20 代币,以目前 Ethereum 区块链网路的情况用做支付可能会又慢又贵([以太坊区块链被猫咪堵住](https://cn.bitcoin.com/archives/5678))。 ## 目前与未来发展  Decentraland 在 2017 年 8 月才 ICO 并发行 MANA 的代币。至今与社群共同完成 Decentraland 中各街区的规划、并在部署 Land 智能合约后开放使用者取得土地所有权。整个项目还在早期,根据[官网](https://decentraland.org/)的 Roadmap,目前正进入开发阶段中的 “Iron Age“,包括要释出基于 A-Frame 的土地编辑器和脚本系统,让土地拥有者可以开始创造土地上的内容。脚本系统所能提供的功能和创造出来的使用体验,会是影响 Decentraland 发展的重要因素。目前也正在开发去中心化的[土地交易所](https://github.com/decentraland/marketplace)。未来的挑战还有快速、低手续费的支付网路和 P2P 沟通系统等。期待 Decentraland 未来的发展。 ## 参考资料 - [Decentraland Whitepaper]() - [Decentraland Wiki](https://wiki.decentraland.org/index.php?title=Main_Page) - [Decentraland Blog](https://blog.decentraland.org/) |
| title | 【白皮书略读笔记】如何构成 Decentraland? |
| author | ankar |
| permlink | decentraland |
| json metadata | {"tags":["cn","decentraland","blockchain","ethereum","vr"],"image":["https://i.imgur.com/tnCzltI.jpg","https://i.imgur.com/rDTlz5v.png","https://i.imgur.com/KOlfo0g.png","https://i.imgur.com/HtbJ5RU.png"],"links":["https://decentraland.org/whitepaper.pdf","https://decentraland.org/","https://mp.weixin.qq.com/s/ke-j4UBXrj1TO-EPXa_IBg","https://www.youtube.com/watch?v=esjFLqNx4e8","https://github.com/decentraland/land","https://etherscan.io/address/0xf87e31492faf9a91b02ee0deaad50d51d56d5d4d#code","https://etherscan.io/address/0x7e06a9512086bc44c51c07c2bf0af338420c2a13#code","https://wiki.decentraland.org/index.php?title=The_Genesis_City_Auction","https://wiki.decentraland.org/index.php?title=Buying_Land","https://blog.decentraland.org/why-we-use-a-frame-fc5c1d4c3e90","https://cn.bitcoin.com/archives/5678","https://github.com/decentraland/marketplace","https://wiki.decentraland.org/index.php?title=Main_Page","https://blog.decentraland.org/"],"app":"steemit/0.1","format":"markdown"} |
| parent author | |
| parent permlink | cn |
| Transaction Info | Block #19246685/Trx 760873659be788ac7559422a9b8c00b526877699 |
View Raw JSON Data
{
"op": [
"comment",
{
"body": "\n\n> Decentraland 是架构于 Ethereum 区块链上的虚拟世界。Decentraland 的土地(Land)是纪录在区块链上的虚拟资产,所有权可以像真实世界中一样转移。土地是数量固定的有限资源,每ㄧ笔土地都有固定的座标(x, y)。土地拥有者可以任意创造土地上呈现的内容,像是静态的 3D 场景或是一间虚拟电商甚至一个可和使用者互动的游戏(请发挥想像力)。**本篇希望根据[白皮书](https://decentraland.org/whitepaper.pdf),了解构成 Decentraland 主要的技术架构。**\n\n\n\n本篇专注在技术上如何构成 Decentraland。想从其他面向了解 Decentraland 可以先参考[官网](https://decentraland.org/),也可以听听创办人怎么说:\n\n- [对谈 Project Lead of Decentraland - Ari Meilich](https://mp.weixin.qq.com/s/ke-j4UBXrj1TO-EPXa_IBg)\n- [SF WebVR/AR Monthly: Esteban Ordano - Decentraland](https://www.youtube.com/watch?v=esjFLqNx4e8)\n\n## 在 Decentraland 之上\n\nDecentraland 的架构包含三层:\n\n- Consensus layer(共识层):管理土地(所有权、内容的连结等)和 MANA 代币。\n- Land content layer(内容层):透过分布式的档案系统储存内容。\n- Real-time layer(实时呈现层):让使用者能实际体验这个虚拟世界(所有土地上的内容),并与其他使用者彼此互动。\n\n\n\n### Consensus layer(共识层)\n\n#### 土地(LAND)\n\nDecentraland 使用 Ethereum 智能合约来管理土地,将土地的所有权和交易历史等记录在难以窜改的区块链上。在他们撰写的 [LAND 智能合约](https://github.com/decentraland/land) 中,定义 **土地(Land)** 为一种虚拟资产,且是不可替代的(non-fungible)。都有唯一的(x, y)座标、一个拥有者和一个参考(可以是一个 IPFS Hash 或是一个 HTTPS 网址等)连结到描述内容的文件。Decentraland Client(目前还没实作出来) 会连结这个 LAND 智能合约,取得土地最新的参考,并从参考下载描述土地上内容的文件,再将内容呈现给使用者。\n\n另外实际上 LAND 智能合约分成两部分:[LANDProxy](https://etherscan.io/address/0xf87e31492faf9a91b02ee0deaad50d51d56d5d4d#code) 和 [LANDRegistry](https://etherscan.io/address/0x7e06a9512086bc44c51c07c2bf0af338420c2a13#code),目的是让实作管理土地的 LANDRegistry 合约可以更新。使用者透过 LANDProxy 调用 LANDRegistry,当要更新 LANDRegistry 时只需重新部署并取得新的合约地址,再更新 LANDProxy 中纪录的合约地址就可以了。\n\n#### MANA\n\nDecentraland 另外使用 Ethereum 智能合约发行一种代币叫 **MANA**。MANA 是符合 ERC20 的代币,用来购买土地。起初可以透过花掉 1000 MANA 取得一块土地(MANA 会被销毁,这个角度来看购买 MANA 就像预购土地)。另外[ Genesis City 的土地在 2017 年底时透过拍卖出售](https://wiki.decentraland.org/index.php?title=The_Genesis_City_Auction)。关于购买土地详细请看 [wiki](https://wiki.decentraland.org/index.php?title=Buying_Land)。\n\n### Land content layer(内容层)\n\n每块土地都有对应的文件描述土地的内容,这份文件可用 IPFS(Inter-Planetary File System) 来储存。这让 Decentraland 的运行不需要中心化的 server,避免 single-point of faliure,且可以做到 censorship-resistance。至于 IPFS 对提供储存空间、频宽的人缺发奖励机制,未来可望用 Filecoin 这类 protocol 解决。\n\n实际上一块土地实际需要多份文件才能描述其完整的内容,这些内容包括:\n\n- 物件内容:描述土地上物件的 3D 模型、纹理或一切渲染所需要的资讯。目前官方正在开发一个[基于 A-Frame 的土地编辑器](https://blog.decentraland.org/why-we-use-a-frame-fc5c1d4c3e90)。\n- 脚本:描述的土地上的物件如何放置、移动,还有每个物件和使用者互动的行为。这让在 Decentraland 的世界中制作动画或是游戏成为可能。这个脚本语言也正在开发中。\n- P2P 互动:这部分官方描述比较模糊,应该还没定案。目的是希望使用者可以彼此互动,像是语音、讯息甚至支付的功能。可能就要描述由哪个 server 提供服务,如何使用等。\n\n### Real-time layer(实时呈现层)\n\n除了用各种 3D 渲染技术呈现内容(主要透过虚拟实境装置),还希望使用者之间可以彼此互动透过讯息或语音等。比较可行的方式是土地拥有者架设 server,让使用者透过 server 进行互动。但在 Decentraland 中使用者需要透过 centralized 的 server 才能互动,这个世界好像就不这么美丽了,所以白皮书中计划未来会开发一个 P2P 沟通系统。此外,还要开发在 Decentraland 中的支付网路,提供快速、低手续费的支付方式。用来购买 P2P 服务或奖励内容提供者。虽然已经有 MANA 这个代币,但作为一个 ERC20 代币,以目前 Ethereum 区块链网路的情况用做支付可能会又慢又贵([以太坊区块链被猫咪堵住](https://cn.bitcoin.com/archives/5678))。\n\n## 目前与未来发展\n\n\n\nDecentraland 在 2017 年 8 月才 ICO 并发行 MANA 的代币。至今与社群共同完成 Decentraland 中各街区的规划、并在部署 Land 智能合约后开放使用者取得土地所有权。整个项目还在早期,根据[官网](https://decentraland.org/)的 Roadmap,目前正进入开发阶段中的 “Iron Age“,包括要释出基于 A-Frame 的土地编辑器和脚本系统,让土地拥有者可以开始创造土地上的内容。脚本系统所能提供的功能和创造出来的使用体验,会是影响 Decentraland 发展的重要因素。目前也正在开发去中心化的[土地交易所](https://github.com/decentraland/marketplace)。未来的挑战还有快速、低手续费的支付网路和 P2P 沟通系统等。期待 Decentraland 未来的发展。\n\n## 参考资料\n\n- [Decentraland Whitepaper]()\n- [Decentraland Wiki](https://wiki.decentraland.org/index.php?title=Main_Page)\n- [Decentraland Blog](https://blog.decentraland.org/)",
"title": "【白皮书略读笔记】如何构成 Decentraland?",
"author": "ankar",
"permlink": "decentraland",
"json_metadata": "{\"tags\":[\"cn\",\"decentraland\",\"blockchain\",\"ethereum\",\"vr\"],\"image\":[\"https://i.imgur.com/tnCzltI.jpg\",\"https://i.imgur.com/rDTlz5v.png\",\"https://i.imgur.com/KOlfo0g.png\",\"https://i.imgur.com/HtbJ5RU.png\"],\"links\":[\"https://decentraland.org/whitepaper.pdf\",\"https://decentraland.org/\",\"https://mp.weixin.qq.com/s/ke-j4UBXrj1TO-EPXa_IBg\",\"https://www.youtube.com/watch?v=esjFLqNx4e8\",\"https://github.com/decentraland/land\",\"https://etherscan.io/address/0xf87e31492faf9a91b02ee0deaad50d51d56d5d4d#code\",\"https://etherscan.io/address/0x7e06a9512086bc44c51c07c2bf0af338420c2a13#code\",\"https://wiki.decentraland.org/index.php?title=The_Genesis_City_Auction\",\"https://wiki.decentraland.org/index.php?title=Buying_Land\",\"https://blog.decentraland.org/why-we-use-a-frame-fc5c1d4c3e90\",\"https://cn.bitcoin.com/archives/5678\",\"https://github.com/decentraland/marketplace\",\"https://wiki.decentraland.org/index.php?title=Main_Page\",\"https://blog.decentraland.org/\"],\"app\":\"steemit/0.1\",\"format\":\"markdown\"}",
"parent_author": "",
"parent_permlink": "cn"
}
],
"block": 19246685,
"trx_id": "760873659be788ac7559422a9b8c00b526877699",
"op_in_trx": 0,
"timestamp": "2018-01-24T02:47:45",
"virtual_op": false,
"trx_in_block": 24
}ankarpublished a new post: ethereum-remix2018/01/22 03:32:09
ankarpublished a new post: ethereum-remix
2018/01/22 03:32:09
| body | @@ -1,15 +1,10 @@ !%5B -Remix %5D(https: @@ -30,16 +30,16 @@ tW.png)%0A + %0A%E4%B9%8B%E5%89%8D%E6%9C%89%E8%87%AA%E5%B7%B1%E5%BC%80%E5%8F%91 @@ -496,15 +496,15 @@ com/ -U7KrIxB +8Ldz9TK .png @@ -611,16 +611,45 @@ OKEN%EF%BC%89%EF%BC%9A%0A%0A + pragma solidity %5E0.4.0;%0A%0A cont @@ -939,16 +939,23 @@ ) + public %7B%0A @@ -1142,16 +1142,23 @@ _value) + public %7B%0A @@ -1800,64 +1800,43 @@ %E8%87%AA%E5%8A%A8%E7%BC%96%E8%AF%91 -%E3%80%82%E4%BC%9A%E7%9C%8B%E5%88%B0%E6%97%81%E8%BE%B9%E6%9C%89%E6%A9%98%E6%A9%98%E7%9A%84 warning%EF%BC%8C%E4%BB%A3%E8%A1%A8%E7%BC%96%E8%AF%91%E5%AE%8C%E4%BA%86%EF%BC%8C%E4%BD%86 warning %E5%8F%AF%E5%85%88%E4%B8%8D%E7%AE%A1%EF%BC%8C%E4%B8%8D%E5%BD%B1%E5%93%8D%E5%90%88%E7%BA%A6%E6%89%A7%E8%A1%8C +%EF%BC%8C%E6%97%81%E8%BE%B9%E6%B2%A1%E6%9C%89%E8%B7%B3%E5%87%BA%E7%BA%A2%E8%89%B2%E7%9A%84 ERROR %E5%B0%B1%E4%BB%A3%E8%A1%A8%E7%BC%96%E8%AF%91%E6%88%90%E5%8A%9F %E3%80%82%0A +%0A !%5B%E7%BC%96%E8%AF%91%E5%90%88%E7%BA%A6 +%E6%88%90%E5%8A%9F %5D(ht @@ -1857,15 +1857,15 @@ com/ -8kVODQS +HZx6rcr .png |
| title | 【Ethereum 智能合约开发笔记】编译和部署合约的第一种姿势:使用 Remix |
| author | ankar |
| permlink | ethereum-remix |
| json metadata | {"tags":["cn","blockchain","ethereum","solidity","smartcontract"],"image":["https://i.imgur.com/cpeSvtW.png","https://i.imgur.com/8Ldz9TK.png","https://i.imgur.com/hRs9XhP.png","https://i.imgur.com/HZx6rcr.png","https://i.imgur.com/s4b2Xwo.png","https://i.imgur.com/RD1ZQTc.png","https://i.imgur.com/QEEJNBb.png","https://i.imgur.com/bsDeerq.png","https://i.imgur.com/OK0OKJi.png","https://i.imgur.com/xhpkjSS.png","https://i.imgur.com/kboosK7.png","https://i.imgur.com/D4sArGs.png","https://i.imgur.com/5f0dHwl.png","https://i.imgur.com/kn6TCCL.png","https://i.imgur.com/JSuJo5z.png","https://i.imgur.com/TFDNEMw.png","https://i.imgur.com/7Tnp9GQ.png","https://i.imgur.com/ZAwCW5E.png","https://i.imgur.com/6vJYX9A.png","https://i.imgur.com/XYjK7Ck.png","https://i.imgur.com/Q64wrRT.png"],"links":["https://remix.ethereum.org","https://github.com/ethereum/remix","https://solidity.readthedocs.io/en/develop/","https://www.ethereum.org/token","https://metamask.io/","https://medium.com/taipei-ethereum-meetup/%E6%95%99%E7%B7%B4-%E6%88%91-%E5%8F%AA-%E6%83%B3%E5%AD%B8solidity-92b7ba8054f5","https://blog.zeppelin.solutions/designing-the-architecture-for-your-ethereum-application-9cec086f8317","http://truffleframework.com/tutorials/building-testing-frontend-app-truffle-3","http://truffle.tryblockchain.org/truffle3.0-integrate-nodejs.html","https://medium.com/taipei-ethereum-meetup/%E5%88%A9%E7%94%A8%E5%B7%A5%E5%85%B7%E5%8A%A0%E9%80%9Fdapp%E5%BB%BA%E7%BD%AE%E5%92%8C%E6%B8%AC%E8%A9%A6-fb08e77f208e"],"app":"steemit/0.1","format":"markdown"} |
| parent author | |
| parent permlink | cn |
| Transaction Info | Block #19189999/Trx fe71029debf0c2e42048967dabe3d758023f4630 |
View Raw JSON Data
{
"op": [
"comment",
{
"body": "@@ -1,15 +1,10 @@\n !%5B\n-Remix\n %5D(https:\n@@ -30,16 +30,16 @@\n tW.png)%0A\n+\n %0A%E4%B9%8B%E5%89%8D%E6%9C%89%E8%87%AA%E5%B7%B1%E5%BC%80%E5%8F%91\n@@ -496,15 +496,15 @@\n com/\n-U7KrIxB\n+8Ldz9TK\n .png\n@@ -611,16 +611,45 @@\n OKEN%EF%BC%89%EF%BC%9A%0A%0A\n+ pragma solidity %5E0.4.0;%0A%0A\n cont\n@@ -939,16 +939,23 @@\n )\n+ public\n %7B%0A \n@@ -1142,16 +1142,23 @@\n _value)\n+ public\n %7B%0A \n@@ -1800,64 +1800,43 @@\n %E8%87%AA%E5%8A%A8%E7%BC%96%E8%AF%91\n-%E3%80%82%E4%BC%9A%E7%9C%8B%E5%88%B0%E6%97%81%E8%BE%B9%E6%9C%89%E6%A9%98%E6%A9%98%E7%9A%84 warning%EF%BC%8C%E4%BB%A3%E8%A1%A8%E7%BC%96%E8%AF%91%E5%AE%8C%E4%BA%86%EF%BC%8C%E4%BD%86 warning %E5%8F%AF%E5%85%88%E4%B8%8D%E7%AE%A1%EF%BC%8C%E4%B8%8D%E5%BD%B1%E5%93%8D%E5%90%88%E7%BA%A6%E6%89%A7%E8%A1%8C\n+%EF%BC%8C%E6%97%81%E8%BE%B9%E6%B2%A1%E6%9C%89%E8%B7%B3%E5%87%BA%E7%BA%A2%E8%89%B2%E7%9A%84 ERROR %E5%B0%B1%E4%BB%A3%E8%A1%A8%E7%BC%96%E8%AF%91%E6%88%90%E5%8A%9F\n %E3%80%82%0A\n+%0A\n !%5B%E7%BC%96%E8%AF%91%E5%90%88%E7%BA%A6\n+%E6%88%90%E5%8A%9F\n %5D(ht\n@@ -1857,15 +1857,15 @@\n com/\n-8kVODQS\n+HZx6rcr\n .png\n",
"title": "【Ethereum 智能合约开发笔记】编译和部署合约的第一种姿势:使用 Remix",
"author": "ankar",
"permlink": "ethereum-remix",
"json_metadata": "{\"tags\":[\"cn\",\"blockchain\",\"ethereum\",\"solidity\",\"smartcontract\"],\"image\":[\"https://i.imgur.com/cpeSvtW.png\",\"https://i.imgur.com/8Ldz9TK.png\",\"https://i.imgur.com/hRs9XhP.png\",\"https://i.imgur.com/HZx6rcr.png\",\"https://i.imgur.com/s4b2Xwo.png\",\"https://i.imgur.com/RD1ZQTc.png\",\"https://i.imgur.com/QEEJNBb.png\",\"https://i.imgur.com/bsDeerq.png\",\"https://i.imgur.com/OK0OKJi.png\",\"https://i.imgur.com/xhpkjSS.png\",\"https://i.imgur.com/kboosK7.png\",\"https://i.imgur.com/D4sArGs.png\",\"https://i.imgur.com/5f0dHwl.png\",\"https://i.imgur.com/kn6TCCL.png\",\"https://i.imgur.com/JSuJo5z.png\",\"https://i.imgur.com/TFDNEMw.png\",\"https://i.imgur.com/7Tnp9GQ.png\",\"https://i.imgur.com/ZAwCW5E.png\",\"https://i.imgur.com/6vJYX9A.png\",\"https://i.imgur.com/XYjK7Ck.png\",\"https://i.imgur.com/Q64wrRT.png\"],\"links\":[\"https://remix.ethereum.org\",\"https://github.com/ethereum/remix\",\"https://solidity.readthedocs.io/en/develop/\",\"https://www.ethereum.org/token\",\"https://metamask.io/\",\"https://medium.com/taipei-ethereum-meetup/%E6%95%99%E7%B7%B4-%E6%88%91-%E5%8F%AA-%E6%83%B3%E5%AD%B8solidity-92b7ba8054f5\",\"https://blog.zeppelin.solutions/designing-the-architecture-for-your-ethereum-application-9cec086f8317\",\"http://truffleframework.com/tutorials/building-testing-frontend-app-truffle-3\",\"http://truffle.tryblockchain.org/truffle3.0-integrate-nodejs.html\",\"https://medium.com/taipei-ethereum-meetup/%E5%88%A9%E7%94%A8%E5%B7%A5%E5%85%B7%E5%8A%A0%E9%80%9Fdapp%E5%BB%BA%E7%BD%AE%E5%92%8C%E6%B8%AC%E8%A9%A6-fb08e77f208e\"],\"app\":\"steemit/0.1\",\"format\":\"markdown\"}",
"parent_author": "",
"parent_permlink": "cn"
}
],
"block": 19189999,
"trx_id": "fe71029debf0c2e42048967dabe3d758023f4630",
"op_in_trx": 0,
"timestamp": "2018-01-22T03:32:09",
"virtual_op": false,
"trx_in_block": 27
}ankarclaimed reward balance: 0.017 HBD, 0.005 HP2018/01/17 08:46:57
ankarclaimed reward balance: 0.017 HBD, 0.005 HP
2018/01/17 08:46:57
| account | ankar |
| reward hbd | 0.017 HBD |
| reward hive | 0.000 HIVE |
| reward vests | 8.190552 VESTS |
| Transaction Info | Block #19052361/Trx 64f89adff33fcd6050d804189636f04f3187a562 |
View Raw JSON Data
{
"op": [
"claim_reward_balance",
{
"account": "ankar",
"reward_hbd": "0.017 HBD",
"reward_hive": "0.000 HIVE",
"reward_vests": "8.190552 VESTS"
}
],
"block": 19052361,
"trx_id": "64f89adff33fcd6050d804189636f04f3187a562",
"op_in_trx": 0,
"timestamp": "2018-01-17T08:46:57",
"virtual_op": false,
"trx_in_block": 65
}ankarpublished a new post: ethereum-remix2018/01/17 08:46:30
ankarpublished a new post: ethereum-remix
2018/01/17 08:46:30
| body |  之前有自己开发过 Ethereum 智能合约,但没有好好纪录开发的过程和碰到的问题,觉得满可惜。这次想重新开始,从最傻的姿势开始,一步步成长。**本篇希望将一个很简单的代币合约(只能发行和转帐),部署在本地和测试网路上,并测试其功能。**本篇是较详细描述使用 Remix 的步骤及使用上可能碰到的问题。 ## 开发环境 > **不需要安装**,直接在任何浏览器开启 [Remix](https://remix.ethereum.org)。 Remix 是一个 [Open Source](https://github.com/ethereum/remix) 的 [Solidity](https://solidity.readthedocs.io/en/develop/) 智能合约开发环境,提供基本的编译、部署至本地或测试网路、执行合约等功能。Solidity 是 Ethereum 官方设计和支援的程式语言,专门用于编写智能合约。  ## 取得代币合约 代币合约的范例很多,[Ethereum 官网](https://www.ethereum.org/token)有提供一个最小可行的代币合约(MINIMUM VIABLE TOKEN): contract MyToken { /* This creates an array with all balances */ mapping (address => uint256) public balanceOf; /* Initializes contract with initial supply tokens to the creator of the contract */ function MyToken( uint256 initialSupply ) { balanceOf[msg.sender] = initialSupply; // Give the creator all initial tokens } /* Send coins */ function transfer(address _to, uint256 _value) { require(balanceOf[msg.sender] >= _value); // Check if the sender has enough require(balanceOf[_to] + _value >= balanceOf[_to]); // Check for overflows balanceOf[msg.sender] -= _value; // Subtract from the sender balanceOf[_to] += _value; // Add the same to the recipient } } 这个 MyToken 合约真的很傻,只能做两件事: - 创造代币:发起合约时创造指定数量的代币,代币拥有者是发起合约的 Ethereum 帐户 - 转移代币:转移指定数量的代币到指定的 Ethereum 帐户 --- ## 使用 Remix 编译合约 #### 1. 点选右上角 **+** 新增一个档案 名称任意只要副档名是 ".sol"。  #### 2. 复制合约内容到该档案并编译 Remix 预设会自动编译。会看到旁边有橘橘的 warning,代表编译完了,但 warning 可先不管,不影响合约执行。  ## 在本地部署合约 #### 1. 设定网路 点选左边上面的 **run**。  Environment 选择 **JavaScript VM** 代表所有资料都是存在本地记忆体(功能类似 testrpc)。它会提供 5 个虚拟帐户每个有 100 ETH,随便选一个帐户(要记住)。  #### 2. 发送交易部署合约 选择 **MyToken**。可以看到 **create** 按钮。且已根据合约内容显示必须填入 `initialSupply`(也就是要发行的代币数量)。输入一个数目并按 **create**,就会发送交易部署合约。  合约部署成功后,可以看到合约的使用介面。Remix 会自动根据合约的内容,产生对应的合约使用介面。可以看到合约有两个功能:**balanceOf(查询余额)** 和 **transfer(转移代币)**。  底下可以看到 log(纪录每一次的操作)。实际上部署合约是透过一个 Ethereum 交易完成,点 **Details** 可以看到该笔交易详细资料。  --- ## 执行合约 - 查询余额 #### 1. 选择刚刚发起合约的帐户  #### 2. 输入帐户 注意要用 **""** 把帐户包起来,范例: "0xca35b7d915458ef540ade6068dfe2f44e8fa733c" #### 3. 点击 **balanceOf** 可以在旁边看到执行结果,也就是目前这个帐户的代币余额。  #### 错误情况 说明一下,因为资料传送是用 JSON 格式,所以要加上 ""。如果忘记输入 "" 就会在 log 看到错误:  ### 执行合约 - 转移代币 #### 1. 选择要转出的帐户 选择刚刚发起合约的帐户。  #### 2. 输入要转入的帐户 选择并复制另一个帐户。在合约介面 **transfer** 后面的栏位,输入**转入帐户**和要**转移的代币数量**。帐户同样用 "" 包起来,范例: "0x4b0897b0513fdc7c541b6d9d7e929c4e5364d2db", 10 #### 3. 点击 **transfer** 点击 **transfer**,成功后会看到 log 更新。  #### 4. 确认余额更新 再查询转入帐户的余额,就可以看到代币余额增加啦!  #### 错误情况 如果选择要转出的帐户代币余额不足,这笔交易会失败,就会在 log 看到错误。  --- ## 在测试网路部署合约 #### 1. 安装 [MetaMask](https://metamask.io/) 首先,要连到测试网路,就要安装 [MetaMask](https://metamask.io/)。他是浏览器端的 Ethereum 钱包,可以连结 Ethereum 主要和测试网路。安奘后需要建立 Ethereum 帐户,[教练,我”只”想学Solidity](https://medium.com/taipei-ethereum-meetup/%E6%95%99%E7%B7%B4-%E6%88%91-%E5%8F%AA-%E6%83%B3%E5%AD%B8solidity-92b7ba8054f5) 这篇有详细的步骤。    #### 2. 选择测试网路 回到 Remix,这次 Environment 选择 **Injected Web3**,Remix 会自动连结 MetaMask。  #### 3. 部署合约 接著用刚才同样的方式,按 **create** 部署合约,就会看到 MetaMask 的弹出视窗。直接按 **submit** 发送交易。  稍等一点时间(因为要等这个交易被确认),部署成功后合约的使用介面就会跑出来。  就可以用同样的方式使用合约啦! --- ## 总结 Remix 提供一个 Solidity 智能合约的开发环境,可以简易的编译、部署、执行甚至除错,适合编程经验不多的初学者。但无法做到版本控制、测试及和其他开发工具一起使用等,实际要开发 [DApp](https://blog.zeppelin.solutions/designing-the-architecture-for-your-ethereum-application-9cec086f8317) 的话会比较不方便。下一篇会参考以下文章: - [BUILDING AND TESTING A FRONTEND APP WITH TRUFFLE](http://truffleframework.com/tutorials/building-testing-frontend-app-truffle-3) - [Truffle3.0集成NodeJS并完全跑通(附详细实例,可能的错误)](http://truffle.tryblockchain.org/truffle3.0-integrate-nodejs.html) - [利用工具加速Dapp建置和测试](https://medium.com/taipei-ethereum-meetup/%E5%88%A9%E7%94%A8%E5%B7%A5%E5%85%B7%E5%8A%A0%E9%80%9Fdapp%E5%BB%BA%E7%BD%AE%E5%92%8C%E6%B8%AC%E8%A9%A6-fb08e77f208e) 使用 Truffle3、Ganache、web3.js 来编译和部署合约。 |
| title | 【Ethereum 智能合约开发笔记】编译和部署合约的第一种姿势:使用 Remix |
| author | ankar |
| permlink | ethereum-remix |
| json metadata | {"tags":["cn","blockchain","ethereum","solidity","smartcontract"],"image":["https://i.imgur.com/cpeSvtW.png","https://i.imgur.com/U7KrIxB.png","https://i.imgur.com/hRs9XhP.png","https://i.imgur.com/8kVODQS.png","https://i.imgur.com/s4b2Xwo.png","https://i.imgur.com/RD1ZQTc.png","https://i.imgur.com/QEEJNBb.png","https://i.imgur.com/bsDeerq.png","https://i.imgur.com/OK0OKJi.png","https://i.imgur.com/xhpkjSS.png","https://i.imgur.com/kboosK7.png","https://i.imgur.com/D4sArGs.png","https://i.imgur.com/5f0dHwl.png","https://i.imgur.com/kn6TCCL.png","https://i.imgur.com/JSuJo5z.png","https://i.imgur.com/TFDNEMw.png","https://i.imgur.com/7Tnp9GQ.png","https://i.imgur.com/ZAwCW5E.png","https://i.imgur.com/6vJYX9A.png","https://i.imgur.com/XYjK7Ck.png","https://i.imgur.com/Q64wrRT.png"],"links":["https://remix.ethereum.org","https://github.com/ethereum/remix","https://solidity.readthedocs.io/en/develop/","https://www.ethereum.org/token","https://metamask.io/","https://medium.com/taipei-ethereum-meetup/%E6%95%99%E7%B7%B4-%E6%88%91-%E5%8F%AA-%E6%83%B3%E5%AD%B8solidity-92b7ba8054f5","https://blog.zeppelin.solutions/designing-the-architecture-for-your-ethereum-application-9cec086f8317","http://truffleframework.com/tutorials/building-testing-frontend-app-truffle-3","http://truffle.tryblockchain.org/truffle3.0-integrate-nodejs.html","https://medium.com/taipei-ethereum-meetup/%E5%88%A9%E7%94%A8%E5%B7%A5%E5%85%B7%E5%8A%A0%E9%80%9Fdapp%E5%BB%BA%E7%BD%AE%E5%92%8C%E6%B8%AC%E8%A9%A6-fb08e77f208e"],"app":"steemit/0.1","format":"markdown"} |
| parent author | |
| parent permlink | cn |
| Transaction Info | Block #19052352/Trx b7cfed195891f83c353215701e6dcd89c726e2ba |
View Raw JSON Data
{
"op": [
"comment",
{
"body": "\n\n之前有自己开发过 Ethereum 智能合约,但没有好好纪录开发的过程和碰到的问题,觉得满可惜。这次想重新开始,从最傻的姿势开始,一步步成长。**本篇希望将一个很简单的代币合约(只能发行和转帐),部署在本地和测试网路上,并测试其功能。**本篇是较详细描述使用 Remix 的步骤及使用上可能碰到的问题。\n\n## 开发环境\n\n> **不需要安装**,直接在任何浏览器开启 [Remix](https://remix.ethereum.org)。\n\nRemix 是一个 [Open Source](https://github.com/ethereum/remix) 的 [Solidity](https://solidity.readthedocs.io/en/develop/) 智能合约开发环境,提供基本的编译、部署至本地或测试网路、执行合约等功能。Solidity 是 Ethereum 官方设计和支援的程式语言,专门用于编写智能合约。\n\n\n\n## 取得代币合约\n\n代币合约的范例很多,[Ethereum 官网](https://www.ethereum.org/token)有提供一个最小可行的代币合约(MINIMUM VIABLE TOKEN):\n\n contract MyToken {\n /* This creates an array with all balances */\n mapping (address => uint256) public balanceOf;\n\n /* Initializes contract with initial supply tokens to the creator of the contract */\n function MyToken(\n uint256 initialSupply\n ) {\n balanceOf[msg.sender] = initialSupply; // Give the creator all initial tokens\n }\n\n /* Send coins */\n function transfer(address _to, uint256 _value) {\n require(balanceOf[msg.sender] >= _value); // Check if the sender has enough\n require(balanceOf[_to] + _value >= balanceOf[_to]); // Check for overflows\n balanceOf[msg.sender] -= _value; // Subtract from the sender\n balanceOf[_to] += _value; // Add the same to the recipient\n }\n }\n\n这个 MyToken 合约真的很傻,只能做两件事:\n- 创造代币:发起合约时创造指定数量的代币,代币拥有者是发起合约的 Ethereum 帐户\n- 转移代币:转移指定数量的代币到指定的 Ethereum 帐户\n\n---\n\n## 使用 Remix 编译合约\n\n#### 1. 点选右上角 **+** 新增一个档案\n名称任意只要副档名是 \".sol\"。\n\n\n\n#### 2. 复制合约内容到该档案并编译\nRemix 预设会自动编译。会看到旁边有橘橘的 warning,代表编译完了,但 warning 可先不管,不影响合约执行。\n\n\n## 在本地部署合约\n\n#### 1. 设定网路\n点选左边上面的 **run**。\n\n\n\nEnvironment 选择 **JavaScript VM** 代表所有资料都是存在本地记忆体(功能类似 testrpc)。它会提供 5 个虚拟帐户每个有 100 ETH,随便选一个帐户(要记住)。\n\n\n\n#### 2. 发送交易部署合约\n选择 **MyToken**。可以看到 **create** 按钮。且已根据合约内容显示必须填入 `initialSupply`(也就是要发行的代币数量)。输入一个数目并按 **create**,就会发送交易部署合约。\n\n\n\n合约部署成功后,可以看到合约的使用介面。Remix 会自动根据合约的内容,产生对应的合约使用介面。可以看到合约有两个功能:**balanceOf(查询余额)** 和 **transfer(转移代币)**。\n\n\n\n底下可以看到 log(纪录每一次的操作)。实际上部署合约是透过一个 Ethereum 交易完成,点 **Details** 可以看到该笔交易详细资料。\n\n\n---\n\n## 执行合约 - 查询余额\n\n#### 1. 选择刚刚发起合约的帐户\n\n\n#### 2. 输入帐户\n注意要用 **\"\"** 把帐户包起来,范例:\n\n \"0xca35b7d915458ef540ade6068dfe2f44e8fa733c\"\n\n#### 3. 点击 **balanceOf**\n可以在旁边看到执行结果,也就是目前这个帐户的代币余额。\n\n\n#### 错误情况\n说明一下,因为资料传送是用 JSON 格式,所以要加上 \"\"。如果忘记输入 \"\" 就会在 log 看到错误:\n\n\n\n### 执行合约 - 转移代币\n\n#### 1. 选择要转出的帐户\n\n选择刚刚发起合约的帐户。\n\n\n\n\n#### 2. 输入要转入的帐户\n选择并复制另一个帐户。在合约介面 **transfer** 后面的栏位,输入**转入帐户**和要**转移的代币数量**。帐户同样用 \"\" 包起来,范例:\n \n \"0x4b0897b0513fdc7c541b6d9d7e929c4e5364d2db\", 10\n\n#### 3. 点击 **transfer**\n点击 **transfer**,成功后会看到 log 更新。\n\n\n#### 4. 确认余额更新\n再查询转入帐户的余额,就可以看到代币余额增加啦!\n\n\n#### 错误情况\n如果选择要转出的帐户代币余额不足,这笔交易会失败,就会在 log 看到错误。\n\n\n---\n\n## 在测试网路部署合约\n\n#### 1. 安装 [MetaMask](https://metamask.io/)\n首先,要连到测试网路,就要安装 [MetaMask](https://metamask.io/)。他是浏览器端的 Ethereum 钱包,可以连结 Ethereum 主要和测试网路。安奘后需要建立 Ethereum 帐户,[教练,我”只”想学Solidity](https://medium.com/taipei-ethereum-meetup/%E6%95%99%E7%B7%B4-%E6%88%91-%E5%8F%AA-%E6%83%B3%E5%AD%B8solidity-92b7ba8054f5) 这篇有详细的步骤。\n\n\n\n\n\n\n\n#### 2. 选择测试网路\n回到 Remix,这次 Environment 选择 **Injected Web3**,Remix 会自动连结 MetaMask。\n\n\n\n#### 3. 部署合约\n接著用刚才同样的方式,按 **create** 部署合约,就会看到 MetaMask 的弹出视窗。直接按 **submit** 发送交易。\n\n\n\n稍等一点时间(因为要等这个交易被确认),部署成功后合约的使用介面就会跑出来。\n\n\n\n就可以用同样的方式使用合约啦!\n\n---\n\n## 总结\n\nRemix 提供一个 Solidity 智能合约的开发环境,可以简易的编译、部署、执行甚至除错,适合编程经验不多的初学者。但无法做到版本控制、测试及和其他开发工具一起使用等,实际要开发 [DApp](https://blog.zeppelin.solutions/designing-the-architecture-for-your-ethereum-application-9cec086f8317) 的话会比较不方便。下一篇会参考以下文章:\n- [BUILDING AND TESTING A FRONTEND APP WITH TRUFFLE](http://truffleframework.com/tutorials/building-testing-frontend-app-truffle-3)\n\n- [Truffle3.0集成NodeJS并完全跑通(附详细实例,可能的错误)](http://truffle.tryblockchain.org/truffle3.0-integrate-nodejs.html)\n\n- [利用工具加速Dapp建置和测试](https://medium.com/taipei-ethereum-meetup/%E5%88%A9%E7%94%A8%E5%B7%A5%E5%85%B7%E5%8A%A0%E9%80%9Fdapp%E5%BB%BA%E7%BD%AE%E5%92%8C%E6%B8%AC%E8%A9%A6-fb08e77f208e)\n\n使用 Truffle3、Ganache、web3.js 来编译和部署合约。",
"title": "【Ethereum 智能合约开发笔记】编译和部署合约的第一种姿势:使用 Remix",
"author": "ankar",
"permlink": "ethereum-remix",
"json_metadata": "{\"tags\":[\"cn\",\"blockchain\",\"ethereum\",\"solidity\",\"smartcontract\"],\"image\":[\"https://i.imgur.com/cpeSvtW.png\",\"https://i.imgur.com/U7KrIxB.png\",\"https://i.imgur.com/hRs9XhP.png\",\"https://i.imgur.com/8kVODQS.png\",\"https://i.imgur.com/s4b2Xwo.png\",\"https://i.imgur.com/RD1ZQTc.png\",\"https://i.imgur.com/QEEJNBb.png\",\"https://i.imgur.com/bsDeerq.png\",\"https://i.imgur.com/OK0OKJi.png\",\"https://i.imgur.com/xhpkjSS.png\",\"https://i.imgur.com/kboosK7.png\",\"https://i.imgur.com/D4sArGs.png\",\"https://i.imgur.com/5f0dHwl.png\",\"https://i.imgur.com/kn6TCCL.png\",\"https://i.imgur.com/JSuJo5z.png\",\"https://i.imgur.com/TFDNEMw.png\",\"https://i.imgur.com/7Tnp9GQ.png\",\"https://i.imgur.com/ZAwCW5E.png\",\"https://i.imgur.com/6vJYX9A.png\",\"https://i.imgur.com/XYjK7Ck.png\",\"https://i.imgur.com/Q64wrRT.png\"],\"links\":[\"https://remix.ethereum.org\",\"https://github.com/ethereum/remix\",\"https://solidity.readthedocs.io/en/develop/\",\"https://www.ethereum.org/token\",\"https://metamask.io/\",\"https://medium.com/taipei-ethereum-meetup/%E6%95%99%E7%B7%B4-%E6%88%91-%E5%8F%AA-%E6%83%B3%E5%AD%B8solidity-92b7ba8054f5\",\"https://blog.zeppelin.solutions/designing-the-architecture-for-your-ethereum-application-9cec086f8317\",\"http://truffleframework.com/tutorials/building-testing-frontend-app-truffle-3\",\"http://truffle.tryblockchain.org/truffle3.0-integrate-nodejs.html\",\"https://medium.com/taipei-ethereum-meetup/%E5%88%A9%E7%94%A8%E5%B7%A5%E5%85%B7%E5%8A%A0%E9%80%9Fdapp%E5%BB%BA%E7%BD%AE%E5%92%8C%E6%B8%AC%E8%A9%A6-fb08e77f208e\"],\"app\":\"steemit/0.1\",\"format\":\"markdown\"}",
"parent_author": "",
"parent_permlink": "cn"
}
],
"block": 19052352,
"trx_id": "b7cfed195891f83c353215701e6dcd89c726e2ba",
"op_in_trx": 0,
"timestamp": "2018-01-17T08:46:30",
"virtual_op": false,
"trx_in_block": 4
}cheetahreplied to @ankar / cheetah-re-ankarethereum-remix2018/01/17 08:45:54
cheetahreplied to @ankar / cheetah-re-ankarethereum-remix
2018/01/17 08:45:54
| body | Hi! I am a robot. I just upvoted you! I found similar content that readers might be interested in: https://www.jianshu.com/p/e1bae30a998f |
| title | |
| author | cheetah |
| permlink | cheetah-re-ankarethereum-remix |
| json metadata | |
| parent author | ankar |
| parent permlink | ethereum-remix |
| Transaction Info | Block #19052340/Trx cacdcf3d88715f9d46c34846e316ecdc34e78bf8 |
View Raw JSON Data
{
"op": [
"comment",
{
"body": "Hi! I am a robot. I just upvoted you! I found similar content that readers might be interested in:\nhttps://www.jianshu.com/p/e1bae30a998f",
"title": "",
"author": "cheetah",
"permlink": "cheetah-re-ankarethereum-remix",
"json_metadata": "",
"parent_author": "ankar",
"parent_permlink": "ethereum-remix"
}
],
"block": 19052340,
"trx_id": "cacdcf3d88715f9d46c34846e316ecdc34e78bf8",
"op_in_trx": 0,
"timestamp": "2018-01-17T08:45:54",
"virtual_op": false,
"trx_in_block": 72
}cheetaheffective vote applied for @ankar / ethereum-remix2018/01/17 08:45:51
cheetaheffective vote applied for @ankar / ethereum-remix
2018/01/17 08:45:51
| voter | cheetah |
| author | ankar |
| weight | 309 (3.09%) |
| rshares | 2328939605 |
| permlink | ethereum-remix |
| pending payout | 0.040 HBD |
| total vote weight | 61478 |
| Transaction Info | Block #19052339/Trx a2c774cff7ab1c57c153d2a9b3f594ec9b42ad59 |
View Raw JSON Data
{
"op": [
"effective_comment_vote",
{
"voter": "cheetah",
"author": "ankar",
"weight": 309,
"rshares": 2328939605,
"permlink": "ethereum-remix",
"pending_payout": "0.040 HBD",
"total_vote_weight": 61478
}
],
"block": 19052339,
"trx_id": "a2c774cff7ab1c57c153d2a9b3f594ec9b42ad59",
"op_in_trx": 1,
"timestamp": "2018-01-17T08:45:51",
"virtual_op": true,
"trx_in_block": 16
}cheetahupvoted (0.08%) @ankar / ethereum-remix2018/01/17 08:45:51
cheetahupvoted (0.08%) @ankar / ethereum-remix
2018/01/17 08:45:51
| voter | cheetah |
| author | ankar |
| weight | 8 (0.08%) |
| permlink | ethereum-remix |
| Transaction Info | Block #19052339/Trx a2c774cff7ab1c57c153d2a9b3f594ec9b42ad59 |
View Raw JSON Data
{
"op": [
"vote",
{
"voter": "cheetah",
"author": "ankar",
"weight": 8,
"permlink": "ethereum-remix"
}
],
"block": 19052339,
"trx_id": "a2c774cff7ab1c57c153d2a9b3f594ec9b42ad59",
"op_in_trx": 0,
"timestamp": "2018-01-17T08:45:51",
"virtual_op": false,
"trx_in_block": 16
}cn-naughty.boyreplied to @ankar / 20180117t084517806z-post2018/01/17 08:45:36
cn-naughty.boyreplied to @ankar / 20180117t084517806z-post
2018/01/17 08:45:36
| body | 沙发! |
| title | |
| author | cn-naughty.boy |
| permlink | 20180117t084517806z-post |
| json metadata | {"tags":["cn"]} |
| parent author | ankar |
| parent permlink | ethereum-remix |
| Transaction Info | Block #19052334/Trx f2728a9c8a2759673e8d83a304d8e2967ec08a66 |
View Raw JSON Data
{
"op": [
"comment",
{
"body": "沙发!",
"title": "",
"author": "cn-naughty.boy",
"permlink": "20180117t084517806z-post",
"json_metadata": "{\"tags\":[\"cn\"]}",
"parent_author": "ankar",
"parent_permlink": "ethereum-remix"
}
],
"block": 19052334,
"trx_id": "f2728a9c8a2759673e8d83a304d8e2967ec08a66",
"op_in_trx": 0,
"timestamp": "2018-01-17T08:45:36",
"virtual_op": false,
"trx_in_block": 51
}cn-naughty.boyeffective vote applied for @ankar / ethereum-remix2018/01/17 08:45:33
cn-naughty.boyeffective vote applied for @ankar / ethereum-remix
2018/01/17 08:45:33
| voter | cn-naughty.boy |
| author | ankar |
| weight | 127 (1.27%) |
| rshares | 1434255165 |
| permlink | ethereum-remix |
| pending payout | 0.015 HBD |
| total vote weight | 38268 |
| Transaction Info | Block #19052333/Trx feafcc46711f0683bdbda2ce3f416745fa24ac21 |
View Raw JSON Data
{
"op": [
"effective_comment_vote",
{
"voter": "cn-naughty.boy",
"author": "ankar",
"weight": 127,
"rshares": 1434255165,
"permlink": "ethereum-remix",
"pending_payout": "0.015 HBD",
"total_vote_weight": 38268
}
],
"block": 19052333,
"trx_id": "feafcc46711f0683bdbda2ce3f416745fa24ac21",
"op_in_trx": 1,
"timestamp": "2018-01-17T08:45:33",
"virtual_op": true,
"trx_in_block": 52
}cn-naughty.boyupvoted (7.91%) @ankar / ethereum-remix2018/01/17 08:45:33
cn-naughty.boyupvoted (7.91%) @ankar / ethereum-remix
2018/01/17 08:45:33
| voter | cn-naughty.boy |
| author | ankar |
| weight | 791 (7.91%) |
| permlink | ethereum-remix |
| Transaction Info | Block #19052333/Trx feafcc46711f0683bdbda2ce3f416745fa24ac21 |
View Raw JSON Data
{
"op": [
"vote",
{
"voter": "cn-naughty.boy",
"author": "ankar",
"weight": 791,
"permlink": "ethereum-remix"
}
],
"block": 19052333,
"trx_id": "feafcc46711f0683bdbda2ce3f416745fa24ac21",
"op_in_trx": 0,
"timestamp": "2018-01-17T08:45:33",
"virtual_op": false,
"trx_in_block": 52
}ankarpublished a new post: ethereum-remix2018/01/17 08:45:27
ankarpublished a new post: ethereum-remix
2018/01/17 08:45:27
| body |  之前有自己开发过 Ethereum 智能合约,但没有好好纪录开发的过程和碰到的问题,觉得满可惜。这次想重新开始,从最傻的姿势开始,一步步成长。**本篇希望将一个很简单的代币合约(只能发行和转帐),部署在本地和测试网路上,并测试其功能。**本篇是较详细描述使用 Remix 的步骤及使用上可能碰到的问题。 ## 开发环境 > **不需要安装**,直接在任何浏览器开启 [Remix](https://remix.ethereum.org)。 Remix 是一个 [Open Source](https://github.com/ethereum/remix) 的 [Solidity](https://solidity.readthedocs.io/en/develop/) 智能合约开发环境,提供基本的编译、部署至本地或测试网路、执行合约等功能。Solidity 是 Ethereum 官方设计和支援的程式语言,专门用于编写智能合约。  ## 取得代币合约 代币合约的范例很多,[Ethereum 官网](https://www.ethereum.org/token)有提供一个最小可行的代币合约(MINIMUM VIABLE TOKEN): contract MyToken { /* This creates an array with all balances */ mapping (address => uint256) public balanceOf; /* Initializes contract with initial supply tokens to the creator of the contract */ function MyToken( uint256 initialSupply ) { balanceOf[msg.sender] = initialSupply; // Give the creator all initial tokens } /* Send coins */ function transfer(address _to, uint256 _value) { require(balanceOf[msg.sender] >= _value); // Check if the sender has enough require(balanceOf[_to] + _value >= balanceOf[_to]); // Check for overflows balanceOf[msg.sender] -= _value; // Subtract from the sender balanceOf[_to] += _value; // Add the same to the recipient } } 这个 MyToken 合约真的很傻,只能做两件事: - 创造代币:发起合约时创造指定数量的代币,代币拥有者是发起合约的 Ethereum 帐户 - 转移代币:转移指定数量的代币到指定的 Ethereum 帐户 --- ## 使用 Remix 编译合约 #### 1. 点选右上角 **+** 新增一个档案 名称任意只要副档名是 ".sol"。  #### 2. 复制合约内容到该档案并编译 Remix 预设会自动编译。会看到旁边有橘橘的 warning,代表编译完了,但 warning 可先不管,不影响合约执行。  ## 在本地部署合约 #### 1. 设定网路 点选左边上面的 **run**。  Environment 选择 **JavaScript VM** 代表所有资料都是存在本地记忆体(功能类似 testrpc)。它会提供 5 个虚拟帐户每个有 100 ETH,随便选一个帐户(要记住)。  #### 2. 发送交易部署合约 选择 **MyToken**。可以看到 **create** 按钮。且已根据合约内容显示必须填入 `initialSupply`(也就是要发行的代币数量)。输入一个数目并按 **create**,就会发送交易部署合约。  合约部署成功后,可以看到合约的使用介面。Remix 会自动根据合约的内容,产生对应的合约使用介面。可以看到合约有两个功能:**balanceOf(查询余额)** 和 **transfer(转移代币)**。  底下可以看到 log(纪录每一次的操作)。实际上部署合约是透过一个 Ethereum 交易完成,点 **Details** 可以看到该笔交易详细资料。  --- ## 执行合约 - 查询余额 #### 1. 选择刚刚发起合约的帐户  #### 2. 输入帐户 注意要用 **""** 把帐户包起来,范例: "0xca35b7d915458ef540ade6068dfe2f44e8fa733c" #### 3. 点击 **balanceOf** 可以在旁边看到执行结果,也就是目前这个帐户的代币余额。  #### 错误情况 说明一下,因为资料传送是用 JSON 格式,所以要加上 ""。如果忘记输入 "" 就会在 log 看到错误:  ### 执行合约 - 转移代币 #### 1. 选择要转出的帐户 选择刚刚发起合约的帐户。  #### 2. 输入要转入的帐户 选择并复制另一个帐户。在合约介面 **transfer** 后面的栏位,输入**转入帐户**和要**转移的代币数量**。帐户同样用 "" 包起来,范例: "0x4b0897b0513fdc7c541b6d9d7e929c4e5364d2db", 10 #### 3. 点击 **transfer** 点击 **transfer**,成功后会看到 log 更新。  #### 4. 确认余额更新 再查询转入帐户的余额,就可以看到代币余额增加啦!  #### 错误情况 如果选择要转出的帐户代币余额不足,这笔交易会失败,就会在 log 看到错误。  --- ## 在测试网路部署合约 #### 1. 安装 [MetaMask](https://metamask.io/) 首先,要连到测试网路,就要安装 [MetaMask](https://metamask.io/)。他是浏览器端的 Ethereum 钱包,可以连结 Ethereum 主要和测试网路。安奘后需要建立 Ethereum 帐户,[教练,我”只”想学Solidity](https://medium.com/taipei-ethereum-meetup/%E6%95%99%E7%B7%B4-%E6%88%91-%E5%8F%AA-%E6%83%B3%E5%AD%B8solidity-92b7ba8054f5) 这篇有详细的步骤。    #### 2. 选择测试网路 回到 Remix,这次 Environment 选择 **Injected Web3**,Remix 会自动连结 MetaMask。  #### 3. 部署合约 接著用刚才同样的方式,按 **create** 部署合约,就会看到 MetaMask 的弹出视窗。直接按 **submit** 发送交易。  稍等一点时间(因为要等这个交易被确认),部署成功后合约的使用介面就会跑出来。  就可以用同样的方式使用合约啦! --- ## 总结 Remix 提供一个 Solidity 智能合约的开发环境,可以简易的编译、部署、执行甚至除错,适合编程经验不多的初学者。但无法做到版本控制、测试及和其他开发工具一起使用等,实际要开发 [DApp](https://blog.zeppelin.solutions/designing-the-architecture-for-your-ethereum-application-9cec086f8317) 的话会比较不方便。下一篇会参考以下文章: - [BUILDING AND TESTING A FRONTEND APP WITH TRUFFLE](http://truffleframework.com/tutorials/building-testing-frontend-app-truffle-3) - [Truffle3.0集成NodeJS并完全跑通(附详细实例,可能的错误)](http://truffle.tryblockchain.org/truffle3.0-integrate-nodejs.html) - [利用工具加速Dapp建置和测试](https://medium.com/taipei-ethereum-meetup/%E5%88%A9%E7%94%A8%E5%B7%A5%E5%85%B7%E5%8A%A0%E9%80%9Fdapp%E5%BB%BA%E7%BD%AE%E5%92%8C%E6%B8%AC%E8%A9%A6-fb08e77f208e) 使用 Truffle3、Ganache、web3.js 来编译和部署合约。 |
| title | 【Ethereum 智能合约开发笔记】编译和部署合约的第一种姿势:使用 Remix |
| author | ankar |
| permlink | ethereum-remix |
| json metadata | {"tags":["cn","blockchain","ethereum","solidity","smart-contract"],"image":["https://i.imgur.com/cpeSvtW.png","https://i.imgur.com/U7KrIxB.png","https://i.imgur.com/hRs9XhP.png","https://i.imgur.com/8kVODQS.png","https://i.imgur.com/s4b2Xwo.png","https://i.imgur.com/RD1ZQTc.png","https://i.imgur.com/QEEJNBb.png","https://i.imgur.com/bsDeerq.png","https://i.imgur.com/OK0OKJi.png","https://i.imgur.com/xhpkjSS.png","https://i.imgur.com/kboosK7.png","https://i.imgur.com/D4sArGs.png","https://i.imgur.com/5f0dHwl.png","https://i.imgur.com/kn6TCCL.png","https://i.imgur.com/JSuJo5z.png","https://i.imgur.com/TFDNEMw.png","https://i.imgur.com/7Tnp9GQ.png","https://i.imgur.com/ZAwCW5E.png","https://i.imgur.com/6vJYX9A.png","https://i.imgur.com/XYjK7Ck.png","https://i.imgur.com/Q64wrRT.png"],"links":["https://remix.ethereum.org","https://github.com/ethereum/remix","https://solidity.readthedocs.io/en/develop/","https://www.ethereum.org/token","https://metamask.io/","https://medium.com/taipei-ethereum-meetup/%E6%95%99%E7%B7%B4-%E6%88%91-%E5%8F%AA-%E6%83%B3%E5%AD%B8solidity-92b7ba8054f5","https://blog.zeppelin.solutions/designing-the-architecture-for-your-ethereum-application-9cec086f8317","http://truffleframework.com/tutorials/building-testing-frontend-app-truffle-3","http://truffle.tryblockchain.org/truffle3.0-integrate-nodejs.html","https://medium.com/taipei-ethereum-meetup/%E5%88%A9%E7%94%A8%E5%B7%A5%E5%85%B7%E5%8A%A0%E9%80%9Fdapp%E5%BB%BA%E7%BD%AE%E5%92%8C%E6%B8%AC%E8%A9%A6-fb08e77f208e"],"app":"steemit/0.1","format":"markdown"} |
| parent author | |
| parent permlink | cn |
| Transaction Info | Block #19052331/Trx f26611677d9f83437fd3fdb5156008c8ba4d080d |
View Raw JSON Data
{
"op": [
"comment",
{
"body": "\n\n之前有自己开发过 Ethereum 智能合约,但没有好好纪录开发的过程和碰到的问题,觉得满可惜。这次想重新开始,从最傻的姿势开始,一步步成长。**本篇希望将一个很简单的代币合约(只能发行和转帐),部署在本地和测试网路上,并测试其功能。**本篇是较详细描述使用 Remix 的步骤及使用上可能碰到的问题。\n\n## 开发环境\n\n> **不需要安装**,直接在任何浏览器开启 [Remix](https://remix.ethereum.org)。\n\nRemix 是一个 [Open Source](https://github.com/ethereum/remix) 的 [Solidity](https://solidity.readthedocs.io/en/develop/) 智能合约开发环境,提供基本的编译、部署至本地或测试网路、执行合约等功能。Solidity 是 Ethereum 官方设计和支援的程式语言,专门用于编写智能合约。\n\n\n\n## 取得代币合约\n\n代币合约的范例很多,[Ethereum 官网](https://www.ethereum.org/token)有提供一个最小可行的代币合约(MINIMUM VIABLE TOKEN):\n\n contract MyToken {\n /* This creates an array with all balances */\n mapping (address => uint256) public balanceOf;\n\n /* Initializes contract with initial supply tokens to the creator of the contract */\n function MyToken(\n uint256 initialSupply\n ) {\n balanceOf[msg.sender] = initialSupply; // Give the creator all initial tokens\n }\n\n /* Send coins */\n function transfer(address _to, uint256 _value) {\n require(balanceOf[msg.sender] >= _value); // Check if the sender has enough\n require(balanceOf[_to] + _value >= balanceOf[_to]); // Check for overflows\n balanceOf[msg.sender] -= _value; // Subtract from the sender\n balanceOf[_to] += _value; // Add the same to the recipient\n }\n }\n\n这个 MyToken 合约真的很傻,只能做两件事:\n- 创造代币:发起合约时创造指定数量的代币,代币拥有者是发起合约的 Ethereum 帐户\n- 转移代币:转移指定数量的代币到指定的 Ethereum 帐户\n\n---\n\n## 使用 Remix 编译合约\n\n#### 1. 点选右上角 **+** 新增一个档案\n名称任意只要副档名是 \".sol\"。\n\n\n\n#### 2. 复制合约内容到该档案并编译\nRemix 预设会自动编译。会看到旁边有橘橘的 warning,代表编译完了,但 warning 可先不管,不影响合约执行。\n\n\n## 在本地部署合约\n\n#### 1. 设定网路\n点选左边上面的 **run**。\n\n\n\nEnvironment 选择 **JavaScript VM** 代表所有资料都是存在本地记忆体(功能类似 testrpc)。它会提供 5 个虚拟帐户每个有 100 ETH,随便选一个帐户(要记住)。\n\n\n\n#### 2. 发送交易部署合约\n选择 **MyToken**。可以看到 **create** 按钮。且已根据合约内容显示必须填入 `initialSupply`(也就是要发行的代币数量)。输入一个数目并按 **create**,就会发送交易部署合约。\n\n\n\n合约部署成功后,可以看到合约的使用介面。Remix 会自动根据合约的内容,产生对应的合约使用介面。可以看到合约有两个功能:**balanceOf(查询余额)** 和 **transfer(转移代币)**。\n\n\n\n底下可以看到 log(纪录每一次的操作)。实际上部署合约是透过一个 Ethereum 交易完成,点 **Details** 可以看到该笔交易详细资料。\n\n\n---\n\n## 执行合约 - 查询余额\n\n#### 1. 选择刚刚发起合约的帐户\n\n\n#### 2. 输入帐户\n注意要用 **\"\"** 把帐户包起来,范例:\n\n \"0xca35b7d915458ef540ade6068dfe2f44e8fa733c\"\n\n#### 3. 点击 **balanceOf**\n可以在旁边看到执行结果,也就是目前这个帐户的代币余额。\n\n\n#### 错误情况\n说明一下,因为资料传送是用 JSON 格式,所以要加上 \"\"。如果忘记输入 \"\" 就会在 log 看到错误:\n\n\n\n### 执行合约 - 转移代币\n\n#### 1. 选择要转出的帐户\n\n选择刚刚发起合约的帐户。\n\n\n\n\n#### 2. 输入要转入的帐户\n选择并复制另一个帐户。在合约介面 **transfer** 后面的栏位,输入**转入帐户**和要**转移的代币数量**。帐户同样用 \"\" 包起来,范例:\n \n \"0x4b0897b0513fdc7c541b6d9d7e929c4e5364d2db\", 10\n\n#### 3. 点击 **transfer**\n点击 **transfer**,成功后会看到 log 更新。\n\n\n#### 4. 确认余额更新\n再查询转入帐户的余额,就可以看到代币余额增加啦!\n\n\n#### 错误情况\n如果选择要转出的帐户代币余额不足,这笔交易会失败,就会在 log 看到错误。\n\n\n---\n\n## 在测试网路部署合约\n\n#### 1. 安装 [MetaMask](https://metamask.io/)\n首先,要连到测试网路,就要安装 [MetaMask](https://metamask.io/)。他是浏览器端的 Ethereum 钱包,可以连结 Ethereum 主要和测试网路。安奘后需要建立 Ethereum 帐户,[教练,我”只”想学Solidity](https://medium.com/taipei-ethereum-meetup/%E6%95%99%E7%B7%B4-%E6%88%91-%E5%8F%AA-%E6%83%B3%E5%AD%B8solidity-92b7ba8054f5) 这篇有详细的步骤。\n\n\n\n\n\n\n\n#### 2. 选择测试网路\n回到 Remix,这次 Environment 选择 **Injected Web3**,Remix 会自动连结 MetaMask。\n\n\n\n#### 3. 部署合约\n接著用刚才同样的方式,按 **create** 部署合约,就会看到 MetaMask 的弹出视窗。直接按 **submit** 发送交易。\n\n\n\n稍等一点时间(因为要等这个交易被确认),部署成功后合约的使用介面就会跑出来。\n\n\n\n就可以用同样的方式使用合约啦!\n\n---\n\n## 总结\n\nRemix 提供一个 Solidity 智能合约的开发环境,可以简易的编译、部署、执行甚至除错,适合编程经验不多的初学者。但无法做到版本控制、测试及和其他开发工具一起使用等,实际要开发 [DApp](https://blog.zeppelin.solutions/designing-the-architecture-for-your-ethereum-application-9cec086f8317) 的话会比较不方便。下一篇会参考以下文章:\n- [BUILDING AND TESTING A FRONTEND APP WITH TRUFFLE](http://truffleframework.com/tutorials/building-testing-frontend-app-truffle-3)\n\n- [Truffle3.0集成NodeJS并完全跑通(附详细实例,可能的错误)](http://truffle.tryblockchain.org/truffle3.0-integrate-nodejs.html)\n\n- [利用工具加速Dapp建置和测试](https://medium.com/taipei-ethereum-meetup/%E5%88%A9%E7%94%A8%E5%B7%A5%E5%85%B7%E5%8A%A0%E9%80%9Fdapp%E5%BB%BA%E7%BD%AE%E5%92%8C%E6%B8%AC%E8%A9%A6-fb08e77f208e)\n\n使用 Truffle3、Ganache、web3.js 来编译和部署合约。",
"title": "【Ethereum 智能合约开发笔记】编译和部署合约的第一种姿势:使用 Remix",
"author": "ankar",
"permlink": "ethereum-remix",
"json_metadata": "{\"tags\":[\"cn\",\"blockchain\",\"ethereum\",\"solidity\",\"smart-contract\"],\"image\":[\"https://i.imgur.com/cpeSvtW.png\",\"https://i.imgur.com/U7KrIxB.png\",\"https://i.imgur.com/hRs9XhP.png\",\"https://i.imgur.com/8kVODQS.png\",\"https://i.imgur.com/s4b2Xwo.png\",\"https://i.imgur.com/RD1ZQTc.png\",\"https://i.imgur.com/QEEJNBb.png\",\"https://i.imgur.com/bsDeerq.png\",\"https://i.imgur.com/OK0OKJi.png\",\"https://i.imgur.com/xhpkjSS.png\",\"https://i.imgur.com/kboosK7.png\",\"https://i.imgur.com/D4sArGs.png\",\"https://i.imgur.com/5f0dHwl.png\",\"https://i.imgur.com/kn6TCCL.png\",\"https://i.imgur.com/JSuJo5z.png\",\"https://i.imgur.com/TFDNEMw.png\",\"https://i.imgur.com/7Tnp9GQ.png\",\"https://i.imgur.com/ZAwCW5E.png\",\"https://i.imgur.com/6vJYX9A.png\",\"https://i.imgur.com/XYjK7Ck.png\",\"https://i.imgur.com/Q64wrRT.png\"],\"links\":[\"https://remix.ethereum.org\",\"https://github.com/ethereum/remix\",\"https://solidity.readthedocs.io/en/develop/\",\"https://www.ethereum.org/token\",\"https://metamask.io/\",\"https://medium.com/taipei-ethereum-meetup/%E6%95%99%E7%B7%B4-%E6%88%91-%E5%8F%AA-%E6%83%B3%E5%AD%B8solidity-92b7ba8054f5\",\"https://blog.zeppelin.solutions/designing-the-architecture-for-your-ethereum-application-9cec086f8317\",\"http://truffleframework.com/tutorials/building-testing-frontend-app-truffle-3\",\"http://truffle.tryblockchain.org/truffle3.0-integrate-nodejs.html\",\"https://medium.com/taipei-ethereum-meetup/%E5%88%A9%E7%94%A8%E5%B7%A5%E5%85%B7%E5%8A%A0%E9%80%9Fdapp%E5%BB%BA%E7%BD%AE%E5%92%8C%E6%B8%AC%E8%A9%A6-fb08e77f208e\"],\"app\":\"steemit/0.1\",\"format\":\"markdown\"}",
"parent_author": "",
"parent_permlink": "cn"
}
],
"block": 19052331,
"trx_id": "f26611677d9f83437fd3fdb5156008c8ba4d080d",
"op_in_trx": 0,
"timestamp": "2018-01-17T08:45:27",
"virtual_op": false,
"trx_in_block": 23
}ankarupdated payout for re-liubo0622-re-ankar-ark-dpos-smartbridges-20180109t163800234z2018/01/16 16:38:00
ankarupdated payout for re-liubo0622-re-ankar-ark-dpos-smartbridges-20180109t163800234z
2018/01/16 16:38:00
| author | ankar |
| permlink | re-liubo0622-re-ankar-ark-dpos-smartbridges-20180109t163800234z |
| Transaction Info | Block #19032985/Virtual Operation 4294967295:8 |
View Raw JSON Data
{
"op": [
"comment_payout_update",
{
"author": "ankar",
"permlink": "re-liubo0622-re-ankar-ark-dpos-smartbridges-20180109t163800234z"
}
],
"block": 19032985,
"trx_id": "0000000000000000000000000000000000000000",
"op_in_trx": 8,
"timestamp": "2018-01-16T16:38:00",
"virtual_op": true,
"trx_in_block": 4294967295
}ankarupdated payout for ark-dpos-smartbridges2018/01/16 09:28:06
ankarupdated payout for ark-dpos-smartbridges
2018/01/16 09:28:06
| author | ankar |
| permlink | ark-dpos-smartbridges |
| Transaction Info | Block #19024389/Virtual Operation 4294967295:6 |
View Raw JSON Data
{
"op": [
"comment_payout_update",
{
"author": "ankar",
"permlink": "ark-dpos-smartbridges"
}
],
"block": 19024389,
"trx_id": "0000000000000000000000000000000000000000",
"op_in_trx": 6,
"timestamp": "2018-01-16T09:28:06",
"virtual_op": true,
"trx_in_block": 4294967295
}ankarreceived 0.040 HBD reward share for ark-dpos-smartbridges2018/01/16 09:28:06
ankarreceived 0.040 HBD reward share for ark-dpos-smartbridges
2018/01/16 09:28:06
| author | ankar |
| payout | 0.040 HBD |
| permlink | ark-dpos-smartbridges |
| author rewards | 7 |
| total payout value | 0.040 HBD |
| curator payout value | 0.000 HBD |
| beneficiary payout value | 0.000 HBD |
| Transaction Info | Block #19024389/Virtual Operation 4294967295:5 |
View Raw JSON Data
{
"op": [
"comment_reward",
{
"author": "ankar",
"payout": "0.040 HBD",
"permlink": "ark-dpos-smartbridges",
"author_rewards": 7,
"total_payout_value": "0.040 HBD",
"curator_payout_value": "0.000 HBD",
"beneficiary_payout_value": "0.000 HBD"
}
],
"block": 19024389,
"trx_id": "0000000000000000000000000000000000000000",
"op_in_trx": 5,
"timestamp": "2018-01-16T09:28:06",
"virtual_op": true,
"trx_in_block": 4294967295
}ankarreceived 0.017 HBD, 0.005 HP author reward for @ankar / ark-dpos-smartbridges2018/01/16 09:28:06
ankarreceived 0.017 HBD, 0.005 HP author reward for @ankar / ark-dpos-smartbridges
2018/01/16 09:28:06
| author | ankar |
| permlink | ark-dpos-smartbridges |
| hbd payout | 0.017 HBD |
| hive payout | 0.000 HIVE |
| vesting payout | 8.190552 VESTS |
| payout must be claimed | true |
| curators vesting payout | 0.000000 VESTS |
| Transaction Info | Block #19024389/Virtual Operation 4294967295:4 |
View Raw JSON Data
{
"op": [
"author_reward",
{
"author": "ankar",
"permlink": "ark-dpos-smartbridges",
"hbd_payout": "0.017 HBD",
"hive_payout": "0.000 HIVE",
"vesting_payout": "8.190552 VESTS",
"payout_must_be_claimed": true,
"curators_vesting_payout": "0.000000 VESTS"
}
],
"block": 19024389,
"trx_id": "0000000000000000000000000000000000000000",
"op_in_trx": 4,
"timestamp": "2018-01-16T09:28:06",
"virtual_op": true,
"trx_in_block": 4294967295
}ankarpublished a new post: ark-dpos-smartbridges2018/01/12 05:56:12
ankarpublished a new post: ark-dpos-smartbridges
2018/01/12 05:56:12
| body | @@ -650,16 +650,20 @@ %E6%B5%81%E4%BA%A7%E7%94%9F%E6%96%B0%E7%9A%84%E5%8C%BA%E5%9D%97%E3%80%82 +%0A%0A%3E delegate @@ -770,16 +770,18 @@ %E8%AE%BA%E7%9A%84%E6%83%85%E5%86%B5%E6%BB%A1%E8%B8%8A%E8%B7%83%E3%80%82 +%0A%0A %E8%BF%99%E4%B8%AA%E6%9E%B6%E6%9E%84%E5%A5%BD%E5%A4%84%E6%98%AF%E7%AE%80 @@ -1251,16 +1251,18 @@ ridges%0A%0A +%3E ARK %E4%BD%BF%E7%94%A8%E8%80%85%E5%8F%AF @@ -1293,16 +1293,18 @@ %E5%8A%A8%EF%BC%8C%E5%90%AC%E8%B5%B7%E6%9D%A5%E5%BE%88%E9%85%B7%E3%80%82 +%0A%0A %E5%AE%9E%E9%99%85%E4%B8%8A Smar @@ -2924,18 +2924,18 @@ %E9%A1%B9%E6%94%B9%E5%96%84%E3%80%82%E5%85%B6%E4%BB%96 A -rk +RK %E7%9A%84%E6%9C%AA%E6%9D%A5%E5%8F%91%E5%B1%95%E4%B9%9F%E5%8F%AF |
| title | ARK "All-in-One Blockchain Solutions" 的特别之处 |
| author | ankar |
| permlink | ark-dpos-smartbridges |
| json metadata | {"tags":["cn","blockchain","ark","lisk","eth"],"image":["https://i.imgur.com/zO6xain.jpg","https://i.imgur.com/vRYD7PD.png","https://i.imgur.com/MyHbbrb.png","https://i.imgur.com/JbKNndC.png"],"links":["https://ARK.io/","https://lisk.io/","https://www.jianshu.com/p/b76649f4ae02","https://forum.ARK.io/category/5/delegates","https://github.com/ARKEcosystem/ARK-node/tree/development/helpers","https://explorer.ARK.land/delegateMonitor","https://github.com/ARKEcosystem/ARK-desktop/releases","https://blog.ARK.io/what-is-the-ARK-smartbridge-and-how-does-it-work-1dd7fb1e17a0","https://medium.com/@ARKaces/aces-completes-ARK-authentication-listeners-for-ARK-bitcoin-ethereum-and-litecoin-ff98c1c792cf","https://aces-ARK.io/aces-app/about","https://blockchain.info/charts/transactions-per-second","https://ark.io/roadmap","https://ARK.io/Whitepaper.pdf","https://github.com/ARKEcosystem","https://ARK.io/slack"],"app":"steemit/0.1","format":"markdown"} |
| parent author | |
| parent permlink | cn |
| Transaction Info | Block #18905086/Trx 4856c428f31bc534d15e9a384780ddebd932096f |
View Raw JSON Data
{
"op": [
"comment",
{
"body": "@@ -650,16 +650,20 @@\n %E6%B5%81%E4%BA%A7%E7%94%9F%E6%96%B0%E7%9A%84%E5%8C%BA%E5%9D%97%E3%80%82\n+%0A%0A%3E \n delegate\n@@ -770,16 +770,18 @@\n %E8%AE%BA%E7%9A%84%E6%83%85%E5%86%B5%E6%BB%A1%E8%B8%8A%E8%B7%83%E3%80%82\n+%0A%0A\n %E8%BF%99%E4%B8%AA%E6%9E%B6%E6%9E%84%E5%A5%BD%E5%A4%84%E6%98%AF%E7%AE%80\n@@ -1251,16 +1251,18 @@\n ridges%0A%0A\n+%3E \n ARK %E4%BD%BF%E7%94%A8%E8%80%85%E5%8F%AF\n@@ -1293,16 +1293,18 @@\n %E5%8A%A8%EF%BC%8C%E5%90%AC%E8%B5%B7%E6%9D%A5%E5%BE%88%E9%85%B7%E3%80%82\n+%0A%0A\n %E5%AE%9E%E9%99%85%E4%B8%8A Smar\n@@ -2924,18 +2924,18 @@\n %E9%A1%B9%E6%94%B9%E5%96%84%E3%80%82%E5%85%B6%E4%BB%96 A\n-rk\n+RK\n %E7%9A%84%E6%9C%AA%E6%9D%A5%E5%8F%91%E5%B1%95%E4%B9%9F%E5%8F%AF\n",
"title": "ARK \"All-in-One Blockchain Solutions\" 的特别之处",
"author": "ankar",
"permlink": "ark-dpos-smartbridges",
"json_metadata": "{\"tags\":[\"cn\",\"blockchain\",\"ark\",\"lisk\",\"eth\"],\"image\":[\"https://i.imgur.com/zO6xain.jpg\",\"https://i.imgur.com/vRYD7PD.png\",\"https://i.imgur.com/MyHbbrb.png\",\"https://i.imgur.com/JbKNndC.png\"],\"links\":[\"https://ARK.io/\",\"https://lisk.io/\",\"https://www.jianshu.com/p/b76649f4ae02\",\"https://forum.ARK.io/category/5/delegates\",\"https://github.com/ARKEcosystem/ARK-node/tree/development/helpers\",\"https://explorer.ARK.land/delegateMonitor\",\"https://github.com/ARKEcosystem/ARK-desktop/releases\",\"https://blog.ARK.io/what-is-the-ARK-smartbridge-and-how-does-it-work-1dd7fb1e17a0\",\"https://medium.com/@ARKaces/aces-completes-ARK-authentication-listeners-for-ARK-bitcoin-ethereum-and-litecoin-ff98c1c792cf\",\"https://aces-ARK.io/aces-app/about\",\"https://blockchain.info/charts/transactions-per-second\",\"https://ark.io/roadmap\",\"https://ARK.io/Whitepaper.pdf\",\"https://github.com/ARKEcosystem\",\"https://ARK.io/slack\"],\"app\":\"steemit/0.1\",\"format\":\"markdown\"}",
"parent_author": "",
"parent_permlink": "cn"
}
],
"block": 18905086,
"trx_id": "4856c428f31bc534d15e9a384780ddebd932096f",
"op_in_trx": 0,
"timestamp": "2018-01-12T05:56:12",
"virtual_op": false,
"trx_in_block": 26
}ubgeffective vote applied for @ankar / ark-dpos-smartbridges2018/01/11 17:31:48
ubgeffective vote applied for @ankar / ark-dpos-smartbridges
2018/01/11 17:31:48
| voter | ubg |
| author | ankar |
| weight | 1592 (15.92%) |
| rshares | 208686482 |
| permlink | ark-dpos-smartbridges |
| pending payout | 0.042 HBD |
| total vote weight | 63100 |
| Transaction Info | Block #18890207/Trx 17b19367a147f2e4a266882d1a16ece669772023 |
View Raw JSON Data
{
"op": [
"effective_comment_vote",
{
"voter": "ubg",
"author": "ankar",
"weight": 1592,
"rshares": 208686482,
"permlink": "ark-dpos-smartbridges",
"pending_payout": "0.042 HBD",
"total_vote_weight": 63100
}
],
"block": 18890207,
"trx_id": "17b19367a147f2e4a266882d1a16ece669772023",
"op_in_trx": 1,
"timestamp": "2018-01-11T17:31:48",
"virtual_op": true,
"trx_in_block": 19
}ubgupvoted (1.00%) @ankar / ark-dpos-smartbridges2018/01/11 17:31:48
ubgupvoted (1.00%) @ankar / ark-dpos-smartbridges
2018/01/11 17:31:48
| voter | ubg |
| author | ankar |
| weight | 100 (1.00%) |
| permlink | ark-dpos-smartbridges |
| Transaction Info | Block #18890207/Trx 17b19367a147f2e4a266882d1a16ece669772023 |
View Raw JSON Data
{
"op": [
"vote",
{
"voter": "ubg",
"author": "ankar",
"weight": 100,
"permlink": "ark-dpos-smartbridges"
}
],
"block": 18890207,
"trx_id": "17b19367a147f2e4a266882d1a16ece669772023",
"op_in_trx": 0,
"timestamp": "2018-01-11T17:31:48",
"virtual_op": false,
"trx_in_block": 19
}ankarpublished a new post: ark-dpos-smartbridges2018/01/11 17:21:18
ankarpublished a new post: ark-dpos-smartbridges
2018/01/11 17:21:18
| body |  [ARK](https://ARK.io/) 的宗旨是**使区块链被更广泛使用**(increasing consumer adoption)。以技术上来说 ARK 是基于一个 **DPOS 区块链**,并有原生的 **ARK** 虚拟货币。最主要的功能是让使用者可透过 ARK 平台和其他区块链互动,他们称这个技术叫做 “**SmartBridges**”。如果未来区块链被广泛地使用,不太可能使用者在每次使用前都要先透过交易所兑换;如果可以透过单一入口和其他区块链互动,确实更能让使用者接受。ARK 主网已于 2017/3 上线,且有相当活跃的社群。本文主要希望了解 ARK 的核心部分,**DPOS 区块链** 和 **SmartBridges**。 ## DPOS 区块链 ARK 的 DPOS 区块链完全基于 [Lisk](https://lisk.io/)(详细可参考我翻译的另一篇文章 [Lisk 简介 - DPOS 共识网路](https://www.jianshu.com/p/b76649f4ae02))。但 ARK 在参数上做调整,共有 51 个 delegated 节点,负责产生新区块。delegated 节点可收取 2 ARK(随时间递减) 的区块报酬和交易手续费。每 8 秒产生一个新区块。每一轮均由 51 个 delegated 节点轮流产生新的区块。delegated 节点由社群共同选出,任何人只要花费 25 ARK(stake)都有资格参选。[官方论坛](https://forum.ARK.io/category/5/delegates)上可以看到大家参选和讨论的情况满踊跃。这个架构好处是简单易懂,且完全可由社群自主经营,并且目前已上线证明初步可行。大多参选者为了吸引投票者,会将得到的所有报酬按比例分给投票者,很大程度弥补了许多区块链技术在交易量扩大后产生交易手续费过高的问题。而根据白皮数描述目前交易上限是 25 tx/block(在 [ARK-node](https://github.com/ARKEcosystem/ARK-node/tree/development/helpers) 实作中每个区块约 2MB 的交易资料 payload),白皮书中有提到许多改进方式,具题如何还有待之后的更新版本释出。 可透过 [ARK Blockchain Explorer](https://explorer.ARK.land/delegateMonitor) 看到即时的出块情况,包含即将要出块的 delegated 节点和所有 delegated 节点的详细资讯等:  ## SmartBridges ARK 使用者可以透过 SmartBridges 和其他区块链互动,听起来很酷。实际上 SmartBridges 由两个部分组成:交易中附加的一段资料和负责监听那段资料并执行对应动作的 **Listener**(监听者)。下图描述一个流程**从一个 ARK 帐户发起一个交易送 ETH 至一个 ETH 帐户**:  这是一个简略的流程,补充几点没有描述到的部分: ### 如何在 ARK 交易中附加一段 SmartBridges 资料? ARK 交易中包含一特定栏位叫 **vendorField**(value: a string),只需将 SmartBridges 资料填入该栏位即可。建议可使用[桌面版钱包](https://github.com/ARKEcosystem/ARK-desktop/releases):  ### Listener 如何将 ARK 转换成 ETH? 在这篇 [ARK 共同创办人的文章](https://blog.ARK.io/what-is-the-ARK-smartbridge-and-how-does-it-work-1dd7fb1e17a0) 中提到,Listener 在这个情境下需要介接可币换币的交易所(例如:Shapeshift)。因为汇率变动快,使用者在送交易前应先向 Listener 查询目前汇率及所需要的手续费。并先取得 Listener 提供的一段 SmartBridges 资料,再送交易时填入 **vendorField**,借此让 Listener 识别出这个交易。在 Listener 收到包含此段 SmartBridges 资料的交易时,将 ARK 扣除手续费后和交易所兑换等值 ETH,并发送至使用者指定的 ETH 帐户。 根据 [ACES Completes ARK Authentication Listeners for ARK, Bitcoin, Ethereum, and Litecoin](https://medium.com/@ARKaces/aces-completes-ARK-authentication-listeners-for-ARK-bitcoin-ethereum-and-litecoin-ff98c1c792cf) 目前已实作出比特币、以太坊和莱特币的 Listener,这部分笔者还没下载来测试过但均有开源。也有 [live demo](https://aces-ARK.io/aces-app/about) 可以实际操作用 ARK 交换 testnet(Ropsten) ETH。 ### 小结 根据以上,使用 ARK 透过 SmartBridges 交换 ETH,和直接使用 Shapeshift 这类服务的差别在,透过使用 SmartBridges 可将这笔交易请求纪录在区块链上,付款后如果 Shapeshift 系统出问题或甚至不认帐,可以有一个可靠的资料来源佐证确实有这笔交易请求,但这也仰赖 Listener 的服务提供商做可靠的担保,实际接受度有赖这类服务上线后市场验证。另外,以此类推也可以使用 ARK 透过 SmartBridges 调用以太坊智能合约,甚至未来有其他的智能合约平台出现,只要实作该平台对应的 Listener 就可用同样方式与之互动。而目前主要问题是在限制节点数量的情况下,目前 TPS(约等于[比特币](https://blockchain.info/charts/transactions-per-second)) 太低,ARK Core V2 声称会重写整个 core,包含增加 TPS 及许多项改善。其他 Ark 的未来发展也可参考 [ARK roadmap](https://ark.io/roadmap)。 ## References - [ARK whitepaper](https://ARK.io/Whitepaper.pdf) - [ARK Github](https://github.com/ARKEcosystem) - [ARK Slack](https://ARK.io/slack) |
| title | ARK "All-in-One Blockchain Solutions" 的特别之处 |
| author | ankar |
| permlink | ark-dpos-smartbridges |
| json metadata | {"tags":["cn","blockchain","ark","lisk","eth"],"image":["https://i.imgur.com/zO6xain.jpg","https://i.imgur.com/vRYD7PD.png","https://i.imgur.com/MyHbbrb.png","https://i.imgur.com/JbKNndC.png"],"links":["https://ARK.io/","https://lisk.io/","https://www.jianshu.com/p/b76649f4ae02","https://forum.ARK.io/category/5/delegates","https://github.com/ARKEcosystem/ARK-node/tree/development/helpers","https://explorer.ARK.land/delegateMonitor","https://github.com/ARKEcosystem/ARK-desktop/releases","https://blog.ARK.io/what-is-the-ARK-smartbridge-and-how-does-it-work-1dd7fb1e17a0","https://medium.com/@ARKaces/aces-completes-ARK-authentication-listeners-for-ARK-bitcoin-ethereum-and-litecoin-ff98c1c792cf","https://aces-ARK.io/aces-app/about","https://blockchain.info/charts/transactions-per-second","https://ark.io/roadmap","https://ARK.io/Whitepaper.pdf","https://github.com/ARKEcosystem","https://ARK.io/slack"],"app":"steemit/0.1","format":"markdown"} |
| parent author | |
| parent permlink | cn |
| Transaction Info | Block #18889997/Trx 28e59a6356d447b168cf9d5e9bed2049d4b80933 |
View Raw JSON Data
{
"op": [
"comment",
{
"body": "\n\n[ARK](https://ARK.io/) 的宗旨是**使区块链被更广泛使用**(increasing consumer adoption)。以技术上来说 ARK 是基于一个 **DPOS 区块链**,并有原生的 **ARK** 虚拟货币。最主要的功能是让使用者可透过 ARK 平台和其他区块链互动,他们称这个技术叫做 “**SmartBridges**”。如果未来区块链被广泛地使用,不太可能使用者在每次使用前都要先透过交易所兑换;如果可以透过单一入口和其他区块链互动,确实更能让使用者接受。ARK 主网已于 2017/3 上线,且有相当活跃的社群。本文主要希望了解 ARK 的核心部分,**DPOS 区块链** 和 **SmartBridges**。\n\n## DPOS 区块链\n\nARK 的 DPOS 区块链完全基于 [Lisk](https://lisk.io/)(详细可参考我翻译的另一篇文章 [Lisk 简介 - DPOS 共识网路](https://www.jianshu.com/p/b76649f4ae02))。但 ARK 在参数上做调整,共有 51 个 delegated 节点,负责产生新区块。delegated 节点可收取 2 ARK(随时间递减) 的区块报酬和交易手续费。每 8 秒产生一个新区块。每一轮均由 51 个 delegated 节点轮流产生新的区块。delegated 节点由社群共同选出,任何人只要花费 25 ARK(stake)都有资格参选。[官方论坛](https://forum.ARK.io/category/5/delegates)上可以看到大家参选和讨论的情况满踊跃。这个架构好处是简单易懂,且完全可由社群自主经营,并且目前已上线证明初步可行。大多参选者为了吸引投票者,会将得到的所有报酬按比例分给投票者,很大程度弥补了许多区块链技术在交易量扩大后产生交易手续费过高的问题。而根据白皮数描述目前交易上限是 25 tx/block(在 [ARK-node](https://github.com/ARKEcosystem/ARK-node/tree/development/helpers) 实作中每个区块约 2MB 的交易资料 payload),白皮书中有提到许多改进方式,具题如何还有待之后的更新版本释出。\n\n可透过 [ARK Blockchain Explorer](https://explorer.ARK.land/delegateMonitor) 看到即时的出块情况,包含即将要出块的 delegated 节点和所有 delegated 节点的详细资讯等:\n\n\n\n## SmartBridges\n\nARK 使用者可以透过 SmartBridges 和其他区块链互动,听起来很酷。实际上 SmartBridges 由两个部分组成:交易中附加的一段资料和负责监听那段资料并执行对应动作的 **Listener**(监听者)。下图描述一个流程**从一个 ARK 帐户发起一个交易送 ETH 至一个 ETH 帐户**:\n\n\n\n这是一个简略的流程,补充几点没有描述到的部分:\n\n### 如何在 ARK 交易中附加一段 SmartBridges 资料?\n\nARK 交易中包含一特定栏位叫 **vendorField**(value: a string),只需将 SmartBridges 资料填入该栏位即可。建议可使用[桌面版钱包](https://github.com/ARKEcosystem/ARK-desktop/releases):\n\n\n\n### Listener 如何将 ARK 转换成 ETH?\n\n在这篇 [ARK 共同创办人的文章](https://blog.ARK.io/what-is-the-ARK-smartbridge-and-how-does-it-work-1dd7fb1e17a0) 中提到,Listener 在这个情境下需要介接可币换币的交易所(例如:Shapeshift)。因为汇率变动快,使用者在送交易前应先向 Listener 查询目前汇率及所需要的手续费。并先取得 Listener 提供的一段 SmartBridges 资料,再送交易时填入 **vendorField**,借此让 Listener 识别出这个交易。在 Listener 收到包含此段 SmartBridges 资料的交易时,将 ARK 扣除手续费后和交易所兑换等值 ETH,并发送至使用者指定的 ETH 帐户。\n\n根据 [ACES Completes ARK Authentication Listeners for ARK, Bitcoin, Ethereum, and Litecoin](https://medium.com/@ARKaces/aces-completes-ARK-authentication-listeners-for-ARK-bitcoin-ethereum-and-litecoin-ff98c1c792cf) 目前已实作出比特币、以太坊和莱特币的 Listener,这部分笔者还没下载来测试过但均有开源。也有 [live demo](https://aces-ARK.io/aces-app/about) 可以实际操作用 ARK 交换 testnet(Ropsten) ETH。\n\n### 小结\n\n根据以上,使用 ARK 透过 SmartBridges 交换 ETH,和直接使用 Shapeshift 这类服务的差别在,透过使用 SmartBridges 可将这笔交易请求纪录在区块链上,付款后如果 Shapeshift 系统出问题或甚至不认帐,可以有一个可靠的资料来源佐证确实有这笔交易请求,但这也仰赖 Listener 的服务提供商做可靠的担保,实际接受度有赖这类服务上线后市场验证。另外,以此类推也可以使用 ARK 透过 SmartBridges 调用以太坊智能合约,甚至未来有其他的智能合约平台出现,只要实作该平台对应的 Listener 就可用同样方式与之互动。而目前主要问题是在限制节点数量的情况下,目前 TPS(约等于[比特币](https://blockchain.info/charts/transactions-per-second)) 太低,ARK Core V2 声称会重写整个 core,包含增加 TPS 及许多项改善。其他 Ark 的未来发展也可参考 [ARK roadmap](https://ark.io/roadmap)。\n\n## References\n\n- [ARK whitepaper](https://ARK.io/Whitepaper.pdf)\n- [ARK Github](https://github.com/ARKEcosystem)\n- [ARK Slack](https://ARK.io/slack)",
"title": "ARK \"All-in-One Blockchain Solutions\" 的特别之处",
"author": "ankar",
"permlink": "ark-dpos-smartbridges",
"json_metadata": "{\"tags\":[\"cn\",\"blockchain\",\"ark\",\"lisk\",\"eth\"],\"image\":[\"https://i.imgur.com/zO6xain.jpg\",\"https://i.imgur.com/vRYD7PD.png\",\"https://i.imgur.com/MyHbbrb.png\",\"https://i.imgur.com/JbKNndC.png\"],\"links\":[\"https://ARK.io/\",\"https://lisk.io/\",\"https://www.jianshu.com/p/b76649f4ae02\",\"https://forum.ARK.io/category/5/delegates\",\"https://github.com/ARKEcosystem/ARK-node/tree/development/helpers\",\"https://explorer.ARK.land/delegateMonitor\",\"https://github.com/ARKEcosystem/ARK-desktop/releases\",\"https://blog.ARK.io/what-is-the-ARK-smartbridge-and-how-does-it-work-1dd7fb1e17a0\",\"https://medium.com/@ARKaces/aces-completes-ARK-authentication-listeners-for-ARK-bitcoin-ethereum-and-litecoin-ff98c1c792cf\",\"https://aces-ARK.io/aces-app/about\",\"https://blockchain.info/charts/transactions-per-second\",\"https://ark.io/roadmap\",\"https://ARK.io/Whitepaper.pdf\",\"https://github.com/ARKEcosystem\",\"https://ARK.io/slack\"],\"app\":\"steemit/0.1\",\"format\":\"markdown\"}",
"parent_author": "",
"parent_permlink": "cn"
}
],
"block": 18889997,
"trx_id": "28e59a6356d447b168cf9d5e9bed2049d4b80933",
"op_in_trx": 0,
"timestamp": "2018-01-11T17:21:18",
"virtual_op": false,
"trx_in_block": 1
}ankarclaimed reward balance: 0.472 HBD, 0.100 HP2018/01/11 08:13:36
ankarclaimed reward balance: 0.472 HBD, 0.100 HP
2018/01/11 08:13:36
| account | ankar |
| reward hbd | 0.472 HBD |
| reward hive | 0.000 HIVE |
| reward vests | 161.809465 VESTS |
| Transaction Info | Block #18879044/Trx 6cdddf8d472fd19e693431699e856c642ced75f4 |
View Raw JSON Data
{
"op": [
"claim_reward_balance",
{
"account": "ankar",
"reward_hbd": "0.472 HBD",
"reward_hive": "0.000 HIVE",
"reward_vests": "161.809465 VESTS"
}
],
"block": 18879044,
"trx_id": "6cdddf8d472fd19e693431699e856c642ced75f4",
"op_in_trx": 0,
"timestamp": "2018-01-11T08:13:36",
"virtual_op": false,
"trx_in_block": 36
}ankarfollowed @lunaspeed2018/01/11 08:13:06
ankarfollowed @lunaspeed
2018/01/11 08:13:06
| id | follow |
| json | ["follow",{"follower":"ankar","following":"lunaspeed","what":["blog"]}] |
| required auths | [] |
| required posting auths | ["ankar"] |
| Transaction Info | Block #18879034/Trx 05bceb92d60d62233bc37970d4468f1acf4d5c12 |
View Raw JSON Data
{
"op": [
"custom_json",
{
"id": "follow",
"json": "[\"follow\",{\"follower\":\"ankar\",\"following\":\"lunaspeed\",\"what\":[\"blog\"]}]",
"required_auths": [],
"required_posting_auths": [
"ankar"
]
}
],
"block": 18879034,
"trx_id": "05bceb92d60d62233bc37970d4468f1acf4d5c12",
"op_in_trx": 0,
"timestamp": "2018-01-11T08:13:06",
"virtual_op": false,
"trx_in_block": 16
}ankareffective vote applied for @lunaspeed / 5ltmjr2018/01/11 08:12:54
ankareffective vote applied for @lunaspeed / 5ltmjr
2018/01/11 08:12:54
| voter | ankar |
| author | lunaspeed |
| weight | 39000 |
| rshares | 2516580685 |
| permlink | 5ltmjr |
| pending payout | 0.030 HBD |
| total vote weight | 53560 |
| Transaction Info | Block #18879030/Trx 837c99d6d4182a0ef6085b4f3bc12fcdf04da586 |
View Raw JSON Data
{
"op": [
"effective_comment_vote",
{
"voter": "ankar",
"author": "lunaspeed",
"weight": 39000,
"rshares": 2516580685,
"permlink": "5ltmjr",
"pending_payout": "0.030 HBD",
"total_vote_weight": 53560
}
],
"block": 18879030,
"trx_id": "837c99d6d4182a0ef6085b4f3bc12fcdf04da586",
"op_in_trx": 1,
"timestamp": "2018-01-11T08:12:54",
"virtual_op": true,
"trx_in_block": 2
}ankarupvoted (100.00%) @lunaspeed / 5ltmjr2018/01/11 08:12:54
ankarupvoted (100.00%) @lunaspeed / 5ltmjr
2018/01/11 08:12:54
| voter | ankar |
| author | lunaspeed |
| weight | 10000 (100.00%) |
| permlink | 5ltmjr |
| Transaction Info | Block #18879030/Trx 837c99d6d4182a0ef6085b4f3bc12fcdf04da586 |
View Raw JSON Data
{
"op": [
"vote",
{
"voter": "ankar",
"author": "lunaspeed",
"weight": 10000,
"permlink": "5ltmjr"
}
],
"block": 18879030,
"trx_id": "837c99d6d4182a0ef6085b4f3bc12fcdf04da586",
"op_in_trx": 0,
"timestamp": "2018-01-11T08:12:54",
"virtual_op": false,
"trx_in_block": 2
}2018/01/11 07:08:09
2018/01/11 07:08:09
| author | ankar |
| permlink | lisk-dpos |
| Transaction Info | Block #18877735/Virtual Operation 4294967295:15 |
View Raw JSON Data
{
"op": [
"comment_payout_update",
{
"author": "ankar",
"permlink": "lisk-dpos"
}
],
"block": 18877735,
"trx_id": "0000000000000000000000000000000000000000",
"op_in_trx": 15,
"timestamp": "2018-01-11T07:08:09",
"virtual_op": true,
"trx_in_block": 4294967295
}2018/01/11 07:08:09
2018/01/11 07:08:09
| author | ankar |
| payout | 0.035 HBD |
| permlink | lisk-dpos |
| author rewards | 6 |
| total payout value | 0.034 HBD |
| curator payout value | 0.000 HBD |
| beneficiary payout value | 0.000 HBD |
| Transaction Info | Block #18877735/Virtual Operation 4294967295:14 |
View Raw JSON Data
{
"op": [
"comment_reward",
{
"author": "ankar",
"payout": "0.035 HBD",
"permlink": "lisk-dpos",
"author_rewards": 6,
"total_payout_value": "0.034 HBD",
"curator_payout_value": "0.000 HBD",
"beneficiary_payout_value": "0.000 HBD"
}
],
"block": 18877735,
"trx_id": "0000000000000000000000000000000000000000",
"op_in_trx": 14,
"timestamp": "2018-01-11T07:08:09",
"virtual_op": true,
"trx_in_block": 4294967295
}2018/01/11 07:08:09
2018/01/11 07:08:09
| author | ankar |
| permlink | lisk-dpos |
| hbd payout | 0.017 HBD |
| hive payout | 0.000 HIVE |
| vesting payout | 6.144448 VESTS |
| payout must be claimed | true |
| curators vesting payout | 0.000000 VESTS |
| Transaction Info | Block #18877735/Virtual Operation 4294967295:13 |
View Raw JSON Data
{
"op": [
"author_reward",
{
"author": "ankar",
"permlink": "lisk-dpos",
"hbd_payout": "0.017 HBD",
"hive_payout": "0.000 HIVE",
"vesting_payout": "6.144448 VESTS",
"payout_must_be_claimed": true,
"curators_vesting_payout": "0.000000 VESTS"
}
],
"block": 18877735,
"trx_id": "0000000000000000000000000000000000000000",
"op_in_trx": 13,
"timestamp": "2018-01-11T07:08:09",
"virtual_op": true,
"trx_in_block": 4294967295
}2018/01/11 07:02:30
2018/01/11 07:02:30
| author | ankar |
| permlink | lisk |
| Transaction Info | Block #18877622/Virtual Operation 4294967295:12 |
View Raw JSON Data
{
"op": [
"comment_payout_update",
{
"author": "ankar",
"permlink": "lisk"
}
],
"block": 18877622,
"trx_id": "0000000000000000000000000000000000000000",
"op_in_trx": 12,
"timestamp": "2018-01-11T07:02:30",
"virtual_op": true,
"trx_in_block": 4294967295
}2018/01/11 07:02:30
2018/01/11 07:02:30
| author | ankar |
| payout | 0.380 HBD |
| permlink | lisk |
| author rewards | 53 |
| total payout value | 0.314 HBD |
| curator payout value | 0.065 HBD |
| beneficiary payout value | 0.000 HBD |
| Transaction Info | Block #18877622/Virtual Operation 4294967295:11 |
View Raw JSON Data
{
"op": [
"comment_reward",
{
"author": "ankar",
"payout": "0.380 HBD",
"permlink": "lisk",
"author_rewards": 53,
"total_payout_value": "0.314 HBD",
"curator_payout_value": "0.065 HBD",
"beneficiary_payout_value": "0.000 HBD"
}
],
"block": 18877622,
"trx_id": "0000000000000000000000000000000000000000",
"op_in_trx": 11,
"timestamp": "2018-01-11T07:02:30",
"virtual_op": true,
"trx_in_block": 4294967295
}Manabar
Voting Power100.00%
Downvote Power100.00%
Resource Credits100.00%
Reputation Progress0.00%
{
"voting_manabar": {
"current_mana": 9800,
"last_update_time": 1516963554
},
"downvote_manabar": {
"current_mana": 0,
"last_update_time": 1486708533
},
"rc_account": {
"account": "ankar",
"delegated_rc": 0,
"max_rc": 128046384705,
"max_rc_creation_adjustment": {
"amount": "2020748973",
"nai": "@@000000037",
"precision": 6
},
"rc_manabar": {
"current_mana": 128046384705,
"last_update_time": 1537887600
},
"received_delegated_rc": 0
}
}Account Metadata
| POSTING JSON METADATA | |
| profile | {"profile_image":"https://i.imgur.com/aI2eaY6.jpg","name":"Anderson"} |
| JSON METADATA | |
| profile | {"profile_image":"https://i.imgur.com/aI2eaY6.jpg","name":"Anderson"} |
{
"posting_json_metadata": {
"profile": {
"profile_image": "https://i.imgur.com/aI2eaY6.jpg",
"name": "Anderson"
}
},
"json_metadata": {
"profile": {
"profile_image": "https://i.imgur.com/aI2eaY6.jpg",
"name": "Anderson"
}
}
}Auth Keys
Owner
Single Signature
Public Keys
STM67peFvhJTUKFv26sQ5bAM2vqhF1sCAd1vXfAudkEy32TZvzMzh1/1
Active
Single Signature
Public Keys
STM78P9YGUT2Hi8xZd3Qo7UqpUJHsbqVWTJ7qPyQT5e2bC5m3CXT61/1
Posting
Single Signature
Public Keys
STM8GpX5u9ZLpHSqNXk2LCV7YDcnyaMJkWEraUurU9tHdmeEq5GQR1/1
Memo
STM5XEXcd4jih5gqUj98tcK5AfKjmFbMjytVMRVy7wdB1t2Q7x7ft
{
"owner": {
"account_auths": [],
"key_auths": [
[
"STM67peFvhJTUKFv26sQ5bAM2vqhF1sCAd1vXfAudkEy32TZvzMzh",
1
]
],
"weight_threshold": 1
},
"active": {
"account_auths": [],
"key_auths": [
[
"STM78P9YGUT2Hi8xZd3Qo7UqpUJHsbqVWTJ7qPyQT5e2bC5m3CXT6",
1
]
],
"weight_threshold": 1
},
"posting": {
"account_auths": [],
"key_auths": [
[
"STM8GpX5u9ZLpHSqNXk2LCV7YDcnyaMJkWEraUurU9tHdmeEq5GQR",
1
]
],
"weight_threshold": 1
},
"memo": "STM5XEXcd4jih5gqUj98tcK5AfKjmFbMjytVMRVy7wdB1t2Q7x7ft"
}Witness Votes
0 / 30
No active witness votes.
[]
