This code snippets demonstrates how to connect to Hedera Testnet using EthersJs (v5).
Copy the .env.example file to .env,
then edit it to add the URL for a JSON-RPC endpoint for Hedera Testnet.
To obtain this URL, see the JSON-RPC connections documentation.
In the connect.js file in this directory,
an instance of ethers.providers.JsonRpcProvider is initialised
using the JSON-RPC endpoint.
The CORS HTTP header (Access-Control-Allow-Origin)
is set to be maximally permissive.
This is needed for in-browser usage, but not needed for usage in NodeJs.
Subsequently a couple of RPCs are invoked to obtain the block number, and the HBAR balance of a specified account. These are simply to verify that the connection works properly.