For using the AAT SDK on a remote(or local) server, this section assumes you have basic knowledge of setting up and maintaining a server. In this tutorial, we are going to be using NPM and Node.js to setup the AAT SDK on a local node.
On your server, create an NPM project. Then we will run the following command to download and install our dependencies.
npm install --save @pokt-network/aat-js
Note: If you haven't created an AAT token, then click here to learn how to obtain the:
Next, we will be creating a server.js file and insert the following code.
// First require the PocketAAT class const PocketAAT = require('pocket-aat-js'); /* Define the arguments needed to build an AAT: - version: the version of the client - clientPublicKey: the account that the dApp is using to connect to the staked account - applicationPublicKey: the public key of the account staked on the network - applicationPrivateKey: the encrypted application private key */ const version = '0.0.1'; const clientPublicKey = 'ABCD...'; const applicationPublicKey = 'ABCD...'; const applicationPrivateKey = 'E73B...'; // Create a new PocketAAT instance const pocketAAT = PocketAAT.from(version, clientPublicKey, applicationPublicKey, applicationPrivateKey) // Example JSON output console.log(JSON.stringify(pocketAAT));
Updated 4 months ago