Solidity Starter – 固态起动器区块链毕设代写

区块链毕设代写本文提供国外最新区块链项目源码下载,包括solidity,eth,fabric等blockchain区块链,Solidity Starter – 固态起动器区块链毕设代写 是一篇很好的国外资料

Solidity Starter

This is a simple starter to understand how to run a local enviorment of Solidity and start interacting with it.

First of all install Truffle and Ganache (you will need NodeJS):

https://www.trufflesuite.com/docs/truffle/getting-started/installation

https://www.trufflesuite.com/ganache

After you’ve downloaded both tools just install all the dependencies with:

yarn install

And edit the .env file according with your Ganache details. You will need to set first:

  • MNEMONIC: which is reported on top of the Ganache UI
  • OWNER_ADDRESS: which is the first address

It’s all set, now deploy the contract:

npm run ganache:deploy

The script will end with something like:

Deploying 'tPay' ---------------- > transaction hash:    0xa967c88d73bc2087f4cbe2eb621f1856a9d1f8a3f4a4ad6e575d2a324d5b8263 > Blocks: 0            Seconds: 0 > contract address:    0x3974B18919c38657e6168076Aebc8A203Ee18a37 > block number:        13 > block timestamp:     1621045680 > account:             0xb485e286bB054604778C9660C83DC22eb7538f6d > balance:             99.84893618 > gas used:            2082121 (0x1fc549) > gas price:           20 gwei > value sent:          0 ETH > total cost:          0.04164242 ETH   > Saving migration to chain. > Saving artifacts ------------------------------------- > Total cost:          0.04164242 ETH 

Copy the contract address (0x3974B18919c38657e6168076Aebc8A203Ee18a37) in the .env file after CONTRACT_ADDRESS.

Run tests

Now you’re able to run tests, for ganache we just need to run following scripts:

  • npm run ganache:mint: will mint 1.000.000 tokens
  • npm run ganache:details: will return contract details
  • npm run ganache:transfer: will transfer some tokens between two accounts
  • npm run ganache:burn: will burn 500 tokens

## Make changes and deploy to other networks

Now you’re able to make changes to the contract, test your own logic and deploy to other networks (like mumbai). All the networks are managed inside truffle.js and you can add mainnets or other testnets from there.

Happy coding! 🙂


Solidity Starter

这是一个简单的入门,了解如何运行一个稳定的本地环境,并开始与之互动

首先安装Truffle和Ganache(您需要NodeJS):

https://www.trufflesuite.com/docs/truffle/getting-started/installation

https://www.trufflesuite.com/ganache

下载这两个工具后,只需安装所有依赖项:

安装

并编辑.env文件根据你的细节。您需要首先设置:

  • MNEMONIC: which is reported on top of the Ganache UI
  • OWNER_ADDRESS: which is the first address

一切就绪,现在部署契约:

npm runganache:deploy

脚本将以如下内容结束:

Deploying 'tPay' ---------------- > transaction hash:    0xa967c88d73bc2087f4cbe2eb621f1856a9d1f8a3f4a4ad6e575d2a324d5b8263 > Blocks: 0            Seconds: 0 > contract address:    0x3974B18919c38657e6168076Aebc8A203Ee18a37 > block number:        13 > block timestamp:     1621045680 > account:             0xb485e286bB054604778C9660C83DC22eb7538f6d > balance:             99.84893618 > gas used:            2082121 (0x1fc549) > gas price:           20 gwei > value sent:          0 ETH > total cost:          0.04164242 ETH   > Saving migration to chain. > Saving artifacts ------------------------------------- > Total cost:          0.04164242 ETH 

将.env文件中的合同地址(0x3974B18919c38657e6168076Aebc8A203Ee18a37)复制到合同地址之后

Run tests

现在您可以运行测试了,对于ganache,我们只需要运行以下脚本:

  • npm run ganache:mint: will mint 1.000.000 tokens
  • npm run ganache:details: will return contract details
  • npm run ganache:transfer: will transfer some tokens between two accounts
  • npm run ganache:burn: will burn 500 tokens

## 进行更改并部署到其他网络

现在您可以更改合同、测试自己的逻辑并部署到其他网络(如孟买)。所有的网络都是在truffle.js中管理的,您可以从那里添加主网络或其他测试网络

快乐编码!:-)

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

www.interchains.cc

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

区块链毕设网(www.interchains.cc)全网最靠谱的原创区块链毕设代做网站 部分资料来自网络,侵权联系删除! 最全最大的区块链源码站 ! QQ3039046426
区块链知识分享网, 以太坊dapp资源网, 区块链教程, fabric教程下载, 区块链书籍下载, 区块链资料下载, 区块链视频教程下载, 区块链基础教程, 区块链入门教程, 区块链资源 » Solidity Starter – 固态起动器区块链毕设代写

提供最优质的资源集合

立即查看 了解详情