Usage
1 min
Once you have added SignumJS to your application you usually want to connect to one of the Signum Network nodes to interact with the blockchain.
All you need is to create a ledger client instance to get access to the methods of the blockchain API.
The following example shows how to get an account from the chain.
const {LedgerClientFactory} = require('@signumjs/core');
(async () => {
const ledger = LedgerClientFactory.create({
nodeHost: 'https://europe.signum.network',
});
const account = await ledger.account.getAccount({accountId: '16107620026796983538'});
console.log('Account', account);
})();It is essential to understand the concept of async/awaitasync/await and PromisesPromises in Javascript. Many functions of SignumJS require to communicate with remote servers and therefore you need to be familiar with asynchronous Javascript.