Skip to main content

Get Database Information

The info method allows you to retrieve important settings related to a specific database, including the public key and Merkle tree height. These settings are crucial for understanding the cryptographic configuration of the database.

Syntax

import { ZkDatabase } from 'zkdb';

const zkdb = await ZkDatabase.connect({
userName: "chiro-user",
privateKey: "EKFTciRxyxshZjimay9sktsn7v5PvmC5zPq7q4JnitHUytxUVnFP",
environment: "node",
// This URL is for test environment
url: "https://api.zkdatabase.org/graphql",
});

await zkdb.auth.signIn();


console.log(await zkdb.db("zkdb_test").info());

await zkdb.auth.signOut();

Returns

  • A promise that resolves to a TDatabaseInfoResponse object containing the database's public key and Merkle tree height.
{
"databaseName": "zkdb_test",
"databaseOwner": "chiro-user",
"merkleHeight": 64,
"appPublicKey": "",
"sizeOnDisk": null,
"deployStatus": "Unknown"
}