Ethereum programming notes – 以太坊编程说明区块链毕设代写

区块链毕设代写本文提供国外最新区块链项目源码下载,包括solidity,eth,fabric等blockchain区块链,Ethereum programming notes – 以太坊编程说明区块链毕设代写 是一篇很好的国外资料

Ethereum programming notes

Software versions:

  • ubuntu 20.04
  • nvm 0.35.3
  • node 12.18.3 (note: ganache does not work with the latest nodejs 14)
  • npm 6.14.6
  • solc 0.7.5
  • mocha 8.2.1
  • web3 1.3.0
  • ganache-cli 6.12.1
  • truffle 5.1.54

Atom packages:

  • language-ethereum
  • terminus
  • linter
  • linter-eslint
  • linter-jsonlint

VS Code packages:

  • solidity

Update Settings -> “Solidity: Compile Using Local Version” to the path of your solc binary. For example,

/usr/local/bin/solc  # solc /Users/larry/.nvm/versions/node/v12.18.3/bin/solcjs  # solcjs 

Install nodejs using nvm

Install nvm Reference: https://github.com/trufflesuite/ganache-cli/issues/732

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash 

Restart terminal, then install nodejs

nvm install 12 nvm use 12 node --version npm --version 

Install Solidity compiler

Install solc

# Ubuntu sudo add-apt-repository ppa:ethereum/ethereum sudo apt update sudo apt install solc solc --version  # macOS brew update brew upgrade brew tap ethereum/ethereum brew install solidity solc --version 

Install solcjs

npm install -g solc solcjs --version 

Install other useful packages

npm install -g ganache-cli mocha web3 truffle 

Set environment variable NODE_PATH so that scripts knows to load global modules: Reference: https://stackoverflow.com/questions/15636367/nodejs-require-a-global-module-package

export NODE_PATH=~/.nvm/versions/node/$(node -v)/lib/node_modules 

Compile smart contracts

By calling solcjs inside a JavaScript script: see https://github.com/ethereum/solc-js#example-usage-without-the-import-callback.

By using solc CLI command:

solc --evm-version istanbul contracts/Inbox.sol  # instanbul is latest EVM version as of July 2020 

Note on keeping mnemonics & private keys safe

Never hard code mnemonics & private keys in the source code. Use the following techniques to supply mnemonics keys to script:

  • Record the private key in an environment variable that is only for one command
  • Load the environment variable to JavaScript using the dotenv module
  • Set environment variable HISTCONTROL to ignorespace or ignoreboth so that commands starting with a space won’t be recorded in ~/.bash_history

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


以太坊eth编程说明

软件版本:

  • ubuntu 20.04
  • nvm0.35.3
  • 节点12.18.3(注:注:ganache不与最新的14个节点协同工作)
  • npm6.14.6
  • solc 0.7.5
  • 莫查8.2.1
  • 莫查8.2.1
  • 李>web3.3.0
  • ganache命令行在环境中,只使用环境变量加载环境模块
  • 将环境变量HISTCONTROL设置为ignorespace或ignoreboth,这样以空格开头的命令将不会记录在~/.bash_history中

Atom包:

  • 将环境变量HISTCONTROL设置为ignorespace或ignoreboth,这样以空格开头的命令将不会记录在~/.bash_history中
  • terminus
  • linter
  • linter-eslint
  • linter-jsonlint

VS代码包:

  • solidity

更新设置->“Solidity:Compile Using Local Version”到solc二进制文件的路径。例如,

/usr/local/bin/solc  # solc /Users/larry/.nvm/versions/node/v12.18.3/bin/solcjs  # solcjs 

使用nvm安装NodeJ;私钥私钥安全

安装nvm参考:https://github.com/truflesuite/ganache-cli/issues/732

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash 

重新启动终端,然后安装nodejs

nvm install 12 nvm use 12 node --version npm --version 

基本曲奇

安装solc

# Ubuntu sudo add-apt-repository ppa:ethereum/ethereum sudo apt update sudo apt install solc solc --version  # macOS brew update brew upgrade brew tap ethereum/ethereum brew install solidity solc --version 

安装solcjs

npm install -g solc solcjs --version 

基本曲奇

npm install -g ganache-cli mocha web3 truffle 

设置环境变量NODE_PATH,以便脚本知道如何加载全局模块:参考:https://stackoverflow.com/questions/15636367/nodejs-require-a-global-module-package

export NODE_PATH=~/.nvm/versions/node/$(node -v)/lib/node_modules 

始终保持活跃

通过在JavaScript脚本中调用solcjs:请参见https://github.com/ethereum/solc js示例-没有导入回调的用法。

通过使用solc CLI命令:

solc --evm-version istanbul contracts/Inbox.sol  # instanbul is latest EVM version as of July 2020 

分析曲奇分析曲奇

从不在源代码中硬编码助记符和私钥。使用以下技术为脚本提供助记键:

  • Record the private key in an environment variable that is only for one command
  • Load the environment variable to JavaScript using the dotenv module
  • Set environment variable HISTCONTROL to ignorespace or ignoreboth so that commands starting with a space won’t be recorded in ~/.bash_history

我们使用可选的第三方分析cookies来了解您如何使用GitHub.com网站所以我们可以制造更好的产品。了解更多。

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

www.interchains.cc

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

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

提供最优质的资源集合

立即查看 了解详情