[Ethereum] How to automate smart contract interaction

ethereum-wallet-dappsmart-contract-walletssolidityweb3js

I've deployed a smart contract to the blockchain with few functions.

I want to know how I can interact with the code e.g. > Contract has 2 functions – deposit and withdraw. Now, instead of me depositing and withdarwing 100 times manually, how can I write code which calls those functions automatically for me?

Let's say the code creates news Ether wallet, sends Ethereum to that wallet, then, from that wallet deposits the funds and withdraws it, then creates new wallet and repeat.

Best Answer

Code in Smart Contracts cannot be invoked automatically from within the blockchain, it has to be called externally.

This means that you need to write up a script or some service which would run and interact with your smart contract. Once you have this service you can run it as many times as you want, or you could schedule it to run at specific intervals.

A good place to start is to read into Web3.js which is a well known library to integrate with the Ethereum blockchain.

Related Topic