現成metaforce佛薩奇2.0系統原始碼搭建(開發案例)

aa111111發表於2023-02-27

使用API KEY,就可以訪問以太坊網路節點。


在.env檔案中新增Infura api key的配置:


INFURA_API_KEY="

MNEMONIC="你的mnemonic"

1.3 更新專案設定

接下來使用MNEMONIC與INFURA_API_KEY,更新專案的網路配置,以便連線到公共區塊鏈網路。


修改truffle-config.js檔案:


// 匯入dotenv庫創用於讀取`.env`檔案中的設定

require('dotenv').config();

// 匯入truffle-hdwallet-provider庫重建錢包

const HDWalletProvider = require('truffle-hdwallet-provider');

 

module.exports = {

  networks: {

    development: {

     host: "127.0.0.1",     // Localhost (default: n

使用API KEY,就可以訪問以太坊網路節點。


在.env檔案中新增Infura api key的配置:


INFURA_API_KEY="

MNEMONIC="你的mnemonic"

1.3 更新專案設定

接下來使用MNEMONIC與INFURA_API_KEY,更新專案的網路配置,以便連線到公共區塊鏈網路。


修改truffle-config.js檔案:


// 匯入dotenv庫創用於讀取`.env`檔案中的設定

require('dotenv').config();

// 匯入truffle-hdwallet-provider庫重建錢包

const HDWalletProvider = require('truffle-hdwallet-provider');

 

module.exports = {

  networks: {

    development: {

     host: "127.0.0.1",     // Localhost (default: none)

     port: 7545,            // Standard Ethereum port (default: none)

     network_id: "*",       // Any network (default: none)

    },

    // Useful for deploying to a public network.

    // NB: It's important to wrap the provider as a function.

    kovan: {

      provider: () => new HDWalletProvider(

        process.env.MNEMONIC, 

        process.env.INFURA_API_KEY

      ),

      gas: 5000000,

      gasPrice: 25000000000,

      network_id: 42

    },

  },

  solc: {

    optimizer: {

      enabled: true,

      runs: 200

    }

  }

}


可以看到,我們使用了.env配置檔案中的MNEMONIC與INFURA_API_KEY配置了kovan網路。


由於用到了dotenv與truffle-hdwallet-provider這2個庫,我們需要先安裝:


切換到專案目錄,執行以下命令


npm install dotenv --save-dev

npm install truffle-hdwallet-provider --save-dev

注意 安裝truffle-hdwallet-provider時,如果出現node-gyp相關的錯誤,可參考這裡解決。


1.4 訪問以太坊節點

使用truffle console連線到公共區塊鏈網路:


$ truffle console --network kovan

要驗證連線,可以從區塊鏈中讀取一些資料,獲取一些關於最新區塊的資訊,在控制檯上執行:


web3.eth.getBlock('latest').then(console.log)

輸出:


{ author: '0x03801efb0efe2a25ede5dd3a003ae880c0292e4d',

  difficulty: '340282366920938463463374607431768211454',

  extraData:

   '0xde830206028f5061726974792d457468657265756d86312e33362e30826c69',

  gasLimit: '0x7a1200',

  gasUsed: '0x17d23',

  hash:

   '0xc7390c4f492c8c1da60608135fc9e05930123b645b39f221cba33d8b3c577b2a',

  logsBloom:

   '0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000080000000000000000000100000008000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400800000000000010000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009000000008000000',

  receiptsRoot:

   '0x3d05bb2ed4fcc90234eea6d840e7d0e3ce7f598a15e5314536b17bcd11c78b5b',

  sealFields:

   [ '0x84175e8801',

     '0xb84155a8cdb108dccec1d314124058fa6f22e7400ee200db0a94b7b165e4c3454c1818cc05f815cb7ce48f7a88b8401515740311a3566d9cf079428d506a6daca50101' ],

  sha3Uncles:

   '0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347',

  signature:

   '55a8cdb108dccec1d314124058fa6f22e7400ee200db0a94b7b165e4c3454c1818cc05f815cb7ce48f7a88b8401515740311a3566d9cf079428d506a6daca50101',

  size: 877,

  stateRoot:

   '0x03af5adce52a81ce5d332cddb9955e344214bff00859b78868116e1e839efdf7',

  step: '392071169',

  timestamp: 1568284676,

  totalDifficulty: '4524524338444961608702071789512829094373049115',

  transactions:

   [ '0xded7fed0842fd65ec808bc3652ec4175bc190acc11345c49c44b1fb5d954610f',

     '0x7e9112a46fa3c07aad813ea86355b15eebb44023c040d198ee7d15d379bbc2be' ],

  transactionsRoot:

   '0x0dd10d90686dda2684bd0ba70d1c9e1d9a5302c30ca75eb2c5b07a7b6e4498b9',

  uncles: [] }


可以看到,已經成功連線到了公鏈。


2. 部署智慧合約到公鏈

現在,我們將智慧合約部署到公鏈。步驟如下:


部署需要消耗Gas,獲取測試以太幣用於部署

部署智慧合約

驗證部署

2.1獲取測試以太幣

部署需要消耗Gas,Gas需要支付以太幣,我們部署到的是公鏈測試網Kovan,網路中的以太幣沒有市場價值。


開啟Ganache並複製列表中第一個帳戶的地址(錢包地址),類似下面所示:


2.2 部署智慧合約

執行部署命令:


truffle migrate --network kovan

一旦部署完成,應該會看到部署成功的訊息。


部署命令執行詳情:


G:\qikegu\ethereum\mydapp>truffle migrate --network kovan

 

Compiling your contracts...

===========================

> Everything is up to date, there is nothing to compile.

 

 

 

Migrations dry-run (simulation)

===============================

> Network name:    'kovan-fork'

> Network id:      42

> Block gas limit: 0x7a1200

 

...

 

Starting migrations...

======================

> Network name:    'kovan'

> Network id:      42

> Block gas limit: 0x7a1200

 

 

1_initial_migration.js

======================

 

   Deploying 'Migrations'

   ----------------------

   > transaction hash:    0x7e30b5c716afed45888a9dd2d6af7e6f52a9fade0346e8ad7d0c268de508a26a

   > Blocks: 2            Seconds: 9

   > contract address:    0x168A7247B58786edd259502948f5Bf9449C863AD

   > block number:        13447029

   > block timestamp:     1568294312

   > account:             0x29920e756f41F8e691aE0b12D417C19204371E91

   > balance:             2.993465175

   > gas used:            261393

   > gas price:           25 gwei

   > value sent:          0 ETH

   > total cost:          0.006534825 ETH

 

 

   > Saving migration to chain.

   > Saving artifacts

   -------------------------------------

   > Total cost:         0.006534825 ETH

 

 

2_deploy_contracts.js

=====================

 

   Deploying 'MyContract'

   ----------------------

   > transaction hash:    0xc1f7ec8fee1a23e3d08d0c9e9d6e15fef24feb8ba163e0071dccb1bb90cc0eca

   > Blocks: 0            Seconds: 0

   > contract address:    0x4D3CFaF8457CEA76c0409f989f9870115B4d2d82

   > block number:        13447036

   > block timestamp:     1568294340

   > account:             0x29920e756f41F8e691aE0b12D417C19204371E91

   > balance:             2.9850534

   > gas used:            294448

   > gas price:           25 gwei

   > value sent:          0 ETH

   > total cost:          0.0073612 ETH

 

 

   > Saving migration to chain.

   > Saving artifacts

   -------------------------------------

   > Total cost:           0.0073612 ETH

 

 

Summary

=======

> Total deployments:   2

> Final cost:          0.013896025 ETH

 

Summary

=======

> Total deployments:   2

> Final cost:          0.013896025 ETH


2.3 驗證部署

現在開啟truffle控制檯,與kovan測試網路上的智慧合約進行互動:


$ truffle console --network kovan

在控制檯中執行:


truffle(kovan)> MyContract.deployed().then((c) => { contract = c })

然後:


truffle(kovan)> contract.get()

'myValue'

truffle(kovan)> contract.set("hello world")

{ tx:

   '0x7bf63444f3a7bd70e981a7bd49228b1cf1a8c3754daf64c4c7765b8eee46bf37',

  receipt:

   { blockHash:

      '0xe03d0f43d85f4e41c18a90aa563ebda08899c6b9c38d0cd7779937046e2aed0c',

     blockNumber: 13447763,

     contractAddress: null,

     cumulativeGasUsed: 33629,

     from: '0x29920e756f41f8e691ae0b12d417c19204371e91',

     gasUsed: 33629,

     logs: [],

     logsBloom:

      '0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',

     root: null,

     status: true,

     to: '0x4d3cfaf8457cea76c0409f989f9870115b4d2d82',

     transactionHash:

      '0x7bf63444f3a7bd70e981a7bd49228b1cf1a8c3754daf64c4c7765b8eee46bf37',

     transactionIndex: 0,

     rawLogs: [] },

  logs: [] }

truffle(kovan)> contract.get()

'hello world'


可以看到智慧合約已經成功部署。


3. truffle指令碼

Truffle包含一個指令碼執行器,可對以太坊網路執行自定義指令碼。


讓我們建立一個指令碼並執行。


在專案根目錄下,建立script.js檔案,內容如下:


module.exports = function(callback) {

  web3.eth.getBlock('latest').then(console.log)

}

該指令碼將從Kovan測試網路獲取最新區塊的資訊。


執行指令碼:


truffle exec script.js --network kovan

輸出:


{ author: '0x596e8221a30bfe6e7eff67fee664a01c73ba3c56',

  difficulty: '340282366920938463463374607431768211454',

  extraData:

   '0xde830205058f5061726974792d457468657265756d86312e33362e30826c69',

  gasLimit: '0x7a1200',

  gasUsed: '0x5e61',

  hash:

   '0x225a1e0b13fd20396af60d049ce9bb94c2f3f7df06c7db260880b62c91997004',

  logsBloom:

   '0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',

  miner: '0x596e8221A30bFe6e7eFF67Fee664A01C73BA3C56',

  number: 13448162,

  parentHash:

   '0x28d00fd7b66771130ed98de5073c7797ee293e7bee4b546793a4b79171555066',

  receiptsRoot:

   '0x44617b5733ee59bde159af08ffd6edae36e0964f1724c333f3d1bef0808dee15',

  sealFields:

   [ '0x84175e95d7',

     '0xb8412ed900e67f4a72925fb3b495efb3f547411f40d26e972cc0e8b2cf26e40cf84a545e0328199d4880b79c62670129a7db12ac58234bee0866c6376b46ab99e8a200' ],

  sha3Uncles:

   '0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347',

  signature:

   '2ed900e67f4a72925fb3b495efb3f547411f40d26e972cc0e8b2cf26e40cf84a545e0328199d4880b79c62670129a7db12ac58234bee0866c6376b46ab99e8a200',

  size: 797,

  stateRoot:

   '0xe1bbaacfb950361bec70f4ad53a2605e1ac1d2ff0bfd913fe063dc6c5f3252a0',

  step: '392074711',

  timestamp: 1568298844,

  totalDifficulty: '4525729278306228651801195598997744985609807728',

  transactions:

   [ '0xf1ae41eac6b32419bc62a6cde9cab4b4ca244899a3d49b4a2461bcf94f504176' ],

  transactionsRoot:

   '0xf08c8097ea946f84ce9594ce73648fc0f9f683adef105a5db00c5f1f15e61c2c',

  uncles: [] }


下面的程式碼智慧合約MyContract中,讀取value值,將script.js指令碼檔案中的程式碼替換為:


const MyContract = artifacts.require("./MyContract.sol");

 

module.exports = async function(callback) {

  const contract = await MyContract.deployed()

  const value = await contract.get()

  console.log("Value:", value)

}

執行指令碼:


truffle exec script.js --network kovan

輸出:


Value: hello world

指令碼執行器是一個非常有用的功能。


one)

     port: 7545,            // Standard Ethereum port (default: none)

     network_id: "*",       // Any network (default: none)

    },

    // Useful for deploying to a public network.

    // NB: It's important to wrap the provider as a function.

    kovan: {

      provider: () => new HDWalletProvider(

        process.env.MNEMONIC, 

        process.env.INFURA_API_KEY

      ),

      gas: 5000000,

      gasPrice: 25000000000,

      network_id: 42

    },

  },

  solc: {

    optimizer: {

      enabled: true,

      runs: 200

    }

  }

}


可以看到,我們使用了.env配置檔案中的MNEMONIC與INFURA_API_KEY配置了kovan網路。


由於用到了dotenv與truffle-hdwallet-provider這2個庫,我們需要先安裝:


切換到專案目錄,執行以下命令


npm install dotenv --save-dev

npm install truffle-hdwallet-provider --save-dev

注意 安裝truffle-hdwallet-provider時,如果出現node-gyp相關的錯誤,可參考這裡解決。


1.4 訪問以太坊節點

使用truffle console連線到公共區塊鏈網路:


$ truffle console --network kovan

要驗證連線,可以從區塊鏈中讀取一些資料,獲取一些關於最新區塊的資訊,在控制檯上執行:


web3.eth.getBlock('latest').then(console.log)

輸出:


{ author: '0x03801efb0efe2a25ede5dd3a003ae880c0292e4d',

  difficulty: '340282366920938463463374607431768211454',

  extraData:

   '0xde830206028f5061726974792d457468657265756d86312e33362e30826c69',

  gasLimit: '0x7a1200',

  gasUsed: '0x17d23',

  hash:

   '0xc7390c4f492c8c1da60608135fc9e05930123b645b39f221cba33d8b3c577b2a',

  logsBloom:

   '0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000080000000000000000000100000008000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400800000000000010000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009000000008000000',

  receiptsRoot:

   '0x3d05bb2ed4fcc90234eea6d840e7d0e3ce7f598a15e5314536b17bcd11c78b5b',

  sealFields:

   [ '0x84175e8801',

     '0xb84155a8cdb108dccec1d314124058fa6f22e7400ee200db0a94b7b165e4c3454c1818cc05f815cb7ce48f7a88b8401515740311a3566d9cf079428d506a6daca50101' ],

  sha3Uncles:

   '0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347',

  signature:

   '55a8cdb108dccec1d314124058fa6f22e7400ee200db0a94b7b165e4c3454c1818cc05f815cb7ce48f7a88b8401515740311a3566d9cf079428d506a6daca50101',

  size: 877,

  stateRoot:

   '0x03af5adce52a81ce5d332cddb9955e344214bff00859b78868116e1e839efdf7',

  step: '392071169',

  timestamp: 1568284676,

  totalDifficulty: '4524524338444961608702071789512829094373049115',

  transactions:

   [ '0xded7fed0842fd65ec808bc3652ec4175bc190acc11345c49c44b1fb5d954610f',

     '0x7e9112a46fa3c07aad813ea86355b15eebb44023c040d198ee7d15d379bbc2be' ],

  transactionsRoot:

   '0x0dd10d90686dda2684bd0ba70d1c9e1d9a5302c30ca75eb2c5b07a7b6e4498b9',

  uncles: [] }


可以看到,已經成功連線到了公鏈。


2. 部署智慧合約到公鏈

現在,我們將智慧合約部署到公鏈。步驟如下:


部署需要消耗Gas,獲取測試以太幣用於部署

部署智慧合約

驗證部署

2.1獲取測試以太幣

部署需要消耗Gas,Gas需要支付以太幣,我們部署到的是公鏈測試網Kovan,網路中的以太幣沒有市場價值。


可以從Kovan faucet Gitter聊天室獲取測試用的偽以太幣。只需把錢包地址傳送出去,約5分鐘內,有人會給你發測試用的偽以太幣。


開啟Ganache並複製列表中第一個帳戶的地址(錢包地址),類似下面所示:


0x29920e756f41F8e691aE0b12D417C19204371E91

傳送到聊天室內,稍等片刻,你的賬號將收到一筆以太幣。


2.2 部署智慧合約

執行部署命令:


truffle migrate --network kovan

一旦部署完成,應該會看到部署成功的訊息。


部署命令執行詳情:


G:\qikegu\ethereum\mydapp>truffle migrate --network kovan

 

Compiling your contracts...

===========================

> Everything is up to date, there is nothing to compile.

 

 

 

Migrations dry-run (simulation)

===============================

> Network name:    'kovan-fork'

> Network id:      42

> Block gas limit: 0x7a1200

 

...

 

Starting migrations...

======================

> Network name:    'kovan'

> Network id:      42

> Block gas limit: 0x7a1200

 

 

1_initial_migration.js

======================

 

   Deploying 'Migrations'

   ----------------------

   > transaction hash:    0x7e30b5c716afed45888a9dd2d6af7e6f52a9fade0346e8ad7d0c268de508a26a

   > Blocks: 2            Seconds: 9

   > contract address:    0x168A7247B58786edd259502948f5Bf9449C863AD

   > block number:        13447029

   > block timestamp:     1568294312

   > account:             0x29920e756f41F8e691aE0b12D417C19204371E91

   > balance:             2.993465175

   > gas used:            261393

   > gas price:           25 gwei

   > value sent:          0 ETH

   > total cost:          0.006534825 ETH

 

 

   > Saving migration to chain.

   > Saving artifacts

   -------------------------------------

   > Total cost:         0.006534825 ETH

 

 

2_deploy_contracts.js

=====================

 

   Deploying 'MyContract'

   ----------------------

   > transaction hash:    0xc1f7ec8fee1a23e3d08d0c9e9d6e15fef24feb8ba163e0071dccb1bb90cc0eca

   > Blocks: 0            Seconds: 0

   > contract address:    0x4D3CFaF8457CEA76c0409f989f9870115B4d2d82

   > block number:        13447036

   > block timestamp:     1568294340

   > account:             0x29920e756f41F8e691aE0b12D417C19204371E91

   > balance:             2.9850534

   > gas used:            294448

   > gas price:           25 gwei

   > value sent:          0 ETH

   > total cost:          0.0073612 ETH

 

 

   > Saving migration to chain.

   > Saving artifacts

   -------------------------------------

   > Total cost:           0.0073612 ETH

 

 

Summary

=======

> Total deployments:   2

> Final cost:          0.013896025 ETH

 

Summary

=======

> Total deployments:   2

> Final cost:          0.013896025 ETH


2.3 驗證部署

現在開啟truffle控制檯,與kovan測試網路上的智慧合約進行互動:


$ truffle console --network kovan

在控制檯中執行:


truffle(kovan)> MyContract.deployed().then((c) => { contract = c })

然後:


truffle(kovan)> contract.get()

'myValue'

truffle(kovan)> contract.set("hello world")

{ tx:

   '0x7bf63444f3a7bd70e981a7bd49228b1cf1a8c3754daf64c4c7765b8eee46bf37',

  receipt:

   { blockHash:

      '0xe03d0f43d85f4e41c18a90aa563ebda08899c6b9c38d0cd7779937046e2aed0c',

     blockNumber: 13447763,

     contractAddress: null,

     cumulativeGasUsed: 33629,

     from: '0x29920e756f41f8e691ae0b12d417c19204371e91',

     gasUsed: 33629,

     logs: [],

     logsBloom:

      '0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',

     root: null,

     status: true,

     to: '0x4d3cfaf8457cea76c0409f989f9870115b4d2d82',

     transactionHash:

      '0x7bf63444f3a7bd70e981a7bd49228b1cf1a8c3754daf64c4c7765b8eee46bf37',

     transactionIndex: 0,

     rawLogs: [] },

  logs: [] }

truffle(kovan)> contract.get()

'hello world'


可以看到智慧合約已經成功部署。


3. truffle指令碼

Truffle包含一個指令碼執行器,可對以太坊網路執行自定義指令碼。


讓我們建立一個指令碼並執行。


在專案根目錄下,建立script.js檔案,內容如下:


module.exports = function(callback) {

  web3.eth.getBlock('latest').then(console.log)

}

該指令碼將從Kovan測試網路獲取最新區塊的資訊。


執行指令碼:


truffle exec script.js --network kovan

輸出:


{ author: '0x596e8221a30bfe6e7eff67fee664a01c73ba3c56',

  difficulty: '340282366920938463463374607431768211454',

  extraData:

   '0xde830205058f5061726974792d457468657265756d86312e33362e30826c69',

  gasLimit: '0x7a1200',

  gasUsed: '0x5e61',

  hash:

   '0x225a1e0b13fd20396af60d049ce9bb94c2f3f7df06c7db260880b62c91997004',

  logsBloom:

   '0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',

  miner: '0x596e8221A30bFe6e7eFF67Fee664A01C73BA3C56',

  number: 13448162,

  parentHash:

   '0x28d00fd7b66771130ed98de5073c7797ee293e7bee4b546793a4b79171555066',

  receiptsRoot:

   '0x44617b5733ee59bde159af08ffd6edae36e0964f1724c333f3d1bef0808dee15',

  sealFields:

   [ '0x84175e95d7',

     '0xb8412ed900e67f4a72925fb3b495efb3f547411f40d26e972cc0e8b2cf26e40cf84a545e0328199d4880b79c62670129a7db12ac58234bee0866c6376b46ab99e8a200' ],

  sha3Uncles:

   '0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347',

  signature:

   '2ed900e67f4a72925fb3b495efb3f547411f40d26e972cc0e8b2cf26e40cf84a545e0328199d4880b79c62670129a7db12ac58234bee0866c6376b46ab99e8a200',

  size: 797,

  stateRoot:

   '0xe1bbaacfb950361bec70f4ad53a2605e1ac1d2ff0bfd913fe063dc6c5f3252a0',

  step: '392074711',

  timestamp: 1568298844,

  totalDifficulty: '4525729278306228651801195598997744985609807728',

  transactions:

   [ '0xf1ae41eac6b32419bc62a6cde9cab4b4ca244899a3d49b4a2461bcf94f504176' ],

  transactionsRoot:

   '0xf08c8097ea946f84ce9594ce73648fc0f9f683adef105a5db00c5f1f15e61c2c',

  uncles: [] }


下面的程式碼智慧合約MyContract中,讀取value值,將script.js指令碼檔案中的程式碼替換為:


const MyContract = artifacts.require("./MyContract.sol");

 

module.exports = async function(callback) {

  const contract = await MyContract.deployed()

  const value = await contract.get()

  console.log("Value:", value)

}

執行指令碼:


truffle exec script.js --network kovan

輸出:


Value: hello world

指令碼執行器是一個非常有用的功能。


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/70010128/viewspace-2937167/,如需轉載,請註明出處,否則將追究法律責任。

相關文章