Eth-YellowPage parser 智能合約黃頁解析
Eth-YellowPage is a contract YellowPage in Ethereum.
智能合約黃頁用來登記大家的智能合約名稱和對應(yīng)的合約地址以及合約Abi文件江兢,方便別人查找和使用膀钠。
The current address is in 0x3b58331ffb2d246838185f8df90ecf2956a4dce1蚤吹。
目前的智能合約黃頁地址在0x3b58331ffb2d246838185f8df90ecf2956a4dce1。
The sol file is in Github
sol文件在Github止潘。
Anyone could use this ABI file to call SetPage(), provding info below:
任何人都可以通過這個ABI文件來調(diào)用黃頁的SetPage()接口寫入你的智能合約信息,提供參數(shù)如下
Name(bytes32) | Contract Address(address) | url(bytes32) | abi_url(bytes32) |
---|---|---|---|
name of your contract | contract address | url to get info about the contract | abi file url |
智能合約名稱 | 合約地址 | 合約信息 url | abi文件url |
it stores info by name, I personally have a website www.ethheyue.com which will display the infos in the contract.
You may use this npm package to read from the contract.
你可以使用這個npm包來解析黃頁上的信息。
Register your contract in the YellowPage
在黃頁上注冊你的智能合約
- if the name is not registered yet, you may register as you want, not charge.
如果該名稱還未注冊亡电,你可以注冊沪铭。 - if the name is registered, but you are the one who registered it, you may alter it.
如果該名稱已經(jīng)注冊壮池,但是注冊者就是你,你可以修改它杀怠。 - if none of the above is True, then only the owner of the YellowPage could alter it.
如果以上條件都不成立椰憋,請聯(lián)系黃頁擁有者。
Installation 安裝
npm install eth-yellowpage
initial 初始化
Connect to the ethereum using web3.js
-
Init the YellowPage with the web3 instance
var YellowPage = require("eth-yellowpage").EthYellowPage; var yellowPage = new YellowPage(web3);
that's all!
get specified contract's info by name 根據(jù)名稱取合約信息
console.log(yellowPage.ReadByName("ab"));
get the total count of contract registered 獲取注冊合約總數(shù)
console.log(yellowPage.TotalCount());
get the name of the contract by index 獲取指定序號合約的名稱
console.log(yellowPage.GetName(0));
please contact me city.of.beijing@gmail.com 郵件地址
這篇文章確實