ethr-did-registry icon indicating copy to clipboard operation
ethr-did-registry copied to clipboard

How to create a registry contract in local testnet

Open tnkhanh opened this issue 2 years ago • 3 comments

Hi, I'm trying to create the registry contract in a local testnet. I followed the README and run

$ scripts/generateDeployTxs.js

and got this

 ======= Contract: EthereumDIDRegistry =======
rawTx: 0xf9[..]aaa
senderAddress: 0x3a[..]
cost (ether): 0.2811144
contractAddress: 0x36[..]
done

I transferred some ether to senderAddress . Now I'm not sure what to do. Should I send the rawTx from senderAddress ? It requires the senderAddress 's private key which I don't have. This might sound silly but what exactly do I do?

tnkhanh avatar Jun 07 '22 03:06 tnkhanh

The rawTx is already signed. The corresponding private key does not exist, or rather it's impossible to find.

The next step is to send the raw transaction to your local network.

If you are doing this for testing, it might be easier to deploy the contract normally, from the compiler output and using a local private key.

Please close this if the answer is clear enough :)

mirceanis avatar Jun 07 '22 04:06 mirceanis

I got this error when sending the rawTx

"error":{"code":-32000,"message":"only replay-protected (EIP-155) transactions allowed over RPC"}

I look around and find chainId might be missing in the transaction (ref. https://ethereum.stackexchange.com/questions/94412/valueerror-code-32000-message-only-replay-protected-eip-155-transac) Maybe rawTx is missing chainId and I need to add it?

tnkhanh avatar Jun 07 '22 06:06 tnkhanh

I guess so, as it seems your local network requires it. After you do that and you rebuild the deployment transaction, the sender address will change.

mirceanis avatar Jun 07 '22 06:06 mirceanis