Skip to content

Commit

Permalink
chore: add script to setup iota-sdk nova locally (#919)
Browse files Browse the repository at this point in the history
  • Loading branch information
msarcev authored Dec 13, 2023
1 parent 720243e commit af95c35
Show file tree
Hide file tree
Showing 7 changed files with 176 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@ config.local.feed.json
config.staging.json
config.prod.json
env.js

iota-sdk
64 changes: 64 additions & 0 deletions api/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"@iota/iota.js-chrysalis": "npm:@iota/iota.js@^1.8.6",
"@iota/mqtt.js": "^1.8.6",
"@iota/sdk": "1.1.1",
"@iota/sdk-nova": "../iota-sdk/bindings/nodejs",
"@iota/sdk-wasm": "^1.0.4",
"@iota/util.js": "^1.8.6",
"@iota/validators": "^1.0.0-beta.30",
Expand Down
78 changes: 78 additions & 0 deletions client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"@iota/mam-legacy": "github:iotaledger/mam.js#fddc95f60539b9a31a4db1b5b56e0dedb8994883",
"@iota/mam.js": "^1.6.2",
"@iota/sdk-wasm": "1.1.1",
"@iota/sdk-wasm-nova": "../iota-sdk/bindings/wasm",
"@iota/util.js": "^1.8.6",
"@react-three/drei": "^9.84.2",
"@react-three/fiber": "^8.14.2",
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
"scripts": {
"setup:client": "cd client && npm install && npm run postinstall",
"setup:api": "cd api && npm install && npm run build-compile && npm run build-config",
"setup:dev": "npm run clear && npm run prepare && npm run setup:client && npm run setup:api",
"setup:dev": "npm run clear && npm run setup:sdk-nova-local && npm run prepare && npm run setup:client && npm run setup:api",
"clear": "rimraf api/node_modules api/dist client/node_modules client/build",
"dev": "concurrently 'cd api && npm run start-dev' 'cd client && npm run start'",
"pre-push": "concurrently 'cd api && npm run build-compile && npm run build-lint && npm run build-config' 'cd client && npm run build'",
"prepare": "husky install"
"prepare": "husky install",
"setup:sdk-nova-local": "./setup_nova.sh"
},
"devDependencies": {
"concurrently": "^8.2.2",
Expand Down
27 changes: 27 additions & 0 deletions setup_nova.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash
SDK_DIR="iota-sdk"
TARGET_COMMIT="8d3f742c07ea94669d6e7ab7f8a85fe9d48c7af8"

if [ ! -d "$SDK_DIR" ]; then
git clone -b 2.0 [email protected]:iotaledger/iota-sdk.git
cd "./$SDK_DIR"
else
echo "Pulling nova-sdk..."
cd "./$SDK_DIR"
git pull
fi

echo "Checking out nova-sdk commit $TARGET_COMMIT"
git checkout "$TARGET_COMMIT"

echo "Building nodejs bindings"
cd "./bindings/nodejs"
yarn
yarn build

echo "Building wasm bindings"
cd "../wasm"
yarn
yarn build


0 comments on commit af95c35

Please sign in to comment.