- follow the steps for Android in the [Prerequisites guide of Tauri](https://v2.tauri.app/start/prerequisites/#configure-for-mobile-targets)
- follow the steps for Android in the [Prerequisites guide of Tauri](https://v2.tauri.app/start/prerequisites/#configure-for-mobile-targets)
Until I find out how to do this properly, if you are compiling the android app from a macos station, you need to override an env var. this is due to reqwest needing SSL support, and on linux and android it compiles it from source. apparently the compiler (cc-rs) doesn't know that when cross compiling to android targets, the tool ranlib is called llvm-ranlib (and not [target]-ranlib)
Until I find out how to do this properly, if you are compiling the android app from a macos station, you need to override an env var. this is due to reqwest needing SSL support, and on linux and android it compiles it from source. apparently the compiler (cc-rs) doesn't know that when cross compiling to android targets, the tool ranlib is called llvm-ranlib (and not [target]-ranlib)
@ -14,11 +14,11 @@ JS/WASM crate containing the SDK of NextGraph
This crate is composed of
This crate is composed of
- the npm package `ng-sdk-js` which is the SDK
- the npm package `ng-sdk-js` which is the SDK
- an example of web app using the ESmodule and webpack as bundler `app-web`
- an example of web app using the ESmodule and webpack as bundler `app-web`
- an example of React web app `app-react`
- an example of React web app `app-react`
- an example of node-js app `app-node`
- an example of node-js app `app-node`
- `index.html` an example of vanilla JS usage of the SDK
- `index.html` an example of vanilla JS usage of the SDK
## Support
## Support
@ -31,27 +31,37 @@ And our community forum where you can ask questions is here [https://forum.nextg
Read our [getting started guide](https://docs.nextgraph.org/en/getting-started/).
Read our [getting started guide](https://docs.nextgraph.org/en/getting-started/).
```
```
// for nodejs
npm i nextgraph
// or for browser (not published to npm yet)
npm i ng-sdk-js
npm i ng-sdk-js
```
```
## For contributors
## For contributors
First of all, run:
```
cargo install cargo-run-script
```
We recommend contributors to use the production build, as the creation and opening of wallets is very slow in the dev build.
We recommend contributors to use the production build, as the creation and opening of wallets is very slow in the dev build.
Only use the dev build when debugging the sdk. see the next chapter for the production build.
Only use the dev build when debugging the sdk. see the next chapter for the production build.
Please note that the dev and prod builds share the same output folder, they thus override each other.
Please note that the dev and prod builds share the same output folder, they thus override each other.
When building the app, be sure to have the production build of the SDK in the output folder.
When building the app, be sure to have the production build of the SDK in the output folder.
```
```
wasm-pack build --dev --target bundler
// for the app sdk (browser)
cargo run-script appdev
wasm-pack build --dev -t nodejs -d pkg-node
// for the nodejs sdk
node prepare-node.js
cargo run-script nodedev
```
```
For testing in vanilla JS
For testing in vanilla JS
```
```
wasm-pack build --dev --target web -d web
cargo run-script webdev
python3 -m http.server
python3 -m http.server
// open http://localhost:8000
// open http://localhost:8000
@ -66,15 +76,10 @@ wasm-pack test --chrome --headless
## Production build
## Production build
```
```
wasm-pack build --target bundler
cargo run-script app
tar --exclude .DS_Store -zcvf pkg.tar.gz pkg
tar --exclude .DS_Store -zcvf pkg.tar.gz pkg
wasm-pack build -t nodejs -d pkg-node
cargo run-script node
wasm-pack build --target web -d web
cargo run-script web
node prepare-node.js
cd pkg
npm publish --access=public
cd ../pkg-node
npm publish --access=public
```
```
### Example Plain JS web app
### Example Plain JS web app
@ -83,7 +88,8 @@ npm publish --access=public
cd ../app-web
cd ../app-web
// for local development
// for local development
npm install --no-save ../pkg
npm install --no-save ../pkg
// or, for install from npm registry: npm install
// or, for installation from npm registry: npm install
// then:
npm start
npm start
```
```
@ -121,13 +127,12 @@ additional terms or conditions.s
Licensed under either of
Licensed under either of
- Apache License, Version 2.0 ([LICENSE-APACHE2](LICENSE-APACHE2) or http://www.apache.org/licenses/LICENSE-2.0)
- Apache License, Version 2.0 ([LICENSE-APACHE2](LICENSE-APACHE2) or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)
- MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)
at your option.
at your option.
`SPDX-License-Identifier: Apache-2.0 OR MIT`
`SPDX-License-Identifier: Apache-2.0 OR MIT`
---
---
NextGraph received funding through the [NGI Assure Fund](https://nlnet.nl/assure) and the [NGI Zero Commons Fund](https://nlnet.nl/commonsfund/), both funds established by [NLnet](https://nlnet.nl/) Foundation with financial support from the European Commission's [Next Generation Internet](https://ngi.eu/) programme, under the aegis of DG Communications Networks, Content and Technology under grant agreements No 957073 and No 101092990, respectively.
NextGraph received funding through the [NGI Assure Fund](https://nlnet.nl/assure) and the [NGI Zero Commons Fund](https://nlnet.nl/commonsfund/), both funds established by [NLnet](https://nlnet.nl/) Foundation with financial support from the European Commission's [Next Generation Internet](https://ngi.eu/) programme, under the aegis of DG Communications Networks, Content and Technology under grant agreements No 957073 and No 101092990, respectively.
@ -31,13 +31,12 @@ Open this URL in browser : [http://localhost:8080](http://localhost:8080)
Licensed under either of
Licensed under either of
- Apache License, Version 2.0 ([LICENSE-APACHE2](LICENSE-APACHE2) or http://www.apache.org/licenses/LICENSE-2.0)
- Apache License, Version 2.0 ([LICENSE-APACHE2](LICENSE-APACHE2) or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)
- MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)
at your option.
at your option.
`SPDX-License-Identifier: Apache-2.0 OR MIT`
`SPDX-License-Identifier: Apache-2.0 OR MIT`
---
---
NextGraph received funding through the [NGI Assure Fund](https://nlnet.nl/assure) and the [NGI Zero Commons Fund](https://nlnet.nl/commonsfund/), both funds established by [NLnet](https://nlnet.nl/) Foundation with financial support from the European Commission's [Next Generation Internet](https://ngi.eu/) programme, under the aegis of DG Communications Networks, Content and Technology under grant agreements No 957073 and No 101092990, respectively.
NextGraph received funding through the [NGI Assure Fund](https://nlnet.nl/assure) and the [NGI Zero Commons Fund](https://nlnet.nl/commonsfund/), both funds established by [NLnet](https://nlnet.nl/) Foundation with financial support from the European Commission's [Next Generation Internet](https://ngi.eu/) programme, under the aegis of DG Communications Networks, Content and Technology under grant agreements No 957073 and No 101092990, respectively.
@ -31,13 +31,12 @@ Open this URL in browser : [http://localhost:8080](http://localhost:8080)
Licensed under either of
Licensed under either of
- Apache License, Version 2.0 ([LICENSE-APACHE2](LICENSE-APACHE2) or http://www.apache.org/licenses/LICENSE-2.0)
- Apache License, Version 2.0 ([LICENSE-APACHE2](LICENSE-APACHE2) or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)
- MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)
at your option.
at your option.
`SPDX-License-Identifier: Apache-2.0 OR MIT`
`SPDX-License-Identifier: Apache-2.0 OR MIT`
---
---
NextGraph received funding through the [NGI Assure Fund](https://nlnet.nl/assure) and the [NGI Zero Commons Fund](https://nlnet.nl/commonsfund/), both funds established by [NLnet](https://nlnet.nl/) Foundation with financial support from the European Commission's [Next Generation Internet](https://ngi.eu/) programme, under the aegis of DG Communications Networks, Content and Technology under grant agreements No 957073 and No 101092990, respectively.
NextGraph received funding through the [NGI Assure Fund](https://nlnet.nl/assure) and the [NGI Zero Commons Fund](https://nlnet.nl/commonsfund/), both funds established by [NLnet](https://nlnet.nl/) Foundation with financial support from the European Commission's [Next Generation Internet](https://ngi.eu/) programme, under the aegis of DG Communications Networks, Content and Technology under grant agreements No 957073 and No 101092990, respectively.