Generate a Mnemonic
The following example will generate a mnemonic using a Client
instance. Since this functionality doesn't need to
communicate with any nodes, you can start your Client
in offline mode.
The following code example will:
- Create a
Client
in offline mode. - Use the created client to generate a mnemonic.
Code Examples
- Rust
- Nodejs
- Python
- Java
client/examples/00_generate_mnemonic.rs
loading...
Run the example by running the following command:
cargo run --example generate_mnemonic --release
client/bindings/nodejs/examples/01_mnemonic.ts
loading...
You can run the example by running the following command from the bindings/node/examples/
folder:
node dist/01_mnemonic.js
client/bindings/python/examples/01_mnemonic.py
loading...
You can run the example by running the following command from the binding/python/examples
folder:
python3 01_mnemonic.py
client/bindings/java/examples/src/GenerateMnemonic.java
loading...
Expected Output
- Rust
- Nodejs
- Python
- Java
Mnemonic: glance zoo dove legend razor season evoke twenty flush solution essence destroy loud traffic friend decorate emotion total borrow expect actor switch shock zer
Mnemonic: glance zoo dove legend razor season evoke twenty flush solution essence destroy loud traffic friend decorate emotion total borrow expect actor switch shock zer
Mnemonic: glance zoo dove legend razor season evoke twenty flush solution essence destroy loud traffic friend decorate emotion total borrow expect actor switch shock zer
glance zoo dove legend razor season evoke twenty flush solution essence destroy loud traffic friend decorate emotion total borrow expect actor switch shock zer