Hello everyone, Is anyone familiar with any api that can be used to deploy a smart contract? I am trying to deploy a smart contract through nodejs server

Mar 2, 2022, 6:34 AM
Truffle is a framework, you can use that to deploy smart contracts easily
https://trufflesuite.com/
Mar 2, 2022, 7:53 AM
I need to deploy the smart contract using a rest api. Is there a way execute truffle through an API or a code?
Without using the cli
Mar 2, 2022, 8:04 AM
u code migration files
and u deploy them with: truffle migrate
Mar 2, 2022, 8:12 AM
ethers contractfactory
https://docs.ethers.io/v5/api/contract/contract-factory/

scroll down to see an example
hope it helps
Mar 2, 2022, 8:13 AM
btw why without cli?
Mar 2, 2022, 8:14 AM
Thanks man
Trying to build a backend service that can deploy smart contract
Mar 2, 2022, 8:21 AM
you can check truffle, maybe it exposes a simple api like the cli
Mar 2, 2022, 8:22 AM
No they don't have any api and i tried to trigger truffle using node api it did not work
Mar 2, 2022, 8:24 AM
i know its shitty/bad practice but maybe u can invoke the cli from the code
like exec('truffle migrate')
Mar 2, 2022, 8:33 AM
I tried this way but code becomes little messy here contractfactory looks like the best way to implement this
Mar 2, 2022, 8:45 AM
related and funny tweet to frontrunning
https://twitter.com/0xKatsuragi/status/1491799360065048576/photo/1
Mar 2, 2022, 9:43 AM
can u send me the github?
im curios to know how these bots work
Mar 2, 2022, 9:50 AM
honestly no idea which github it is, theres an etherscan link on the tweet but no idea where the github is, maybe you can search over the transactions to find the contract
Mar 2, 2022, 9:54 AM
nice ty
so its not really front running, seems kinda more a sniping bot for binance
front running is smth done on before a tx is on chain, still in the mempool
no?
Mar 2, 2022, 9:57 AM
yes
Mar 2, 2022, 9:58 AM
Lol respect++
Mar 2, 2022, 1:53 PM

© 2024 Draquery.com All rights reserved.