This project was generated with Angular CLI version 12.2.7.
All of the following commands should be run at the root of the project.
-
Verify that you have created a branch based from staging.
-
All pull requests must be created to merge into staging or a lower branch.
-
Never commit changes to the main or staging branches.
-
Before creating a pull request into staging, make sure your branch is not behind staging by any commits. Run
git merge staging
to merge staging into your branch. Resolve any conflicts that may arrise from the merge and verify that your branch still functions as expected. -
Install node packages with
npm i
. (You may need to run with the flag--legacy-peer-deps
.)- In order to successfully install the
@smplfinance
node packages, you must defineSMPL_NPM_TOKEN
as an environment variable in your~/.bashrc
file, if your development on a Linux operating system; or~/.zshrc
file, if you are developing on a Mac operating system.- Generate a Github personal access token with at least read access to Github packages.
- Copy the personal access token.
- Add
export SMPL_NPM_TOKEN=[your Github personal access token]
on a new line in your associated~/.*shrc
file.
- In order to successfully install the
-
Follow the instructions pinned to the devchat slack channel
- Install docker
- download the docker-config.json file
- Run mv ./docker-config.json ~/.docker/config.json
-
In order to successfully pull the needed docker containers from the container registry, you must add the docker/config.json file from the SmplFinance/SmplDocs repository to your the
~/.docker/config.json
path on your local machine. -
Run
docker-compose up -d
to run the docker containers this project is dependent on.
-
Follow the https://capacitorjs.com/docs/android instructions
- Install Android studio and Android SDK
- Run
ionic build
- Install the chrome apk on chrome inside the Android emulator
- Run
npx cap run android
-
Run
npm run start
to start the dev server. -
Navigate to
http://localhost:4200/
. The app will automatically reload if you change any of the source files.
Run ng generate component component-name
to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module
.
@smplfinance packages require authentication. You simply need to define an environment variable SMPL_NPM_TOKEN
.
The value should be set to a github access key from your account. Alternatively you can create a .npmrc file
in your home directory with the appropriate credentials.
If you want to send token to a user, do the following Start the service. Copy the address from the instruction page Then inter the SmplChain docker image.
docker-compose exec SmplChain bash
Then, in the container run the following. "$WALLET_ADDRESS" is the address you copied from the instruction page.
docker-compose exec SmplChain smpl-chaind tx bank send smpl1qzweszzcnkcyr2cn36dlt5upp99ce5eyranlzc $WALLET_ADDRESS 1000smpl
smpl1akyfngpnjgq58mlmuxeyvxx624t70quft6ggx3
Run ng build
to build the project. The build artifacts will be stored in the dist/
directory.
Run ng test
to execute the unit tests via Karma.
Run ng e2e
to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities.
To get more help on the Angular CLI use ng help
or go check out the Angular CLI Overview and Command Reference page.
Install Android Studio and have proper SDK packages installed. Look at the environment setup and android section here. Capacitor Environment Setup
Ensure you have a virtual device set up and docker-compose running.
Run npx cap run android
then select a device to run in an android emulator.
- Verify that you are running the latest commit on staging:
git checkout staging
git pull
- Check the versions of all smplfinance package/container dependencies to make sure they match the latest release
- Verify that the project runs locally as expected:
npm i
(You may need to add the--legacy-peer-deps
flag if the command fails with an error.)docker-compose up -d
npm run start
- open browser to http://localhost:4200
- Verify that all tests pass:
npm run test
- Tag commit and checkout for deploy:
- Verify that package.json, do-spec.staging.yaml, do-spec.prod.yaml have the desired version/tag.
- Important: the last digit of the version/tag should be odd to signify that the build points to staging endpoints.
- Make sure all local changes have been committed and pushed following normal process (branch from staging, commit changes, create pull request for review).
git tag <version>
git push origin <version>
git checkout <version>
- Build and deploy staging application:
npm run image:versioned-staging
npm run push:versioned-staging
doctl app list
- copy the ID for the smpl-wallet-ui-staging app
doctl app update <app-ID> --spec ./do-spec.staging.yaml --wait
- Verify that you are running the latest commit on staging:
git checkout staging
git pull
- Check the versions of all smplfinance package/container dependencies to make sure they match the latest release
- Verify that the project runs locally as expected:
npm i
(You may need to add the--legacy-peer-deps
flag if the command fails with an error.)npm run start
- open browser to http://localhost:4200
- Verify that all tests pass:
npm run test
- Tag commit and checkout for deploy:
- Verify that package.json, do-spec.staging.yaml, do-spec.prod.yaml have the desired version/tag.
- Important: the last digit of the version/tag should be even to signify that the build points to production endpoints.
- Make sure all local changes have been committed and pushed following normal process (branch from staging, commit changes, create pull request for review).
- Create a pull request from the staging branch to main.
- Once the changes have been merged to main:
git checkout main
- Verify the project runs as expect and passes all tests again
git tag <version>
git push origin <version>
git checkout <version>
- Build and deploy production application:
npm run image:versioned-prod
npm run push:versioned-prod
doctl app list
- copy the ID for the smpl-wallet-ui-prod app
doctl app update <app-ID> --spec ./do-spec.prod.yaml --wait
- Remove the android and plugin folder from the root directory
- Change the static IP in the following files
- src/app/configs/keycloakconfig.ts
- resources/android/xml/network_security_config.xml
- Run the command to add platform
ionic cordova platform add android
- Run the command to create build
ionic cordova build android
docker-compose exec SmplChain smpl-chaind tx roles add bank smpl1q28v96p6lhyac2ghjlyylsl4290tl722x9kmtg --from alice
docker-compose exec SmplChain smpl-chaind tx smplcoins mintsusdse 10000 --from alice
docker-compose exec SmplChain smpl-chaind tx bank send smpl1q28v96p6lhyac2ghjlyylsl4290tl722x9kmtg smpl1amjrtwxjtngwgsfun6xgmr9ut8v4v9dh6c0nsd 10usdse
- Run npm run set-url --keycloak_url="KEYCLOAK_URL"