• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

sponnet/peepin: Peepeth IPFS pinner / processor - companion app for https://gith ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

sponnet/peepin

开源软件地址:

https://github.com/sponnet/peepin

开源编程语言:

JavaScript 100.0%

开源软件介绍:

Peepin' : Peepeth peep parser

This command line program reads through the complete history of the peepeth contract and has the possibility to process each peep's data.

Useful for re-organizing peepeth data or creating data slices.

Usage (development)

Prerequisites

  • a running IPFS daemon on localhost (https://ipfs.io/docs/install/)
  • an Ethereum node with websocket support ( run Parity / geth ) or use Infura (discouraged because centralized)

Pro Tip: check https://dappnode.io/ for a free (as in hassle-free) linux image that includes all of the above !

Installation


npm install
node ./bin.js --ipfsapihost localhost --ipfsapiport 5001 --web3hostws wss://mainnet.infura.io/_ws

Currently the only thing that this does is iterate through all Peepeth events - and un it through the current version of parsers. The only thing that they do currently is copying the centralized aspects of Peepeth ( the avatar images and backgrounds ) to IFPS and create a tree of linked peeps on IPFS. A demo of the output is currently at https://peepfeed.netlify.com - but there is a lot more that we could do using this data..

Architecture of the parsers

Each peep event is read from the smart contract in the peepin.js file. Each event first trigggers a download of the related IPFS data (The IPFS hash in the contract function) and then looks up if a parser exists for its type, and if so it passes all this data to the corresponding parser ( see parsers/index.js for the mapping of data-types -> parser.

The parser then does whatever he wants with the data. Currently the implemented parsers use a local 'leveldb' database to store some of its info for easiers lookups later.

If you want to help implement parsers, there's some info and ideas in this epic #2

Analysis of the Peepeth functions

User functions that change state with IPFS data

updateAccount(_ipfsHash string)

Sample data:

{
    "info": "Peepeth creator.",
    "location": "California",
    "realName": "Bevan Barton",
    "website": "https://peepeth.com",
    "avatarUrl": "peepeth:bECcUGZh:jpg",
    "backgroundUrl": "peepeth:vbbfAvi2:jpg",
    "messageToWorld": "Do the right thing.",
    "untrustedTimestamp": 1521080303
}

reply(_ipfsHash string)

Sample:

{
    "type": "peep",
    "content": "Yes. Yesssss. ",
    "pic": "",
    "untrustedAddress": "0x94b26d7a0145635ed3dad4b786f47b6be4f3945a",
    "untrustedTimestamp": 1521521622,
    "shareID": null,
    "parentID": "Qmf4TMhyrqhRH8YtwdnzvrPU28pYVGtDTiix6zVzh8kKY2"
}

share(_ipfsHash string)

Sample data:

{
    "type": "peep",
    "content": "Yay mobile!!\n\nThe great news is we have @pete from #Cipher @sid from #Toshi and @vikmeup from #Trust (I like to shout about mobile)\n\nBetween those three we can get a great mobile experience. ",
    "pic": "",
    "untrustedAddress": "0x13ebd3443fa5575f0eb173e323d8419f7452cfb1",
    "untrustedTimestamp": 1521775536,
    "shareID": "QmREFpaf53MLW1C3MyHxgmbVdUxS5VjKHjeP2hPuhEjwbg",
    "parentID": null
}

saveBatch(_ipfsHash string)

Sample data:

 {
    "batchSaveJSON": [
      {
        "peep": {
          "ipfs": "QmaZvkhSyb9DBwWjKPwMAACyQRAAGVUm2mPc8sPb1B4v5Y",
          "untrustedTimestamp": 1521247003
        }
      }
    ],
    "untrustedTimestamp": 1521247022
}

post(_ipfsHash string)

Sample data:

{
    "type": "peep",
    "content": "...and Peepeth is live! Thanks to all who helped.\n\nShare what matters, reward the truth, and have fun!",
    "pic": "",
    "untrustedAddress": "0x30755d3e65c0cf46c35b72d11e52d941c5fc3a3e",
    "untrustedTimestamp": 1521135122,
    "shareID": null,
    "parentID": null
}

createAccount(_name bytes16,_ipfsHash string)

Sample data:

{
    "info": "Peepeth creator.",
    "location": "California",
    "realName": "Bevan Barton",
    "website": "https://peepeth.com",
    "avatarUrl": "peepeth:bECcUGZh:jpg",
    "backgroundUrl": "peepeth:vbbfAvi2:jpg",
    "messageToWorld": "Do the right thing.",
    "untrustedTimestamp": 1521080303
}

tip(_author address,_messageID string,_ownerTip uint256,_ipfsHash string)

Sample data:

{
    "type": "tip",
    "content": "Great job Bevan!",
    "parentID": "QmQfeQuPE3sxeCSrmHMLXxUZysRkA7YsodLYkPkrYXw9CU",
    "shareID": null,
    "untrustedAddress": "0x788d7dcc3c5a23ab08b343e25d76e0cd3174761c",
    "untrustedTimestamp": 1521156236
}

User functions the change state without IPFS data

unFollow(_followee address)
setIsActive(_isActive bool)
follow(_followee address)
changeName(_name bytes16)
setNewAddress(_address address)
newAddress()
transferAccount(_address address)

User functions that don't change state

isActive()
names( address)
addresses( bytes32)
owner()
accountExists(_addr address)
isValidName(bStr bytes16)
tipPercentageLocked()

Admin functions

cashout()
setMinSiteTipPercentage(newMinPercentage uint256)
interfaceInstances( uint256)
lockMinSiteTipPercentage()
interfaceInstanceCount()
minSiteTipPercentage()
transferOwnership(newOwner address)

How can you help ?

Currently we need more insights in the data format and improve the parsers. So if you want to take a look at the issues, please install the ZenHub plugin for your browser (https://www.zenhub.com/) and head over to the board. https://github.com/sponnet/peepin#boards




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap