10/19/2023 0 Comments Web3 stackTo track transactions on both chains, you can use the web3 instance targeting the corresponding chain to call the getTransactionReceipt method. For example, you can use the web3 instance targeting the Ethereum mainnet to call the contract on the Ethereum mainnet, and the web3 instance targeting the Polygon chain to call the contract on the Polygon chain. Then, you can use these web3 instances to interact with the contracts on the corresponding chains. For example, you can use the Infura provider to target the Ethereum mainnet and the Polygon provider to target the Polygon chain. To do this, you can initialize multiple web3 instances with different providers, each targeting a different chain. Yes, it is possible to keep multiple web3 instances in a single Node.js backend and use them to target different chains. Is it possible to keep some web3 on one chain while some other web3 on other chains, so that all processes can go simultaneously? Or would they not affect each other? I wonder how Opensea did this on their platform, they clearly have a tracking system across both chains. If I switch the chain, I think all ongoing tracking process would be affected. Otherwise, it would not find the contract as it is not on the current chain.īut while I do so, I might need to switch back as my previous transaction is being tracked by repeatedly calling the following code: await (txHash) I would need to check the current chain ID and switch it accordingly if needed. So I assume before I call the following code: const contract = new (JSON.parse(r.ntract_abi), contractAddress) But now, I would like to target both Ethereum and Polygon, which I need to ensure the transfer and transfer tracking are working on the correct chain. When I was dealing with one chain, which is Ethereum, I just made sure my web3 was targeting that chain ID and doing the transfer. Salary range indicative only and subject to negotiation based on experience.I am trying to handle multiple chains in a single Node.js backend. All individuals working on the project have been compensated with this method for over 2 years. Note: Salary will be paid in our native token (XIO) to the equivalent USD salary amount each pay period. It will be 100% remote working, along with all other Blockzero Citizens. This position can be either part-time or full-time. Please apply only if you have relevant experience and extensive knowledge of solidity and smart contracts.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |