基于区块链的毕业设计Eth Avatar – Gravatar for Ethereum addresses – 以太坊地址的坟墓

本文提供基于区块链的毕业设计国外最新区块链项目源码下载,包括solidity,eth,fabric等blockchain区块链,基于区块链的毕业设计Eth Avatar – Gravatar for Ethereum addresses – 以太坊地址的坟墓 是一篇很好的国外资料

Eth Avatar – Gravatar for Ethereum addresses

Eth Avatar associates an avatar of your choice with an Ethereum address that you own.

We hope this project will be a “gravatar for ethereum addresses”.

This project is free and open source. We hope to see other projects make use of it! The more projects use it, the more useful it is.

Possible Use Cases

  • Visual Verification: When sending ether to an exchange for instance, instead of being paranoid if you’ve pasted the correct address, wallets that support Eth Avatar will be able to fetch the exchange logo as a forms of visual verification. The same also works the other way around when transferring from the exchange to your own wallet.
  • Token Branding: Tokens and contracts will be able to associate branding artwork to their addresses, allowing it to be possibly visible on EtherScan and exchanges once they support Eth Avatar.
  • Personal Use It’s fun to associate avatars with your personal addresses and be able to visually differentiate between them in your wallets.

Demo

Eth Avatar - Gravatar for Ethereum addresses - <a href=以太坊eth地址的坟墓”>

How it works

The avatar image is stored on IPFS and is bound to your address via an Ethereum smart contract.

Current Deployments

  • Dapp: https://ethavatar.com (make sure you visit using an Ethereum browser)
  • Smart Contract: https://etherscan.io/address/0x5d5194e9aa451d36ec4faa62609d18e1ed6765a4#code

To Integrate Into your App

// assumes you're running web3.js and ipfs.js already!   // todo: well need to host web3.js and ipfs-api.js on ethavatar.co so folks can pull down from there // https://gitcoin.co/static/v2/js/ipfs-api.js // var ipfs = ipfsAPI('ipfs.infura.io', '5001', {protocol: 'https'}); // connect to the unfura IPFS node  // setup var eth_avatar_abi = [{"constant": false, "inputs": [], "name": "getIPFSHash", "outputs": [{"name": "", "type": "string"}], "payable": false, "type": "function"}, {"constant": false, "inputs": [{"name": "hash", "type": "string"}], "name": "setIPFSHash", "outputs": [], "payable": false, "type": "function"}, {"anonymous": false, "inputs": [{"indexed": true, "name": "hashAddress", "type": "address"}, {"indexed": false, "name": "hash", "type": "string"}], "name": "DidSetIPFSHash", "type": "event"}] var eth_avatar_address = '0x4FbF2f1613Cc86314b22AE10Ae95D19cF2990824'; //mainnet var eth_avatar_contract = web3.eth.contract(eth_avatar_abi).at(eth_avatar_address);  // configure inputs var target_address = web3.eth.coinbase; // TODO - your address  // get the IPFS data eth_avatar_contract.getIPFSHash.call((err, result) => {     var ipfs_hash = result;     ipfs.files.get(ipfs_hash, (err, result) => {       if(err) {         console.error('**Error fetching avatar data from IPFS: ' + err);         return;       }        // need help from tarek -- what if the hashcontent is empty?        var hashContent = result[0].content;       var avatarDataBuffer = Buffer.from(hashContent);        // we've got the data       var avatarData = JSON.parse(avatarDataBuffer.toString());       // TODO - use the avatar data for something       // avatarData.title        // Now fetch the image itself       ipfs.files.get(avatarData.imageHash, (err, result) => {         if(err) {           console.error('**Error fetching avatar image from IPFS: ' + err);           return;         }          var imageContent = result[0].content;         var imageBlob = new Blob( [ imageContent ], { type: "image/jpeg" } );         var imageURL = window.URL.createObjectURL(imageBlob);         // TODO - use the avatar data for something        });     }) })

Deploying the smart contract and web dapp locally

Before you start, make sure you have both npm & Node.js installed

  1. Install Truffle.

    $ npm install -g truffle

  2. Download and launch Ganache. Make sure Ganache is running on port 7545.

  3. Clone the repository to a folder of your choice.

    $ git clone https://github.com/gitcoinco/ethavatar.git

  4. Fetch all required packages.

    $ cd ethavatar $ npm install 
  5. Deploy the smart contract to Ganache.

    $ truffle migrate

  6. Launch the Dapp

    $ npm run start

Eth Avatar - Gravatar for Ethereum addresses - <a href=以太坊eth地址的坟墓”>


以太坊eth地址的Eth Avatar-Gravatar

Eth Avatar将您选择的Avatar与您拥有的以太坊eth地址相关联。

我们希望这个项目将成为“以太坊eth地址的坟墓”。

这个项目是免费的、开源的。我们希望看到其他项目利用它!项目越多地使用它,它就越有用。

可能的使用案例

  • 可视化验证:例如,当向交易所发送以太时,支持Eth Avatar的钱包将能够获取交易所徽标作为可视化验证的一种形式,而不是因为粘贴了正确的地址而产生偏执。同样的方法也适用于从交易所转移到自己钱包的情况。
  • 代币品牌:代币和合同将能够将品牌艺术品与他们的地址相关联,一旦他们支持Eth Avatar,就可以在ethscan和exchanges上看到。
  • 个人使用将头像与您的个人地址关联起来,并能够在您的钱包中直观地区分它们,这很有趣。

演示

Eth Avatar - Gravatar for Ethereum addresses - <a href=以太坊eth地址的坟墓”>

它的工作原理

化身图像存储在IPFS上,并通过以太坊eth智能合约绑定到您的地址。

当前部署

  • Dapp公司:https://ethavatar.com(请确保使用以太坊eth浏览器进行访问)
  • 智能合约:https://etherscan.io/address/0x5d5194e9aa451d36ec4faa62609d18e1ed6765a4代码

集成到您的应用程序

// assumes you're running web3.js and ipfs.js already!   // todo: well need to host web3.js and ipfs-api.js on ethavatar.co so folks can pull down from there // https://gitcoin.co/static/v2/js/ipfs-api.js // var ipfs = ipfsAPI('ipfs.infura.io', '5001', {protocol: 'https'}); // connect to the unfura IPFS node  // setup var eth_avatar_abi = [{"constant": false, "inputs": [], "name": "getIPFSHash", "outputs": [{"name": "", "type": "string"}], "payable": false, "type": "function"}, {"constant": false, "inputs": [{"name": "hash", "type": "string"}], "name": "setIPFSHash", "outputs": [], "payable": false, "type": "function"}, {"anonymous": false, "inputs": [{"indexed": true, "name": "hashAddress", "type": "address"}, {"indexed": false, "name": "hash", "type": "string"}], "name": "DidSetIPFSHash", "type": "event"}] var eth_avatar_address = '0x4FbF2f1613Cc86314b22AE10Ae95D19cF2990824'; //mainnet var eth_avatar_contract = web3.eth.contract(eth_avatar_abi).at(eth_avatar_address);  // configure inputs var target_address = web3.eth.coinbase; // TODO - your address  // get the IPFS data eth_avatar_contract.getIPFSHash.call((err, result) => {     var ipfs_hash = result;     ipfs.files.get(ipfs_hash, (err, result) => {       if(err) {         console.error('**Error fetching avatar data from IPFS: ' + err);         return;       }        // need help from tarek -- what if the hashcontent is empty?        var hashContent = result[0].content;       var avatarDataBuffer = Buffer.from(hashContent);        // we've got the data       var avatarData = JSON.parse(avatarDataBuffer.toString());       // TODO - use the avatar data for something       // avatarData.title        // Now fetch the image itself       ipfs.files.get(avatarData.imageHash, (err, result) => {         if(err) {           console.error('**Error fetching avatar image from IPFS: ' + err);           return;         }          var imageContent = result[0].content;         var imageBlob = new Blob( [ imageContent ], { type: "image/jpeg" } );         var imageURL = window.URL.createObjectURL(imageBlob);         // TODO - use the avatar data for something        });     }) })

部署smart本地契约和web dapp

开始之前,请确保您同时拥有npm和;节点.js安装

  1. 安装块菌。$npm安装-g truffle下载并启动Ganache。确保Ganache在端口7545上运行。
  2. 将存储库克隆到您选择的文件夹中。$git克隆https://github.com/gitcoinco/ethavatar.git
  3. 获取所有必需的包。$cd ethavatar$npm install将智能合约部署到Ganache。$truffle migrate
  4. 启动Dapp$npm run start
  5. $npm run start

    Eth Avatar - Gravatar for Ethereum addresses - <a href=以太坊eth地址的坟墓”>

  6. Launch the Dapp

    $ npm run start

Eth Avatar - Gravatar for Ethereum addresses - <a href=以太坊eth地址的坟墓”>

部分转自网络,侵权联系删除区块链源码网

www.interchains.cc

https://www.interchains.cc/20643.html

区块链毕设网(www.interchains.cc)全网最靠谱的原创区块链毕设代做网站 部分资料来自网络,侵权联系删除! 最全最大的区块链源码站 ! QQ3039046426
区块链知识分享网, 以太坊dapp资源网, 区块链教程, fabric教程下载, 区块链书籍下载, 区块链资料下载, 区块链视频教程下载, 区块链基础教程, 区块链入门教程, 区块链资源 » 基于区块链的毕业设计Eth Avatar – Gravatar for Ethereum addresses – 以太坊地址的坟墓

提供最优质的资源集合

立即查看 了解详情