Retrieve Data from the Network
Prerequisites
Steps
1
Check the daemon is healthy
curl http://localhost:8082/healthfrom antd import AntdClient
client = AntdClient()
status = client.health()
print(status.network)
print(status.ok)import { createClient } from "antd";
async function main() {
const client = createClient();
const status = await client.health();
console.log(status.network);
console.log(status.ok);
}
main().catch((error) => {
console.error(error);
process.exit(1);
});{
"status": "ok",
"network": "default"
}2
Retrieve public data from an existing address
ADDRESS="<public_address>"
curl "http://localhost:8082/v1/data/public/$ADDRESS"from antd import AntdClient
client = AntdClient()
data = client.data_get_public("<public_address>")
print(data.decode())import { createClient } from "antd";
async function main() {
const client = createClient();
const data = await client.dataGetPublic("<public_address>");
console.log(data.toString());
}
main().catch((error) => {
console.error(error);
process.exit(1);
});What happened
Next steps
Last updated