Coinmonks
Published in

Coinmonks

WatchData supports Binance Smart Chain

How to connect to Binance Smart Chain nodes

Imagine that you want to create any applications on the Binance Smart Chain. In order to do so, you would need access to full BSC nodes. Setting up a BSC node on your own can be quite a hassle.

Finding a fast and reliable node is just as much of a challenge.

It can take weeks, and then you have to keep it going. If you’re not careful, you may end up spending more time maintaining your node than actually using it.

There are several reasons why this happens:

  • Setting up a node takes a long time. It’s not uncommon for it to take up to two weeks to get everything set up and running properly.
  • Once you’ve finished setting up your node, you’ll need to keep an eye on it in order for it to work properly. Nodes usually require constant maintenance because they’re often running on machines that aren’t very powerful or reliable.
  • There are many different types of nodes out there so if something goes wrong with one type of node, there’s no guarantee that another type will work better for you — you could end up having to start over again!
  • Automatic load scaling. If your application starts consuming more resources while working with a node provider, you won’t notice any deviations.

This is only part of the problems you will face…

That’s where blockchain node providers come in. WatchData has one of the best APIs and Powered API services around! Without a data provider like WatchData, getting access to a BSC node can be quite difficult. But with its Blockchain API and Powered API service, WatchData makes this process much easier.

What is a BSC (Binance Smart Chain)?

You’re probably asking yourself, “What is BSC?” Well, Binance Smart Chain is a blockchain that runs in parallel with the traditional Binance Chain. The Binance Chain was introduced in 2019, and its main focus was to facilitate fast and decentralized trading. However, there were some flexibility issues with this chain, which in turn led to scalability issues. This is where Binance Smart Chain comes into play.

Unlike the Binance chain, BSC is compatible with EMV (or Ethereum Virtual Machine) technology. This was done to leave high bandwidth behind the original chain and to introduce smart contracts into the ecosystem through the implementation of BSC. So how does it work?

Binance Chain uses a Proof-of-Stake (PoS) consensus algorithm. More specifically, it uses the Proof-of-Staked Authority (PoSA) algorithm. Here, participants bid BNB to become validators. If a validator bids a valid block, they are rewarded with commissions for transactions within that block.

Cross-Chain Interoperability is also an important part of this new chain. This architecture allows users to seamlessly transfer assets from one chain to another. This means that fast trading on Binance Chain can be used simultaneously with the creation of dApps on BSC.

How to Connect to BSC Nodes Using WatchData?

To access the BSC API from the WatchData website, the first step is to create an account. This is completely free and takes just a few seconds. As you have an account and sign in, we can take a closer look at how to connect to BSC API with WatchData.

  1. Login

2. Create API key

3. Result

You can read a more detailed description of how to get started with in this article → HERE.

By using our API, you can add features that will give your users new ways to interact with their data, giving them a better experience and making them more likely to come back for more!

Blockchain API

With WatchData’s API, you can get to Raw blockchain data: balances, transactions, blocks, tokens transfers, logs, and others. No need to run your own node! Spare yourself from development costs and associated expenses. Call most JSON-RPC methods via our API in the same way as sending to an own node.

Let’s look at a few examples of interactions with our API:

One of the most common endpoints is — eth_blockNumber (BSC)

Request example:

URL: <https://bsc.api.watchdata.io/node/jsonrpc?api_key=your_api_key>
RequestType: POST
Body:
{
"jsonrpc":"2.0",
"method":"eth_blockNumber",
"params":[],
"id":0
}

Response example:

{
"jsonrpc": "2.0",
"id": 0,
"result": "0x11af5c7"
}

Try it yourself, it’s easy!

Powered API

Powered API is a kind of additional functionality for interaction with the node. We took the work over the blockchain and transformed the data in a clear and structured format. You, as a user, will get a ready set of data, which carries a huge amount of information. Let us explain it to you more clearly: What if you want to find all transactions made by one BSC address? While that may be easy in an SQL database, in blockchain it’s exorbitantly complicated — you practically have to scan every transaction in the blockchain to see if it includes a single address. We’ve created some advanced APIs that allow you to instantly perform this and other similar queries.

For cases like this, try watch_getTransfersByAddress

Request example:

URL: <https://bsc.api.watchdata.io/node/jsonrpc?api_key=your_api_key>
RequestType: POST
Body:
{
"id": 1,
"method": "watch_getTransfersByAddress",
"jsonrpc": "2.0",
"params": [
{
"addresses": "0x6a73eb4e8EA2068ec539D2f0D15d757766E247E4",
"contractAddresses": "native",
"transferDirection": "from",
"fromBlock": 14046400,
"toBlock": "latest",
"offset": 0,
"limit": 10
}
]
}

Response example

{
"jsonrpc": "2.0",
"id": 1,
"result": [
{
"blockNumber": 18541974,
"blockTimestamp": "2022-06-09T15:40:54",
"transactionHash": "0xaabec1b38b5752d0d35b41f8f97150b16f5ad8abc36e1ffb3ffff293c4aedae2",
"transactionIndex": 190,
"logIndex": null,
"contractAddress": null,
"transferType": "trx",
"from": "0x2d4c407bbe49438ed859fe965b140dcf1aab71a9",
"to": "0x0000000000000000000000000000000000001000",
"value": 130519792672271954,
"fee": 0,
"asset": "BSC",
"decimals": 18
},
{
"blockNumber": 18541995,
"blockTimestamp": "2022-06-09T15:41:57",
"transactionHash": "0x35f3ee96f1f57f5f58e4025b24a6cc98fc0d3fbf6d26784a56c6840ea5acf9ff",
"transactionIndex": 153,
"logIndex": null,
"contractAddress": null,
"transferType": "trx",
"from": "0x2d4c407bbe49438ed859fe965b140dcf1aab71a9",
"to": "0x0000000000000000000000000000000000001000",
"value": 84645758210632809,
"fee": 0,
"asset": "BSC",
"decimals": 18
},
{
"blockNumber": 18542016,
"blockTimestamp": "2022-06-09T15:43:00",
"transactionHash": "0x45a5fefe177518b3bf6b60375e1ef468a9405c358c53ab4ad35526cbd2bba898",
"transactionIndex": 192,
"logIndex": null,
"contractAddress": null,
"transferType": "trx",
"from": "0x2d4c407bbe49438ed859fe965b140dcf1aab71a9",
"to": "0x0000000000000000000000000000000000001000",
"value": 128711794952039418,
"fee": 0,
"asset": "BSC",
"decimals": 18
}
]
}

A huge amount of useful information in just one endpoint.

How to Change MetaMask Networks with a BSC Node

Now create a custom RPC configuration in MetaMask

Go to your MetaMask wallet and click on the network drop-down list at the top, selecting Custom RPC at the bottom.

Then you’ll see the following screen:

Let’s fill in these fields with custom RPC information.

  1. For your network, you can assign any name you want. We will use the BSC network and in this example, we will name it BSC WatchData
  2. For the New RPC URL field, generate a key and copy the HTTP Link for the blockchain you need to work with.

Your final HTTP should look like:

<https://bsc.api.watchdata.io/node/jsonrpc?api_key=YOUR_API_KEY>
  1. Find the chain ID for the network you want to connect to.
  • Binance Smart Chain Mainnet — chainID = 56

4. Currency Symbol and Block Explorer URL are optional. For most chains, no input is needed here.

When you’re done, your configuration should look something like this:

And don’t worry if you get a warning, for example: “This Chain ID is currently used by the ropsten network.”. This is just MetaMask reminding you that you have a different configuration for the same chain, which is fine. Once you’ve filled in these information fields, just click Save!

And that’s it! You’re done!

Conclusion

WatchData makes it easy to connect to a BSC node. All you have to do is sign up, and then you can use our platform to connect with a node in just a few clicks. The WatchData team is here to help get you up and running.
To get more information we’re highly reccomend you to learn our official documentation.

Get access to all sorts of tools helpful in developing dApps!

HELPFUL LINKS

Join Coinmonks Telegram group and learn about crypto trading and investing

--

--

Coinmonks (http://coinmonks.io/) is a non-profit Crypto Educational Publication. Follow us on Twitter @coinmonks and Our other project —  https://coincodecap.com, Email  — gaurav@coincodecap.com

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store