Exciting news!Announcing our $4.6M Series Seed. Learn more
Socket
LoveBlogFAQ
Install
Log in

@iota/identity-stronghold-nodejs

Package Overview
Dependencies
5
Maintainers
10
Versions
4
Issues
File Explorer

Advanced tools

@iota/identity-stronghold-nodejs

This is the beta version of the official Stronghold Account Storage plugin for Node.js with [IOTA Identity Wasm](https://github.com/iotaledger/identity.rs/tree/main/bindings/wasm).

    0.5.1latest

Version published
Maintainers
10
Yearly downloads
1,723

Weekly downloads

Readme

Source

IOTA Identity Stronghold Node.js

This is the beta version of the official Stronghold Account Storage plugin for Node.js with IOTA Identity Wasm.

Install the plugin:

Latest Release: this version matches the main branch of this repository and is stable.

npm install @iota/identity-stronghold-nodejs

Development Release: this version matches the dev branch of this repository, may see frequent breaking changes and has the latest code changes.

npm install @iota/[email protected]

Usage

const { AccountBuilder, ExplorerUrl } = require('@iota/identity-wasm/node') const { Stronghold } = require('@iota/identity-stronghold-nodejs') async function main() { // Stronghold settings for the Account storage. // This will load an existing Stronghold or create a new one automatically. const filepath = "./example-strong.hodl"; const password = "my-password"; const stronghold = await Stronghold.build(filepath, password); // This generates a new keypair stored securely in the above Stronghold, // constructs a new DID Document, and publishes it to the IOTA Mainnet. let builder = new AccountBuilder({ storage: stronghold, }); let account = await builder.createIdentity(); // Print the DID of the newly created identity. const did = account.did(); console.log(did.toString()); // Print the local state of the DID Document. const document = account.document(); console.log(JSON.stringify(document, null, 2)); // Print the Explorer URL for the DID. console.log(`Explorer URL:`, ExplorerUrl.mainnet().resolverUrl(did)); } main()

Build

Alternatively, you can build the bindings if you have Rust installed. If not, refer to rustup.rs for the installation. Then install the necessary dependencies using:

npm install

To use the latest local changes from the Wasm bindings follow the build instructions from the IOTA Identity Wasm build section and then link the result with:

cd ../wasm npm link cd ../stronghold-nodejs npm link @iota/identity-wasm

and then build the bindings

npm run build

If you linked the Wasm bindings, don't forget to unlink before packaging the module.

npm unlink --no-save @iota/identity-wasm npm install

Minimum Requirements

The minimum supported version for node is: v16.0.0

FAQs

What is @iota/identity-stronghold-nodejs?

This is the beta version of the official Stronghold Account Storage plugin for Node.js with [IOTA Identity Wasm](https://github.com/iotaledger/identity.rs/tree/main/bindings/wasm).

Is @iota/identity-stronghold-nodejs popular?

The npm package @iota/identity-stronghold-nodejs receives a total of 233 weekly downloads. As such, @iota/identity-stronghold-nodejs popularity was classified as not popular.

Is @iota/identity-stronghold-nodejs well maintained?

We found that @iota/identity-stronghold-nodejs demonstrated a healthy version release cadence and project activity. It has 10 open source maintainers collaborating on the project.

Last updated on 06 Apr 2022
Socket

Product

Subscribe to our newsletter

Get open source security insights delivered straight into your inbox. Be the first to learn about new features and product updates.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc