Skip to content

Commit

Permalink
Merge pull request #2 from KomodoPlatform/dev
Browse files Browse the repository at this point in the history
adds wasm_versions to gitignore
  • Loading branch information
smk762 authored Jan 17, 2023
2 parents 8f5bd8e + 58d9283 commit e4e544c
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 9 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,7 @@ dist-ssr
*.njsproj
*.sln
*.sw?

# Custom
wasm_versions/
coins_versions/
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@
## Pre-requisites

- NodejsV16 or newer. Recommendation: use `nvm`: https://www.freecodecamp.org/news/node-version-manager-nvm-install-guide/
- `yarn`. once node and npm are installed, `npm install -g yarn`

## Build steps


- `yarn` -> the first time
- `yarn dev` -> starts a server at http://localhost:1234/
- `npm ci` -> the first time
- `npm run dev` -> starts a server at http://localhost:1234/

## Misc notes

To change the mm2 being used, replace the file: `public/mm2_bg.wasm` with it
To change the mm2 bin being used, replace the file: `public/mm2_bg.wasm` with it

To keep multiple versions of mm2 bins in the public folder and test them one by one, make sure all of them have different names, then replace the name `mm2_bg.wasm` at https://github.com/gcharang/react-atomicdex-wasm/blob/master/src/App.jsx#L30

To keep multiple versions of mm2 bin in the public folder and test them one by one, make sure all of them have different names, then replace the name `mm2_bg.wasm` at https://github.com/gcharang/react-atomicdex-wasm/blob/master/src/App.jsx#L30
Might want to restart the dev server and hard refresh(shift + f5) the browser window when mm2 being used is changed in code or replaced with same name in the file system

might want to re start the dev server when mm2 being used is changed in code or replaced with same name in file system
Best to open/reopen the url: http://localhost:1234/ in a private/incognito window when testing code/mm2 changes, to be completely sure that cached mm2 bins/other code aren't interfering

best to open the url: http://localhost:1234/ in a private/incognito window when testing code/mm2 changes, to be completely sure that cached mm2 bins/other code aren't interfering
To update the API version using a url to a zipfile, use `./update_wasm.sh $zipfile_url`

To update the API version using a url to a zipfile, use `./update_wasm.sh $zipfile_url`
To update the `coins` file version using a url to a raw github data, use `./update_coins.sh https://raw.githubusercontent.com/KomodoPlatform/coins/master/coins`
5 changes: 5 additions & 0 deletions update_coins.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[ ! -d coins_versions ] && mkdir coins_versions
cd coins_versions
commit=$(echo $1 | grep / | cut -d/ -f6)
[ ! -f coins_${commit} ] && wget $1 && mv coins coins_${commit}
cp coins_${commit} ../public/coins

0 comments on commit e4e544c

Please sign in to comment.