Running Examples
It is not recommended to store passwords or seeds on a host's environment variables or in the source code in a production setup. Please follow our backup and security recommendations for production use.
- Java
- Nodejs
- Python
- Rust
- Wasm
Prequisites
Before you can run the examples, please refer to the Java Getting Started guide to install the library.
Running the Java Examples
Gradle
./gradlew examples:java-app:test --info
Maven
mvn exec:exec
Running the Android Examples
The Android app needs further compilation instructions which you can find in the Getting Started With Java - Android Development section.
Example for an External Project
You can find a project skeleton can in this repository.
Prequisites
Before you can run the examples, please refer to the Node.js Getting Started guide to install the library.
Run the Examples
To run any Node.js example, you need to select any of the
Node.js examples and run it with your local
Node.js interpreter. The following snippet runs 01_get_info.js
from the project root:
node bindings/nodejs/examples/01_get_info.js
Prequisites
Before you can run the examples, please refer to the Python Getting Started guide to install the library.
Run the Examples
To run any Python example you need to select any of the
Python examples and run it with your local
python interpreter. The following snippet runs 01_get_info.py
from the project root:
python bindings/python/examples/01_get_info.py
Prequisites
Clone the project
You can clone the project by running the following command
git clone https://github.com/iotaledger/iota.rs
Set Up Your .env file
After you have cloned the project, you should:
- Move into the project directory by running the following command:
cd iota.rs
- Create your
.env
file by making a copy of the.env.example
file by running the following command:
cp .env.example .env
Run the Examples
After you have fulfilled the prequisites, you can run examples by using the following command:
cargo run --example 01_get_info --release
You can replace the 01_get_info
by any other example from the Rust examples directory.
Prequisites
Before you run the examples, please refer to the Wasm Getting Started guide , and make sure you have built the bindings for
node.js
.
Run the Examples
You can run the wasm example using the following command:
npm run example:node
For Web
For the web examples, you should run the following command:
npm run serve