Skip to content

Instantly share code, notes, and snippets.

@dashameter
Created January 9, 2022 19:33
Show Gist options
  • Save dashameter/e755c3bfa9dc0cb8b112e6a77db97b2b to your computer and use it in GitHub Desktop.
Save dashameter/e755c3bfa9dc0cb8b112e6a77db97b2b to your computer and use it in GitHub Desktop.
const Dash = require("dash");
const { NodeForage } = require("nodeforage");
const nodeforage = new NodeForage({ name: "walletnodeforage2" });
const clientOpts = {
network: "testnet",
apps: {
},
wallet: {
adapter: nodeforage,
mnemonic:
"tool monkey earn bless clump dinner appear define allow fish ensure grass", // yX29oNG591LbqWWtDW2JTmL9pmAERmnswr
},
};
const client = new Dash.Client(clientOpts);
const createIdentity = async () => client.platform.identities.register();
createIdentity()
.then((d) => console.log("Identity:\n", d.toJSON()))
.catch((e) => console.error("Something went wrong:\n", e))
.finally(() => client.disconnect());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment