0

在调用智能合约(已部署到 rpc 服务器)时出现错误:getaddrinfo EAI_AGAIN ...当我使用测试区块链(gnache)时,智能合约工作正常,但当我将其部署到我的私人时显示上述错误以太坊区块链(PoA)。智能合约正在执行一些繁重的读写操作,因为我正在发送信息数组

调用函数

async function addBulkDocument(nonceArray, userWallet, ipfsHashArray, creatorPasswordArray, ownerPasswordArray, ownerAddressArray, sourcePasswordArray, sourceAddressArray, publicKeyArray, descriptionArray,notaryDataArray) {
    try {
        console.log("---------------------->",notaryDataArray);

        let contractWithSigner = DOCUMENT_CONTRACT.connect(userWallet);
        const txn = await contractWithSigner["addBulkDocument(string[],string[],string[],address[],string[],address[],string[],string[],string[])"](ipfsHashArray, creatorPasswordArray, ownerPasswordArray, ownerAddressArray, sourcePasswordArray, sourceAddressArray, publicKeyArray, descriptionArray,notaryDataArray, {
            nonce: nonceArray[0],
            gasLimit: 6721975,
            gasPrice: ether.utils.parseUnits('200000000000', 'wei')
        })

        const minedTxn = await txn.wait()

        console.log('mined transaction------------------------->', minedTxn)
        return { value: minedTxn }
        // if (minedTxn.status === 1) {
        //     return { value: minedTxn }
        // }
        // else {
        //     return { error: minedTxn }
        // }
    }
    catch (err) {
        logger.logError(err)
        console.log('transaction', err)
        return { error: new CustomError(err, "error") }
    }
}

genesis file

{
  "config": {
    "chainId": 2222,
    "homesteadBlock": 0,
    "eip150Block": 0,
    "eip150Hash": "0x0000000000000000000000000000000000000000000000000000000000000000",
    "eip155Block": 0,
    "eip158Block": 0,
    "byzantiumBlock": 0,
    "constantinopleBlock": 0,
    "petersburgBlock": 0,
    "istanbulBlock": 0,
    "clique": {
      "period": 5,
      "epoch": 30000
    }
  },
  "nonce": "0x0",
  "timestamp": "0x615edaad",
  "extraData": "0x0000000000000000000000000000000000000000000000000000000000000000c348016c306cac0d1f86eefbbdff2bbcbb3667e50000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
  "gasLimit": "0x38D7EA4C67FFFFF",
  "difficulty": "0x1",
  "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
  "coinbase": "0x0000000000000000000000000000000000000000",
  "alloc": {
    "0000000000000000000000000000000000000000": {
      "balance": "0x1"
    },
    "91a7df8b1820ab79d3a5b3c4fd35d4ef38b105f8": {
      "balance": "0x200000000000000000000000000000000000000000000000000000000000000"
    },
    "c348016c306cac0d1f86eefbbdff2bbcbb3667e5": {
      "balance": "0x200000000000000000000000000000000000000000000000000000000000000"
    }
  },
  "number": "0x0",
  "gasUsed": "0x0",
  "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
  "baseFeePerGas": null
}

4

0 回答 0