Deploy smart contract from a NodeJS server (Firebase Functions)


could you let me know what would be the best way to build/compile (e.g. npx hardhat compile or forge build) and deploy a smart contract from a NodeJS server (Firebase Functions in my case)?

hmmm any kind soul on this beautiful Tuesday :slight_smile:

Hi @ibox !
Can you share a bit more about what you're looking to accomplish with this setup? Are you able to install the necessary hardhat dependencies?

1 Like

Hi @slw.eth, no that's the issue. I need to be able to compile my code from the Node server, and I don't know how (to be clear I know how to do all of this locally via CLI)

Hmm. I'm not really familiar with Firebase functions. I'm assuming you can get some sort of CLI access, then you should be able to install the necessary dependencies, and write/run a script that executes the necessary hardhat function (compile in this case).

I agree it's not related to Firebase: but compiling a smart contract programmatically in JS (so on a NodeJS server)... without a CLI command....why is it so complicated? Remix does it so it is possible...I just need some docs...(of course if avoidable, not the ones where I have to install dependencies locally and control my own server etc... which makes serveerless obsolete...for a build mechanism...)

up :slight_smile: I still havent found a solution

solution: ethers.ContractFactory with abi and bytecode generated in Remix