Using @dfinity/agent in node.js

dfx identity --network ic get-principal leads to w2bwq-cyvg6...

in nodejs

const identity = initIdentity();

console.log(identity.getPrincipal().toText());

I get another value → cd5mb-c6i5a....

2 Likes