Photo by Shubham Dhage on Unsplash

A Quick Look at the API

web3.js does not only allow communication with Ethereum nodes but also with Whisper, Swarm nodes and other nodes too with End points(RPC). It comes with five main packages :

  • web3.eth: Allows interaction with an Ethereum blockchain and Ethereum smart contracts.
  • web3.bzz: Allows interaction with Swarm, the decentralized file store.
  • web3.shh: Allows interaction with the Whisper protocol for broadcasting.
  • web3.utils: Provides utility functions for Ethereum dapps, like converting strings to hex literals and Ether values to Wei.
  • web3.*.net: Allows interaction with an Ethereum node’s network properties, such as the network ID or the peer count.

Thank you :)

--

--

Photo by Shubham Dhage on Unsplash

Here we will see some Javascript function to Interact with avlanche blockchain.

This is Javascript code.

const Web3 = require(‘web3’);const { checkAddressChecksum } = require(‘web3-utils’);const web3obj = new Web3(“https://ava-mainnet.public.blastapi.io/ext/bc/C/rpc") 
const account = web3obj.eth.accounts.create();

To fetch and Get Details whole Endpoint

console.log(web3obj)

Account Details

console.log(account);

privatekey address

console.log(‘privatekey address =>’, account.privateKey)

account address

console.log(‘address =>’, account.address)

Getting balance

 web3obj.eth.getBalance(“0x0Ae16470701a05d06EE081eF223D93C90124b94”).then(console.log);

This are some Important code to interact with avalanche blockchain.

Need Help on Blockchain Project ?

Mail : vatshayan007@gmail.com

--

--

Photo by Ferenc Almasi on Unsplash
"scripts": {
"start": "node your-script.js"
}

ELse

,"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
}

Thanks!

Need any Help ?

Mail : vatshayan007@gmail.com

--

--

Photo by Artturi Jalli on Unsplash

For new Visual Studio Code version.

Open Visual Studio Code in your project’s folder.

Then open Python Terminal (Ctrl + Shift + P: Python: Create Terminal)

On Terminal :

python -m venv venv

Now you can check one folder is made left side there is venv is created.

Now you run your python file.

Thank you :)

--

--

Photo by Caspar Camille Rubin on Unsplash

Error Usually occur even after sometimes using : pip install sql

Traceback (most recent call last):
File "<pyshell#8>", line 1, in <module>
import mysql.connector
ImportError: No module named 'mysql'

Use This Command on Terminal

python3 -m pip install mysql-connector

Please Like and follow me if this works/help you.

Need Help/Queries ?

Mail : vatshayan007@gmail.com

--

--

Shivam Vatshayan

Shivam Vatshayan

Blockchain Developer || Project Developer || Software Engineer