Register ENS with NodeJS

Hello! How are you?
My name is Luca, i’am a fintech software engineer and I hope you could guide me in some issues im having with ENS. The last few months I’ve been researching about developing with ENS. Im trying to register an ENS only using NodeJS with etherjs, but I end up with an call_exception error in the final step of registerWithCommit(). I made an GitHub gist to show you what Im doing. Im in a rabbit hole of information so if you could help me or get me with someone who could know it would be really helpful.
Thank you.

Register an ENS domain with nodejs · GitHub

1 Like

Have you considered the 1 minute wait part after the commitment before calling register?

Edit: sorry I didn’t check the Git repo. Yes you did.

The gas limit of 31000 seem very low. Usually register takes max of 300,000 gas (safe bet).


Even though I increase the limit it still fails with the same error.

reason: 'transaction failed',

Transaction details.

Thank you for the gas limit tip, I’ll consider it in future implementations.

edit: when is a gas related problem the reason specifies that, so I think is something else.


The resolver you’re using is for mainnet (0x4976fb03C32e5B8cfe2b6cCB31c09Ba78EBaBa41), try this for Goerli testnet: “0x4B1488B7a6B320d2D721406204aBc3eeAa9AD329”. The registrar will throw if you don’t have the right one provided.

1 Like

Nice catch! unfortunately still doesn’t work. (same generic error)

I created a replit so anyone who wants can easily test the script. You only have to change the address, private key and eth name.


I see, you forgot to provide the rent when calling the registration. The ABI registerWithConfig needed payable so I edited that. makeCommitmentWithConfig is needed for registerWithConfig.


The wallet account is test.

I adjusted the salt prod func. slightly but shouldn’t matter I would think.


Amazing. Works like a charm.
After seeing the solution I realize that I would have been lost for a long time haha.
Thank you so much!