Skip to main content

Trusted Nodes List

Browse the approved nodes of each environment, check their health, and copy the URL of the node you want to send your requests to. New to the Trusted Nodes List? Read Trusted Nodes List.

info

Downloading and verifying the Trusted Nodes List…

Verify the list in your code​

The @europeum-ebsi/trusted-nodes-list library downloads the list and verifies its whole chain of trust, as described in Verify the Trusted Nodes List. It works in Node.js and in browsers.

npm install @europeum-ebsi/trusted-nodes-list

loadTrustedNodesList checks that trusted-keys.json is signed by the pinned Europeum key-list key, that tnl.json is signed by enough custodians, and that the content is valid: the TNL JSON Schema (draft 2020-12), validity window, keysVersion, node URLs and rollback protection. It throws a TrustedNodesListError on any failed check, so it fails closed.

import {
checkNodesHealth,
loadTrustedNodesList,
} from "@europeum-ebsi/trusted-nodes-list";

const { list } = await loadTrustedNodesList({
// Fail unless these environments have at least one node (optional)
requiredEnvironments: ["preprod"],
});

for (const { url, country, organisation } of list.environments.preprod ?? []) {
console.log(url, country, organisation);
}

// A node is healthy when its latest block (POST <url>/v1/ledger, eth_getBlockByNumber)
// is less than 1 minute old
const { healthy, unhealthy } = await checkNodesHealth(
list.environments.preprod ?? [],
);
OptionDefaultDescription
urlhttps://tnl.ebsi.euTNL base URL, for example https://tnl-test.ebsi.eu for the test list
requiredEnvironments[]Environments that must have at least one node
lastAcceptednone{ version, sha256, trustedKeysVersion } of the last list you accepted, to reject rollbacks
fetchglobalThis.fetchCustom fetch implementation (proxy, tests, etc.)
cachenonecache of a previous result, to skip unchanged files (backend only)
keyListKeyEuropeum key{ armoredKey, fingerprint } of the key-list key
signalnoneAbortSignal that aborts the requests when triggered
timeout10000Timeout of each request, in milliseconds

checkNodesHealth asks each node for its latest block (POST <url>/v1/ledger, JSON-RPC eth_getBlockByNumber) and returns { healthy, unhealthy }, where each unhealthy entry is { node, reason }. A node that redirects, answers with an error or has a stale block is unhealthy. It accepts these options:

OptionDefaultDescription
maxBlockAge60000Maximum age of the latest block, in milliseconds
futureBlockTolerance60000How far in the future the latest block may be dated, in milliseconds
timeout10000Timeout of each request, in milliseconds
signalnoneAbortSignal; aborting it rejects the call

The check compares the block timestamp with your local clock, so keep it synchronised with NTP.

In a browser, the library works under a strict Content-Security-Policy (its validators are generated ahead of time, so nothing is compiled at runtime). It needs WebCrypto, which is only available over HTTPS or on localhost.

tip

Prefer verifying the list on your backend and passing the verified node URLs to your frontend: the browser then downloads and verifies the list on every visit. Verify in the browser when you have no backend, as the tool above does, or in a wallet.

To verify files you downloaded yourself, use verifyTrustedNodesList, which does no network I/O. See the library README for all options and error codes.