Query a Ledger

Created by Xinxiang Wang, Modified on Fri, 15 Dec, 2023 at 8:24 AM by Xinxiang Wang

There are two tabs on the Query Ledger page. The default tab is Query, where the search form is. The second tab Read-only Signer IDs redirects to a page where you can create a Signer ID that serves for authentication or inspection of artifacts in the vcn tool on all the ledgers.

You can run queries from the Query Ledger tab on the Ledgers page (described earlier) or from the Query tab on the Query Ledgers page.

Note and important distinction between Ledger/Query Ledger tab and Query Ledger/Query tab that was introduced in TC 3.1:

  • The Ledger/Query Ledger tab allows you to query one ledger at the same time. You can see in the search bar that the previously selected ledger's name is there. You can remove or edit the signer_id term.
  • In the Query Ledger/Query tab you can search all ledgers at the same time. The search term ledger_name is optional here.

The form at the top of the page lets you select filter parameters, run the query and export results to a CSV file. Trustcenter allows you to search for artifacts notarized in the vcn tool. An artifact is any object that was the target of the vcn notarize CLI command: container, dir, docker, dpkg, file, git, go, image, python etc.

To Run a Query

  1. Fill out the search bar with search terms. Press Enter when you finish inserting any one of the search terms.

When you confirm a search term this way it turns into a chip in the search bar. You can delete it by clicking the 'x' or edit it by clicking anywhere else on the chip.

You can move around the text using arrows on the keyboard. You can press Esc to escape from editing the search term.

Clicking anywhere on the search bar brings out the keyword auto-suggestion dropdown. You can choose the available keywords for your next search terms by clicking on them and completing it by entering the desired value.

  1. Next to the search bar you will find a DateTime field that allows you to filter the search results with regard to notarization time.

You can select either:

  • a period relative to the present moment using two dropdown fields at the top, ie. selecting number of periods and the period itself (hours, days, weeks) - "Relative" mode,
  • or specify the period manually by clicking on the calendar twice, first to choose the "From" date and the second time to choose the "To" date - "Absolute" mode.

You can adjust the "From" and "To" times at the bottom of the component.

Both conditions from the search bar and DateTime field are joined by the "AND" operator when executing the query to the database.

The search results update every time you add or modify the search terms and press Enter or modify the DateTime field.

Search terms

You can enter one or many search terms in the search bar. Important notes:

  • The search is performed as if all the search terms were joined by "AND" operator so only those documents will be found that fulfill all the search criteria,
  • You can use asterisk * for searching for parts of the artifact name or in other fields described below,
  • Another wildcard is the question mark ? for searching to replace a single character. For example, name*:nu?py* would find numpy,
  • The quotes " are usually optional in search queries. They are mandatory if the value contains special characters such as dot, hyphen or other,
  • There are no spaces before and after the colon ":",
  • It is also possible to use "OR" in search bar if it is entered as one search term, for example enter name:*immudb* OR kind:dir and press Enter after the whole term to create one chip

Search by artifact name

name:html

This example will search for the full name of an entry, eg. directories named "html".

name:*log4j*

This will search for documents that contain the string "log4j" as part of the name.

name:log4j*

This will search for document names that begin with the string "log4j".

name:*log4j

This will search for document names that end with the string "log4j".

Other fields to search

ledger_name:"l02"

Search for all documents notarized in "l02" ledger.

signer_id:"user1"

Search for all documents notarized by SignerID "user1".

status:"untrusted"

Search for all untrusted documents. Other options are "trusted" or "unsupported".

kind:"dir"

Search for all directory artifacts.

Available fields

fielddescription
has_attachmentfilters artifacts with attachments. Example: has_attachment:*
has_sbomfilters artifacts with SBOM. Example: has_sbom:*
hashhash from notarization
kindtype of the document, examples: container, dir, docker, dpkg, file, git, go, image, java, node, python, rust etc.
ledger_nameledger name related to the api key used in notarization
namename of the artifact notarized
signer_idsigner_id related to the api-key
statuspossible values: “trusted”, “untrusted”, “unsupported”

Sorting

The search results are sortable by clicking on the table header by:

  • artifact name,
  • kind,
  • notarization date.

Export Query Results

After running a query, you can click the Export button to download a CSV file with the search results to your local hard drive.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article