This forum is a read-only archive. Posting, replying and signing in are disabled.

Realize the interaction between private network and web page

michaelfighting

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 .

michaelfighting

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.

drew
↩ in reply to fabrice

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!

Tim

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.