Develop Your First DApp Using the Public Chain Node Service Provided by BSN


The Public Chain Node Service on the Blockchain Service Network (BSN) is one of the most powerful tools for developing a DApp. Let’s take a look at how to fully take advantage of this feature in DApp development.

Getting Started

Developing a DApp has never been easier with the help of the BSN platform. Here are the instructions on how to get started:

1. Visit global.bsnbase.com on your web browser.

2. Click on [Register] on the top-right corner and fill out the necessary information.

044924808a4c88309380493a570605c8dc42848e6ff8eb75ba21fbcf5325f287.png

3. After your account has been successfully created, login and navigate to the [Permissionless Services] tab.

71b2076d944ad2a5c92a4f97ea9a356e49aedb757e41dcc9f3373168f2908dde.png

4. For this demo, let’s create a free node under HongKong PCN: click on [Buy] under HongKong PCN and select the [Free Plan] (If you would like to get more daily requests and a higher TPS, you can also consider upgrading your plan).

5. Now you are able to create new projects: click on [Create New Project] under HongKong PCN.

6. Fill in your project name; for the chain selection, let’s use Irisnet-Mainnet and ETH-Mainnet as our examples.

add27bbf082685608845213df3277b7299bb849e34592d02b74b75f7c9525095.png

7. After clicking on [Create Project], you should be able to view your project by clicking [Project List].

8. Your newly created project will be under project list.

a. If you selected Irisnet-Mainnet as your chain, the system will provide you with three different access addresses (RPC, REST and WSS) along with a project key.

b. if you selected ETH-Mainnet as your chain, the system will provide you with one access address and a project key.

Those information will be crucial to DApp construction.

594c82c1d73dc144b0862ab03618f872f0f19450b7820aef14588a627e7e2caf.png

Making a Request to Your Node

Now that the node has been successfully set up, you can start developing a DApp through basic actions, such as making requests to the node.

For this demo, let’s make requests on the Postman app, which you can download here.

1. Open Postman and click on the [+] next to [Launchpad].

dbe677de7b73b058719014349cc7fd5989f5dd9905e52cd71acae1bb25f1912b.png

2. In the field that reads [Enter request URL], paste the Irisnet-Mainnet node [Access Address] that ends with [/rest] (should be highlighted in green on the BSN project list).

a4b9d545adeec590292e0dcabc16cf6f0c4feb483d4221c48e4016d48033cea7.png

3. Click on the subpage [Headers]; enter [x-api-key] and [x-api-sub-path] into the [KEY] column (the syntax is described here).

ad8ca22594068da679d2fb444a73e35feaf5a1e9d342b9fb6c8c4c3ca26b260d.png

4. In the cell after [x-api-key] (under the [VALUE] column), input the [Project Key] displayed on the BSN project list.

5. Visit https://www.irisnet.org/docs/light-client/intro.html#basic-functionalities for a list of APIs that you can use. For this demo, let’s select [GET /blocks/latest].

32378ab536878e7d4e7d143bc011cbfa5f17a6b9ce7bec3e16d1477fbda88e31.png

6. As indicated by the IRISnet documentation, [GET] is the request and [blocks/latest] is the subpath. Select [GET] as your request, and enter [blocks/latest] in the cell after [x-api-sub-path] (under the [VALUE] column).

17f66663bd3d2d5d0b7d04475c4f44168c509ca64b3e910a0cc13f29d05a4acc.png

7. Finally, press [Send] to view the node’s latest block on the window below.

17930717f8ee863a8104e4aa5cc6323df49a20be9877aac34f5df5f82546297c.png

If everything works fine, you can now make requests to and get responses from the BSN public node. Without the need of running a node individually or searching for public nodes, an IRISnet developer can very easily build a DApp through BSN services. Cannot wait to see what you will develop on IRISnet. Happy BUIDLing!

💌 Community Channels

Email
Website
Forum
Twitter
Facebook
LinkedIn
Medium
YouTube
English Telegram
Chinese Telegram
Korean Telegram
Korean KakaoTalk
Philippines Telegram
Italian Telegram
French Telegram
Hispanic Telegram
•WeChat subscription: irisnetwork
•WeChat group: irisnetwork2018

How do you rate this article?


9

0

Cosmos Network Family and Friends
Cosmos Network Family and Friends

The Cosmos Network is a decentralized network of independent, scalable, and interoperable blockchains, creating the foundation for a new token economy. Please enable JavaScript to continue to the Cosmos website. The foundation for a new token economy.


Cosmos Network
Cosmos Network

The Cosmos Network is a decentralized network of independent, scalable, and interoperable blockchains, creating the foundation for a new token economy.

Send a $0.01 microtip in crypto to the author, and earn yourself as you read!

20% to author / 80% to me.
We pay the tips from our rewards pool.