Truffle blueprint – 松露蓝图区块链毕设代写

区块链毕设代写本文提供国外最新区块链项目源码下载,包括solidity,eth,fabric等blockchain区块链,Truffle blueprint – 松露蓝图区块链毕设代写 是一篇很好的国外资料

Truffle blueprint - 松露蓝图

Truffle blueprint

Easy boilerplate for deploying openzeppelin based smart-tokens using the truffle suite

Development

Install NodeJS and NPM. Windows Users experience fewer failures during installation when NodeJS LTS version 10 is used. Run npm install.

Modify the token blueprint (e.g. ./contracts/TanganyERC20.sol) to deploy the token. Make sure the contract file name is referenced correctly in ./migrations/2_deploy_contract.js.

Environment Variables

Each deployment environment has a different set of mandatory environment variables. Add the secrets required for the deployment environment to .env

Make sure to provide the PRIVATE_KEY. Ether by setting a mnemonic (the twelve word phrase), or a 64 character long hex-decimal string. The associated address will inherit the tokens created by the contract deployment.

Contract Tests

Write and run contract tests from ./test directory. Start up a local development chain running truffle develop and run tests with truffle test.

Deployment

Current Contract Addresses

  • TanganyTestToken:
    (2019-02-26) 0xC32AE45504Ee9482db99CfA21066A59E877Bc0e6

  • Contract Caller:
    (2020-10-16) 0x6dfC099FD9D1214e37e33Ecb3124dE451b751EbF

  • Event Emitter:
    (2020-10-20) 0x6412eFCdD4423f166dcF2475770a6764Bbf6bDB2
    (2020-10-06) 0xaE3093b6EA3E9dc5a09690A55634504A40E567D3

  • TanganyLoveToken (faucet):
    (2020-10-12) 0x62f49D4A051a22Cd5573b1197FD3E96F1026346D

  • Test Contract (deprecated):
    (2020-07-08) 0x61B6a7b2b031Ca7053c3fD28F255AC4B17ecd5a4

Deploy

Make sure the private key has enough ether on the required network to fund the deployment transactions.

Deploy the smart contract to the desired environment with the provided commands (e.g. npm run deploy:ropsten). The address of the deployed contract will be printed to the console output:

 C:wwwtangany-test-token>npm run build && npm run deploy:development  > tangany-test-token@1.0.0 prebuild C:wwwtangany-test-token > rimraf ./build/contracts/*   > tangany-test-token@1.0.0 build C:wwwtangany-test-token > truffle compile   Compiling your contracts... =========================== > Compiling .contractsMigrations.sol > Compiling .contractsTanganyTestToken.sol > Compiling openzeppelin-solidity/contracts/token/ERC20/ERC20.sol > Compiling openzeppelin-solidity/contracts/token/ERC20/ERC20Detailed.sol > Compiling openzeppelin-soliditycontractsmathSafeMath.sol > Compiling openzeppelin-soliditycontractstokenERC20IERC20.sol > Artifacts written to C:wwwtangany-test-tokenbuildcontracts > Compiled successfully using:    - solc: 0.5.2+commit.1df8f40c.Emscripten.clang   > tangany-test-token@1.0.0 deploy:development C:wwwtangany-test-token > truffle migrate --network development   Compiling your contracts... =========================== > Everything is up to date, there is nothing to compile.   Starting migrations... ====================== > Network name:    'development' > Network id:      5777 > Block gas limit: 6721975   1_initial_migration.js ======================     Deploying 'Migrations'    ----------------------    > transaction hash:    0x7d67cffd0ca19b0d8065c129510926b30a3ddd2dcdae339ebd4d07b32176a57c    > Blocks: 0            Seconds: 0    > contract address:    0x63A1ca2131B660D0388d15494eBE916d178C9e87    > account:             0xc460f0A72A5860107F2606321401f07549Bb4ddA    > balance:             99.99453676    > gas used:            273162    > gas price:           20 gwei    > value sent:          0 ETH    > total cost:          0.00546324 ETH      > Saving migration to chain.    > Saving artifacts    -------------------------------------    > Total cost:          0.00546324 ETH   2_deploy_contract.js ====================     Deploying 'TanganyTestToken'    ----------------------------    > transaction hash:    0xa5283e240886d3955f03af44e1115985e6ea131fe1538f755719f02fb0f3497a    > Blocks: 0            Seconds: 0    > contract address:    0x08D65FFaAA99a54a98AED475f5c9d659eF60CA7b    > account:             0xc460f0A72A5860107F2606321401f07549Bb4ddA    > balance:             99.96902082    > gas used:            1233769    > gas price:           20 gwei    > value sent:          0 ETH    > total cost:          0.02467538 ETH      > Saving migration to chain.    > Saving artifacts    -------------------------------------    > Total cost:          0.02467538 ETH   Summary ======= > Total deployments:   2 > Final cost:          0.03013862 ETH 

In this example the smart contract was deployed to the address 0x08D65FFaAA99a54a98AED475f5c9d659eF60CA7b on the Ganache Development network. The address 0xc460f0A72A5860107F2606321401f07549Bb4ddA gained ownership to the smart contract and received 10000 tokens.

Development network / Ganache

Required environment variables

  • PRIVATE_KEY
npm run build && npm run deploy:development 

Private network

Required environment variables

  • PRIVATE_KEY
  • PRIVATE_NETWORK_URL
  • PRIVATE_NETWORK_ID

Also make sure to verify the truffle settings for private match the actual private network (gas, gasPrice, …)

npm run build && npm run deploy:private 

Public network

Required environment variables

  • PRIVATE_KEY
  • INFURA_KEY

Sign up for a free api key at https://infura.io/dashboard to deploy to public networks.

npm run build && npm run deploy:ropsten 
npm run build && npm run deploy:mainnet 

Verification

In order to verify your smart contract on etherscan.io execute the verification script immediately after the contract is successfully deployed and pass the contract name as the argument (e.g. npm run verify:ropsten -- TanganyERC20). This action supports smart contracts deployed on public Ethereum networks and does require the ETHERSCAN_APIKEY environment variable to execute. The API key can be generated for free at https://etherscan.io/myapikey. For troubleshooting use the command option --debug.

Truffle blueprint - 松露蓝图

Disclaimer

Deploy at your own risk! This software is provided “as-is” without warranty of any kind. Tangany does not take any responsibility for loss of funds caused through use of this repository.


Truffle blueprint - 松露蓝图

© 2019 Tangany

Imprint • Privacy policy • Newsletter • Twitter • Facebook • LinkedIn • YouTube • Github

We use optional third-party analytics cookies to understand how you use GitHub.com so we can build better products. Learn more.


Truffle blueprint - 松露蓝图

免责声明0x6412EFCDD44423F166DCF2475770A6764BFF6BBB2
(2020-10-06)0xAE3093B6EA3E9DC5A09690A55634504A40E5667D33
  • TananyLoveToken(水龙头):
    (2020-10-12)0x62F49D4A051A22CD5573B119FD3E96F1026346D
  • 测试合同(已弃用):
    (2020-07-08)0x61B6A7B2B031CA70053CFD28F255ACB17B17ECE96F102026346D
  • 测试合同(弃用):
    (2020-07-08)0x61B6A6A6A6A7B1031CD5A4私钥专用密钥
  • 使用truffle套件部署基于openzeppelin的智能令牌的简单样板文件

    Development

    安装NodeJS和NPM。使用NodeJS LTS version 10时,Windows用户在安装过程中遇到的故障更少。运行npm install。

    修改令牌蓝图(例如/contracts/TanganyERC20.sol)以部署令牌。确保在./migrations/2u deploy中正确引用了协定文件名_合同.js.

    Environment Variables

    每个部署环境都有一组不同的强制环境变量。将部署环境所需的机密添加到.env

    确保提供私有密钥。通过设置助记符(12个单词的短语)或64个字符长的十六进制十进制字符串。关联的地址将继承契约部署创建的令牌。

    Contract Tests

    从./test目录编写并运行契约测试。启动一个本地开发链运行truffle开发和运行truffle test测试。
    (2019-02-26)0xC322AEE455504EE9482DB9999CFA21066A59E877BC0E6E877BC0E6E877BC0E6

    Deployment

    Current Contract Addresses

    • TananyLoveToken(水龙头):
      (2020-10-12)0x62F49D4A051A22CD5573B119FD3E96F1026346D
    • 测试合同(已弃用):
      (2020-07-08)0x61B6A7B2B031CA70053CFD28F255ACB17B17ECE96F102026346D
    • 测试合同(弃用):
      (2020-07-08)0x61B6A6A6A6A7B1031CD5A4私钥专用密钥
    • 测试合同(已弃用):
      (2020-07-08)0x61B6a7b2b031Ca7053c3fD28F255AC4B17ecd5a4

    • 确保私钥在所需网络上有足够的乙醚,以资助部署事务。

    Deploy

    使用提供的命令(例如npm run)将智能合约部署到所需的环境中部署:ropsten). 部署的契约的地址将被打印到控制台输出:

    在本例中,智能合约被部署到Ganache开发网络上的地址0x08d65ffaa99a54a98aed475f5c9d659ef60ca7b。地址0xc460f0a72a5860107f266321401f07549bb4dda获得了智能合约的所有权,并收到10000个代币。

     C:wwwtangany-test-token>npm run build && npm run deploy:development  > tangany-test-token@1.0.0 prebuild C:wwwtangany-test-token > rimraf ./build/contracts/*   > tangany-test-token@1.0.0 build C:wwwtangany-test-token > truffle compile   Compiling your contracts... =========================== > Compiling .contractsMigrations.sol > Compiling .contractsTanganyTestToken.sol > Compiling openzeppelin-solidity/contracts/token/ERC20/ERC20.sol > Compiling openzeppelin-solidity/contracts/token/ERC20/ERC20Detailed.sol > Compiling openzeppelin-soliditycontractsmathSafeMath.sol > Compiling openzeppelin-soliditycontractstokenERC20IERC20.sol > Artifacts written to C:wwwtangany-test-tokenbuildcontracts > Compiled successfully using:    - solc: 0.5.2+commit.1df8f40c.Emscripten.clang   > tangany-test-token@1.0.0 deploy:development C:wwwtangany-test-token > truffle migrate --network development   Compiling your contracts... =========================== > Everything is up to date, there is nothing to compile.   Starting migrations... ====================== > Network name:    'development' > Network id:      5777 > Block gas limit: 6721975   1_initial_migration.js ======================     Deploying 'Migrations'    ----------------------    > transaction hash:    0x7d67cffd0ca19b0d8065c129510926b30a3ddd2dcdae339ebd4d07b32176a57c    > Blocks: 0            Seconds: 0    > contract address:    0x63A1ca2131B660D0388d15494eBE916d178C9e87    > account:             0xc460f0A72A5860107F2606321401f07549Bb4ddA    > balance:             99.99453676    > gas used:            273162    > gas price:           20 gwei    > value sent:          0 ETH    > total cost:          0.00546324 ETH      > Saving migration to chain.    > Saving artifacts    -------------------------------------    > Total cost:          0.00546324 ETH   2_deploy_contract.js ====================     Deploying 'TanganyTestToken'    ----------------------------    > transaction hash:    0xa5283e240886d3955f03af44e1115985e6ea131fe1538f755719f02fb0f3497a    > Blocks: 0            Seconds: 0    > contract address:    0x08D65FFaAA99a54a98AED475f5c9d659eF60CA7b    > account:             0xc460f0A72A5860107F2606321401f07549Bb4ddA    > balance:             99.96902082    > gas used:            1233769    > gas price:           20 gwei    > value sent:          0 ETH    > total cost:          0.02467538 ETH      > Saving migration to chain.    > Saving artifacts    -------------------------------------    > Total cost:          0.02467538 ETH   Summary ======= > Total deployments:   2 > Final cost:          0.03013862 ETH 

    所需的环境变量

    Development network / Ganache

    所需的环境变量

    • PRIVATE_KEY
    npm run build && npm run deploy:development 

    Private network

    还要确保专用网络的truffle设置与实际专用网络(gas、gasPrice等)匹配。

    • PRIVATE_KEY
    • PRIVATE_NETWORK_URL
    • PRIVATE_NETWORK_ID

    所需环境变量

    npm run build && npm run deploy:private 

    Public network

    在https://infura.io/dashboard部署到公共网络。

    • PRIVATE_KEY
    • INFURA_KEY

    以便在上验证智能合约以太网扫描.io在成功部署契约后立即执行验证脚本,并将契约名称作为参数传递(例如npm run验证:ropsten–Tanganyer120)。此操作支持在公共以太坊eth网络上部署的智能合约,并且确实需要执行ETHERSCAN_APIKEY环境变量。API密钥可以在myetherio.https://key。要进行故障排除,请使用命令选项–debug。

    npm run build && npm run deploy:ropsten 
    npm run build && npm run deploy:mainnet 

    Verification

    In order to verify your smart contract on etherscan.io execute the verification script immediately after the contract is successfully deployed and pass the contract name as the argument (e.g. npm run verify:ropsten -- TanganyERC20). This action supports smart contracts deployed on public Ethereum networks and does require the ETHERSCAN_APIKEY environment variable to execute. The API key can be generated for free at https://etherscan.io/myapikey. For troubleshooting use the command option --debug.

    Truffle blueprint - 松露蓝图

    Disclaimer

    部署风险自负!本软件按“原样”提供,不提供任何形式的担保。Tangany对因使用此存储库而造成的资金损失不承担任何责任。


    Truffle blueprint - 松露蓝图

    © 2019 Tangany

    Imprint • Privacy policy • Newsletter • Twitter • Facebook • LinkedIn • YouTube • Github

    We use optional third-party analytics cookies to understand how you use GitHub.com so we can build better products. Learn more.

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

    www.interchains.cc

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

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

    提供最优质的资源集合

    立即查看 了解详情