Realize the interaction between private network and web page

Hey I’m new to Algorand and not a formally trained programmer.I’m building a new private network for users to store info ,view blockchain transactions and so on.There are some puzzles about realizing the interaction between blockchain and web to make sure I’m understanding private network.

Algorand connect to network by algod.net and algod.token. So how can I check some transactions info in my private blockchain,just like Testnet seeing from “https://algoexplorer.io/”.Maybe it is associated with specific consensus protocol?Thanks for your explanation .

When you create a private network, you specify in the network template how many nodes are created. In the directory that create the network in, you will see a sub directory for each node that contains alogd.net and algod.token. This allows you to connect to any of the nodes. Here is a tutorial on private networks: https://developer.algorand.org/tutorials/create-private-network/

algoexplorer.io only works with TestNet / MainNet / BetaNet, but not with private networks. For private networks, you need to manually query the blockchain from goal or any of the SDKs.

OK,Thanks for your interpretation,I find the way to query block information about PrivateNet,and I plan to make a website for searching information like the algoexplorer.io.

Thanks for your help.I understand the way to connect nodes in Private network

Hello, I would like to ask something more about this topic.
Where do I find the pieces of information I need to connect to a private node through the SDK? I’m specifically talking about the parameters to create the client: token (which I guess can be whatever I like), server and port.
I tried both what reported in the documentation - 127.0.0.1:8080 - and 127.0.0.1:46005, which is a value I found by inspecting what algod process was communicating on. None of them seems to work.

I’ve already set-up the private node and it’s working fine, and I’ve already used the SDK with purestake, so both are fine.

Here is the snippet of code I’d like to know how to fill:

const token = “Your algod API token”;
const server = “http://127.0.0.1”;
const port = 8080;
const client = new algosdk.Algod(token, server, port);

Thanks!

The items to fill that out are found in the data directory in the files - algod.token - and - algod.net - (when the node is running). The port is set in the config.json file, but, you don’t necessarily need that file as algod will use the default values listed in config.json.example unless you copy it to config.json and start editing it.

This page goes into it a bit - https://developer.algorand.org/docs/reference/sdks/#security-token.

That solved my problem, thank you very much :blush: :fist_right:t2: :fist_left:t2: