diff --git a/subjects/blockchain/local-node-info/README.md b/subjects/blockchain/local-node-info/README.md index c1e3654ed..8155568ec 100644 --- a/subjects/blockchain/local-node-info/README.md +++ b/subjects/blockchain/local-node-info/README.md @@ -1,23 +1,27 @@ ## Local Node Info -To start, we will create a simple page that displays basic information from our local node. +To get started, we will create a simple web page that displays basic information from our local node. ### Instructions -Create a web page, `localNodeInfo.html` that loads an ethereum library, connects to a local node at `http://localhost:8545` and displays basic information : +Create a web page called `localNodeInfo.html` that does the following: -- In an element with (`id`=`chainId`), the number ID of the current network -- In an element with `blockNumber` as `id` the number of blocks in the chain +1. Loads an Ethereum library, such as `ethers.js` or `web3.js`. +2. Connects to a local Ethereum node at `http://localhost:8545`. +3. Displays the following information on the page: + - The ID of the current network in an element with `chainId` as `id`. + - The number of blocks in the chain in an element with `blockNumber` as `id`. -![image](networkInfo.png) + +![image](network-infos.png) ### Hint -You can use any library such as `ethers.js` or `web3.js` to connect to your local node. +🚫 Please be aware that the test environment restricts internet access for security reasons. Therefore, you need to download the library and import it locally. -Automated tests check for elements with specific IDs, the design is up to you. +🎨 Automated tests only check for the content of elements with specific IDs; the rest of the design is up to you. -Minimal structure: +🎁 Here is a minimal example structure for the HTML file: ```HTML @@ -25,7 +29,7 @@ Minimal structure: - + @@ -34,6 +38,5 @@ Minimal structure: ``` ### Notions - - [ethers Provider transaction-methods](https://docs.ethers.io/v5/api/providers/provider/#Provider--network-methods) -- [web3](https://web3js.readthedocs.io/en/v1.3.4/web3-eth.html) +- [web3 providers](https://docs.web3js.org/guides/web3_providers_guide/) \ No newline at end of file diff --git a/subjects/blockchain/local-node-info/network-infos.png b/subjects/blockchain/local-node-info/network-infos.png new file mode 100644 index 000000000..f9972d34b Binary files /dev/null and b/subjects/blockchain/local-node-info/network-infos.png differ diff --git a/subjects/blockchain/local-node-info/networkInfo.png b/subjects/blockchain/local-node-info/networkInfo.png deleted file mode 100644 index b59b4026c..000000000 Binary files a/subjects/blockchain/local-node-info/networkInfo.png and /dev/null differ