在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:redacademy/vue-ethereum-ipfs开源软件地址:https://github.com/redacademy/vue-ethereum-ipfs开源编程语言:JavaScript 79.6%开源软件介绍:vue-ethereum-ipfsDistributed Application Starter: Vue front-end, Ethereum / IPFS Backend Ethereum is a distributed virtual machine that pays eth in return for miners running your smart contracts. IPFS is a kind of distributed content distribution network. Vue is a javascript framework for building client-side webapps. By keeping state inside ethereum and using IPFS to deliver HTML, webapps can become nearly indestructible! How do I use this to make indestructible Vue apps that speak Ethereum?Before you startInstall IPFS: https://ipfs.io/docs/install/ Obtain your IPFS repo key and set an environment variableTo obtain your key: Run: Select Localhost 8545 as your RPC form the MetaMask UI Use the generated passphrase to log into MetaMask eg:
Import the other accounts in to MetaMask for testing using the generated private key eg:
Install the Vue packages
Vue Build and deploy commands
Create your own Smart ContractsThe easiest way to start developing Smart Contracts: https://remix.ethereum.org/Add contracts to the Vue App
Use your Contracts in the App!Example import contract from 'truffle-contract'
import contractJSON from '../build/contracts/WitnessContract.json'
const Contract = contract(contractJSON)
const createContractInstance = async c => {
try {
const newContract = await Contract.new(c.name, c.terms, {
from: c.witness,
gasPrice: 2000000000,
gas: '2000000'
})
return newContract
} catch (e) {
console.log(e, 'Error creating contract...')
}
}
export { createContractInstance } Tested with:
LinksTeach and learn JavaScript with us at RED Academy: https://redacademy.com/ |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论