- BlockChain - Hyperledger Composer (Running in vagrant container)
- FrontEnd (Web) - Angular 5
- FrontEnd (Mobile App) - Ionic 3
- BackEnd - Play
vagrant global-status- The project is configured to generate the following companies by default
- Airline Company (id: Airline1)
- Cargo Company (id: Cargo1) [default authorisedCargoCompany of Airline Company]
- Cargo Company 2 (id: Cargo2)
- GHA Company (id: GHA1)
- Default generated login credentials for all officers (All companies) is
Username: admin
Password: password
We have configured a special vagrant file inside our project folder. The vagrant file pulls the setup files from this repo
To setup:
vagrant up
cd composer-playground
./playground.sh
./setup.sh./setup.sh starts a composer rest server at port 3000, this is needed by the play server to generate user accounts during initial setup
If there is a need to update bna
./update-network.sh- Vagrant File and Docker.compose-cli.yaml have ports 15000+ opened Vagrant
# Airline
for i in 15000..15019
config.vm.network :forwarded_port, guest: i, host: i
end
# Cargo
for i in 15020..15039
config.vm.network :forwarded_port, guest: i, host: i
end
# Cargo 2
for i in 15040..15059
config.vm.network :forwarded_port, guest: i, host: i
end
# GHA
for i in 15060..15079
config.vm.network :forwarded_port, guest: i, host: i
end
Docker
ports:
- 8080:8080
- 3000:3000
- 3001:3001
- 3002:3002
- "15000-15080:15000-15080"
- air-chain.bna file is the latest version
- Check both blockchain (localhost:8080) and mysql database have the same users that tally
This project has 4 companies and 4 servers. Below is the sql command to create corresponding database.
1 Airline Company
CREATE DATABASE Airline DEFAULT CHARACTER SET utf8;
CREATE USER 'Airline'@'localhost' IDENTIFIED BY 'Airline';
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, REFERENCES ON Airline.* TO 'Airline'@'localhost';2 Cargo Company
CREATE DATABASE CargoCom DEFAULT CHARACTER SET utf8;
CREATE USER 'CargoCom'@'localhost' IDENTIFIED BY 'CargoCom';
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, REFERENCES ON CargoCom.* TO 'CargoCom'@'localhost';3 Cargo Company 2
CREATE DATABASE CargoCom2 DEFAULT CHARACTER SET utf8;
CREATE USER 'CargoCom2'@'localhost' IDENTIFIED BY 'CargoCom2';
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, REFERENCES ON CargoCom2.* TO 'CargoCom2'@'localhost';4 GHA Company
CREATE DATABASE GHA DEFAULT CHARACTER SET utf8;
CREATE USER 'GHA'@'localhost' IDENTIFIED BY 'GHA';
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, REFERENCES ON GHA.* TO 'GHA'@'localhost';Please refer to the installing section in below link
https://www.scala-sbt.org/1.0/docs/Setup.html
Airline use 9000, GHA 9001, Cargo1 9002, Cargo2 9003
sbt
run 9000
A default admin user(userName: admin, password:password) will be created. Web app is already built in production and served by server.
Each type of company has Server,App and Web. Server uses play framework, Web is a angular 5 project and app is ionic project.
For App please use npm install
npm installIonic allows to use browser to simulate the app, however native functions such as scan QR code is not available. It is needed to disable chrome CORS security also since request is from port 4200 and sending request to port 9000.
Do change Ip address in app/src/providers/settings/settings.ts for each app
ionic serveInstall on android phone and android development is required. Do change Ip address in app/src/providers/settings/settings.ts for each app
ionic cordova platform add android
ionic cordova run android --Device
cd hyper-ledger-composer-model
npm testIf any problem is appeared please contact us (Tut3Grp2)
