# kestrel2-server

> ### Bond Service instances #### Instance 1 * **Host Name**: kestrel-bond-services1 * **VM**: 1 vCPU, 7.25 GB memory * **DNS**: kestrel-bond-services1.aqaix.com #### Instance 2 * **Host Name**: kestrel-bond-services2 * **VM**: 1 vCPU, 7.25 GB memory * **

Latest version **1.0.0** (published 2022-04-29) · ISC license · 0 weekly downloads

## Install

```sh
npm install kestrel2-server
pnpm add kestrel2-server
yarn add kestrel2-server
bun add kestrel2-server
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; large bundle.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2022-04-29 |
| First published | 2022-04-29 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 24 |
| Unpacked size | 26.9 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | randy-aqaix |

## Links

- npm: https://www.npmjs.com/package/kestrel2-server
- Repository: https://github.com/Aqaix/kestrel2-server
- Homepage: https://github.com/Aqaix/kestrel2-server#readme
- Issues: https://github.com/Aqaix/kestrel2-server/issues
- npm.io page: https://npm.io/package/kestrel2-server

## Dependencies (24)

- [cors](https://npm.io/package/cors.md) ^2.8.5
- [utf8](https://npm.io/package/utf8.md) ^3.0.0
- [uuid](https://npm.io/package/uuid.md) ^8.3.2
- [mocha](https://npm.io/package/mocha.md) ^6.2.0
- [mysql](https://npm.io/package/mysql.md) ^2.18.1
- [wtf-8](https://npm.io/package/wtf-8.md) ^1.0.1
- [multer](https://npm.io/package/multer.md) ^1.4.1
- [express](https://npm.io/package/express.md) ^4.16.4
- [request](https://npm.io/package/request.md) ^2.88.0
- [winston](https://npm.io/package/winston.md) ^3.6.0
- [credential](https://npm.io/package/credential.md) ^2.0.0
- [csv-reader](https://npm.io/package/csv-reader.md) ^1.0.7
- [http-status](https://npm.io/package/http-status.md) ^1.3.2
- [@aqaix/utils](https://npm.io/package/@aqaix/utils.md) ^1.8.0
- [jsonwebtoken](https://npm.io/package/jsonwebtoken.md) ^8.5.1
- [docx-templates](https://npm.io/package/docx-templates.md) ^3.0.0
- [client-sessions](https://npm.io/package/client-sessions.md) ^0.8.0
- [express-winston](https://npm.io/package/express-winston.md) ^4.2.0
- [form-urlencoded](https://npm.io/package/form-urlencoded.md) ^3.0.0
- [request-promise](https://npm.io/package/request-promise.md) ^4.2.5
- [google-auth-library](https://npm.io/package/google-auth-library.md) ^7.0.4
- [winston-loggly-bulk](https://npm.io/package/winston-loggly-bulk.md) ^3.2.1
- [@aqaix/server-configuration](https://npm.io/package/@aqaix/server-configuration.md) ^1.1.0
- [@aqaix/server-authentication-aqaix](https://npm.io/package/@aqaix/server-authentication-aqaix.md) ^1.7.3

## Recent versions

- 1.0.0 (latest) — 2022-04-29

## README

# Kestrel2 Server
## Google Cloud Platform

### Bond Service instances
#### Instance 1
* **Host Name**: kestrel-bond-services1	
* **VM**: 1 vCPU, 7.25 GB memory
* **DNS**: kestrel-bond-services1.aqaix.com
#### Instance 2
* **Host Name**: kestrel-bond-services2	
* **VM**: 1 vCPU, 7.25 GB memory
* **DNS**: kestrel-bond-services2.aqaix.com

#### Install node.js and npm
From here: https://linuxize.com/post/how-to-install-node-js-on-centos-7/
```
curl -sL https://rpm.nodesource.com/setup_11.x | sudo bash -
sudo yum install nodejs
node --version
npm --version
```
## Configure the Services
### Main Services for APIs
```
sudo vi /usr/lib/systemd/system/kestrel2-bond.service
```
Insert the following lines:
```
[Unit]
Description=kestrel2-bond

[Service]
ExecStart=/bin/bash /opt/aqaix/kestrel2-server/start.sh
Restart=on-failure
RestartSec=60s

[Install]
WantedBy=multi-user.target
```
Start the service:
```
sudo systemctl start kestrel2-bond
```

Monitor service standard out:
```
sudo journalctl -u kestrel2-bond -f
```
### Import Ipreo Service
```
sudo vi /usr/lib/systemd/system/kestrel-import-ipreo.service
```
Insert the following lines:
```
[Unit]
Description=kestrel-import-ipreo

[Service]
ExecStart=/bin/bash /opt/aqaix/kestrel-bond-services/start-import-ipreo.sh
Restart=on-failure
RestartSec=60s

[Install]
WantedBy=multi-user.target
```
Start the service:
```
sudo systemctl start kestrel-import-ipreo
```

Monitor service standard out:
```
sudo journalctl -u kestrel-import-ipreo -f
```

## Configure MySQL Server to Handle Large Packets
Add max_allowed_packet setting to the my.cnf file:
```
sudo vi /etc/my.cnf[mysqld]
[mysqld]
max_allowed_packet=500M
```
Restart the server
```
sudo service mysql restart
```

### Increase Number of MySQL Connections
Both the OS and MySQL need to be configured.

Assuming Cent OS 7 or Cent OS 8:

```sudo vi /etc/security/limits.conf```
At the end of the file add these two lines:
```aidl
mysql hard nofile 65535
mysql soft nofile 65535
```

Then update the MySQL Configuration:
```
sudo vi /etc/my.cnf
```

```
 [mysqld]
 max_connections = 512
```
```
sudo systemctl restart mysqld
```


Questions for Kestrel

1. Ask aboubt "Other Finance Team contacts: Bond Counsel, Municipal advisor, or underwriter
Phone, email (need room to add 3 or 4)"
3 or 4 of what?

2. Reporting frequency units?

## Kestrel Meeting Tuesday, May 7th 2019
They added two new questions (yes/no) intake regarding social bonds - will email us that.
There can be multiple underwriters 3 - 4

Reporting units: quarterly annually only two units.

Private - don't release publicly - confidential - might apply to uplodaed documents.

## IPREO Integration Notes
```
 https://identity.cas.ipreo.com/connect/token
 -d 'grant_type=client_credentials&scope=deals-read%20permissions-read%0A%0A&client_id=<client_id>&client_secret=<client_secret>''
 ClientId: api-kestrel-consulting.client
 Secret: 710ce008-1932-424e-8212-7b8140bcf24f
curl https://identity.cas.ipreo.com/connect/token -X POST -d 'grant_type=client_credentials&scope=deals-read%20permissions-read%0A%0A&client_id=api-kestrel-consulting.client&client_secret=710ce008-1932-424e-8212-7b8140bcf24f'
 this one works
curl -v -H "Authorization: Bearer $ACCESS_TOKEN" 'https://api.cas.ipreo.com/book-building/deals/v1/deals/fixed-income/municipal?accessType=Public'
curl -g -v -H "Authorization: Bearer $ACCESS_TOKEN" 'https://api.cas.ipreo.com/book-building/deals/v1/deals/fixed-income/municipal?accessType=Public&criteria=[{"field":"SaleDate.Date","operator":">=","value":"2020-05-04"}]' | python -m json.tool
```

---
_Source: https://npm.io/package/kestrel2-server · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
