You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to run the following code on bsc testnet (already deployed the smart contract on bsc testnet)
I already ran in Ropsten Network and had no issues
On the following code, I pretend to set an attribute and I am getting the following error: { code: -32000, message: 'transaction underpriced' }
So i decided to add gasPrice as a parameter on setAttribute() function, but now I am getting another error: { code: -32000, message: 'exceeds block gas limit' }
Expected Behavior
Should just return the Tx hash
Failure Information
when i decrease the gasPrice, i receive this message { code: -32000, message: 'transaction underpriced' }
when i increase the gasPrice, i receive this message: { code: -32000, message: 'exceeds block gas limit' }
Steps to Reproduce
Running the following code:
constEthrDID=require('ethr-did').EthrDIDconstHDWalletProvider=require("@truffle/hdwallet-provider")constmnemonic="**** MNEMONIC ***".toString().trim()constrpcLink="https://data-seed-prebsc-1-s3.binance.org:8545/"constchainId=97letprovider=newHDWalletProvider(mnemonic,rpcLink,0)letWeb3Provider=require('@ethersproject/providers').Web3ProviderconstbscAddr='0xA2D2Cb7Bb660E81032Db2a745986D3eDDaB34341'// Smart contract address on bsc testnetpubkey='PUBLIC KEY'identif='did:ethr:0x2: PUBLIC KEY'constmain=async()=>{letprov=awaitnewWeb3Provider(provider)constethrDid=awaitnewEthrDID({identifier: identif,provider: prov,signer: pubkey,registry:bscAddr,chainNameOrId:chainId,gasLimit: gasPrice})// let gasPrice = parseInt(29882814*1.04) letresponse=ethrDid.setAttribute('drivL','142536',1629981511).then((info)=>console.log(response)).catch((error)=>console.log(error))provider.engine.stop()}main()
Environment Details
Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.
Node version 14.17.1
The text was updated successfully, but these errors were encountered:
I think there is a mixup of gasPrice and gasLimit in your code.
Please try removing any gasLimit or gasPrice from the constructor arguments and supplying them as txOptions to the setAttribute method:
pubkey='PUBLIC KEY'identif=pubkey// when you use chainNameOrId, the DID string gets constructed automaticallyconstmain=async()=>{letprov=awaitnewWeb3Provider(provider)constethrDid=awaitnewEthrDID({identifier: identif,provider: prov,registry:bscAddr,chainNameOrId:chainId})letgasPrice=(awaitprov.getGasPrice()).toNumber()*2letgasLimit=10000000// the BSC testnet block limit seems to be 30 millionletresponse=ethrDid.setAttribute('drivL','142536',1629981511,null,{gasPrice, gasLimit}).then((info)=>console.log(response)).catch((error)=>console.log(error))provider.engine.stop()}main()
Note
Please avoid posting personally identifiable information on-chain as this can have serious privacy implications.
When you call setAttribute, the attribute information remains public for as long as the blockchain is maintained, even if you later call revokeAttribute.
I have a question about posting personal information on-chain:
If the data is encrypted (using a password defined by user) and store on IPFS and then post only the hash on-chain (or encrypt the IPFS's hash too and post on-chain)
Is this strategy efficient and secure?
Current Behavior
I am trying to run the following code on bsc testnet (already deployed the smart contract on bsc testnet)
I already ran in Ropsten Network and had no issues
On the following code, I pretend to set an attribute and I am getting the following error: { code: -32000, message: 'transaction underpriced' }
So i decided to add gasPrice as a parameter on setAttribute() function, but now I am getting another error: { code: -32000, message: 'exceeds block gas limit' }
Expected Behavior
Should just return the Tx hash
Failure Information
when i decrease the gasPrice, i receive this message { code: -32000, message: 'transaction underpriced' }
when i increase the gasPrice, i receive this message: { code: -32000, message: 'exceeds block gas limit' }
Steps to Reproduce
Running the following code:
Environment Details
Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.
Node version 14.17.1
The text was updated successfully, but these errors were encountered: