Skip to content

Commit 88d68b5

Browse files
committed
Added performance improvement suggestions.
- Added instructions for installing `glances`.
1 parent 25aab8e commit 88d68b5

File tree

4 files changed

+47
-0
lines changed

4 files changed

+47
-0
lines changed

commands/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
## Monitoring
2+
3+
### glances
4+
5+
`glances` is a tool to help with monitoring resource consumption.
6+
7+
```bash
8+
sudo apt-get install python3-pip
9+
pip install --user glances
10+
```
11+
112
## Logging
213

314
### Gets the log output of a service.

terra/README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,20 @@ After the script has completed running and the applications are downloaded, be s
4343

4444
> /home/$TERRA_USER/oracle-feeder/price-server/config/default.js
4545
46+
### Performance improvement
47+
48+
As it is, running the feeder on `ts-node` consumes over 100 MB of memory. Use the patch file _sample/feeder.patch_ to transpile the TS code into JS.
49+
50+
```bash
51+
cd ~/oracle-feeder/feeder
52+
git apply ~/Downloads/validator-script/terra/sample/feeder.patch
53+
npm run build
54+
```
55+
56+
Then copy _sample/feeder-startjs.sh_ into the _feeder_ directory.
57+
58+
Modify _/etc/systemd/system/feeder.service_ to change `feeder-start.sh` to `feeder-startjs.sh`.
59+
4660
# Migration
4761

4862
To migrate the validator, the main consideration is whether the blockchain data is available or not. In other words, whether the blockchain data is available on an external storage volume or does it need to be rebuilt. The latter scenario typically happens when moving to a different provider.

terra/sample/feeder-startjs.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
cd /home/$USER/oracle-feeder/feeder
3+
/usr/local/bin/npm startjs vote --\
4+
--source http://localhost:8532/latest \
5+
--lcd http://localhost:1317 \
6+
--lcd https://lcd.terra.dev \
7+
--chain-id "${CHAIN_ID}" \
8+
--validator "${VALIDATOR_KEY}" \
9+
--password "${ORACLE_PASS}"

terra/sample/feeder.patch

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/feeder/package.json b/feeder/package.json
2+
index 93a428f..4e72a60 100644
3+
--- a/feeder/package.json
4+
+++ b/feeder/package.json
5+
@@ -5,6 +5,8 @@
6+
"license": "Apache-2.0",
7+
"scripts": {
8+
"start": "ts-node src/index.ts",
9+
+ "build": "tsc",
10+
+ "startjs": "node dist/src/index.js",
11+
"lint": "eslint 'src/**/*.{js,ts,tsx}' --fix"
12+
},
13+
"dependencies": {

0 commit comments

Comments
 (0)