Web3js

在 Nodejs 中載入智能合約

  • December 31, 2019

我基於golang創建了伺服器。該伺服器可以載入使用其地址部署的智能合約。它適用於我的本地機器,但不適用於 EC2 實例。所以我決定基於nodejs進行開發。但我找不到它如何在 nodejs 中載入相同的智能合約。請幫我。謝謝。

通過以下方式獲取合約對象:

const contract = await new web3.eth.Contract(JSON.parse(interface), smartContractAddress);

引用自:https://ethereum.stackexchange.com/questions/74032