Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin Development : Cosmos (V1) #236

Closed
15 of 17 tasks
heejin-github opened this issue Aug 24, 2022 · 13 comments
Closed
15 of 17 tasks

Plugin Development : Cosmos (V1) #236

heejin-github opened this issue Aug 24, 2022 · 13 comments
Assignees
Labels
area:plugin Anything related to Vatz plugin. good_first_issue Good for newcomers type:feature-development Any development regarding Vatz service/plugin, etc. Vatz Project Name

Comments

@heejin-github
Copy link
Member

heejin-github commented Aug 24, 2022


Checklist

  • New Feature for the Service/Plugin (Vatz)
  • Enhancement (Vatz)
  • others(etc. e.g, documentation, project policy management)

Is your feature request related to a problem? Please describe.

A clear and concise description of what the problem is. such as Ex. I'm always frustrated

make cosmos plugin as an official plugin.

Describe the solution you'd like| Ex

A clear and concise description of what you want to happen

Describe alternatives you've considered

A clear and concise description of any alternative solutions or features you have considered.

Additional context or comment

Add any other context or screenshots about the feature request here.

Child Issues

Phase 1.


Phase 2.

@heejin-github heejin-github added Vatz Project Name area:plugin Anything related to Vatz plugin. type:feature-development Any development regarding Vatz service/plugin, etc. labels Aug 24, 2022
@heejin-github heejin-github self-assigned this Aug 24, 2022
@heejin-github
Copy link
Member Author

1st phase

we already make some plugins for cosmos-sdk/tendermint based project and linux systems. trying to make first version of cosmos plugin with existed plugins, method, or systems in 1st phase.

  1. Create new repo for vatz-plugin-cosmos
  2. Collect developed plugins into vatz-plugin-cosmos
    • exist one : up, block-height, hwstat(cpu, mem, disk)
    • need develop : peer count
  3. All plugins will be based on the Vatz SDK and have its own module.
  4. Build all plugins with make
  5. Run and manage plugins with pm2
  6. Testing on cosmos mainnet sentry machine or any other cosmos-sdk based testnet nodes.

2nd phase

Find improvements and newly developments, if needed.

  1. Check any problem to monitor cosmos node with current plugins.
  2. Check if any further monitoring items required.
  3. Check for unnecessary monitoring items in current plugins.
  4. Find enhancement for Build and Run.
  5. Decide whether cosmos plugin integrate into Vatz and CLI interaction
  6. Discuss about any action items or �requirements for the next phase.

@xellos00 @meetrick @Choi-Jinhong @skonhwang
any feedback is welcome!
Let's start to develop cosmos plugin.

@heejin-github
Copy link
Member Author

plugin list

./vatz-plugin-cosmos
└── plugin
    ├── chainstat
    │   ├── block_height
    │   ├── peer_count
    │   └── up
    └── hwstat
        ├── cpu
        ├── disk
        └── mem

@heejin-github
Copy link
Member Author

@xellos00
Copy link
Member

plugin list

./vatz-plugin-cosmos
└── plugin
    ├── chainstat
    │   ├── block_height
    │   ├── peer_count
    │   └── up
    └── hwstat
        ├── cpu
        ├── disk
        └── mem

I prefer to separate that for checking hardwares because it's going to be used for everyone.

@xellos00 xellos00 added the good_first_issue Good for newcomers label Aug 29, 2022
@heejin-github
Copy link
Member Author

heejin-github commented Aug 31, 2022

plugin list

./vatz-plugin-cosmos
└── plugin
    ├── chainstat
    │   ├── block_height
    │   ├── peer_count
    │   └── up
    └── hwstat
        ├── cpu
        ├── disk
        └── mem

I prefer to separate that for checking hardwares because it's going to be used for everyone.

plugin separated to vatz-plugin-cosmoshub and vatz-plugin-sysutil as we discussed from #225

# tree ./vatz-plugin-sysutil
./vatz-plugin-sysutil
├── plugins
│   ├── cpu_monitor
│   │   ├── go.mod
│   │   ├── go.sum
│   │   └── main.go
│   ├── disk_monitor
│   │   ├── go.mod
│   │   ├── go.sum
│   │   └── main.go
│   └── mem_monitor
│       ├── go.mod
│       ├── go.sum
│       └── main.go
└── README.md
# tree ./vatz-plugin-cosmoshub
./vatz-plugin-cosmoshub
├── plugins
│   ├── cosmos-sdk-blocksync
│   │   ├── main.go
│   │   ├── main_test.go
│   │   ├── Makefile
│   │   ├── mocks
│   │   │   ├── Collector.go
│   │   │   └── Estimator.go
│   │   ├── policy
│   │   │   ├── policy.go
│   │   │   └── policy_test.go
│   │   └── status
│   │       ├── status.go
│   │       └── status_test.go
│   ├── is_alived
│   │   ├── go.mod
│   │   ├── go.sum
│   │   └── main.go
│   └── peer_count
│       ├── go.mod
│       ├── go.sum
│       └── main.go
├── README.md
└── rpc
    └── cosmos
        ├── api.go
        ├── api_test.go
        ├── fixtures.go
        └── mocks
            └── Client.go

@heejin-github
Copy link
Member Author

2022-10-11 vatz-plugin-cosmoshub Phase 1 Development

PR list

Summary

  • Collect developed plugins and revised it with RPC API call.
  • Can execute independent and works well in current.
  • We can go to phase2 development of vatz-plugin-cosmoshub

Code Tree

~/vatz-plugin-cosmoshub # tree .
.
├── Makefile
├── plugins
│   ├── cosmos-sdk-blocksync
│   │   ├── go.mod
│   │   ├── go.sum
│   │   ├── main.go
│   │   ├── main_test.go
│   │   ├── Makefile
│   │   ├── mocks
│   │   │   ├── Collector.go
│   │   │   └── Estimator.go
│   │   ├── policy
│   │   │   ├── policy.go
│   │   │   └── policy_test.go
│   │   └── status
│   │       ├── status.go
│   │       └── status_test.go
│   ├── is_alived
│   │   ├── go.mod
│   │   ├── go.sum
│   │   └── main.go
│   └── peer_count
│       ├── go.mod
│       ├── go.sum
│       ├── main.go
│       └── net_info.go
├── README.md
└── rpc
    └── cosmos
        ├── api.go
        ├── api_test.go
        ├── fixtures.go
        ├── go.mod
        ├── go.sum
        └── mocks
            └── Client.go

10 directories, 26 files

@heejin-github
Copy link
Member Author

heejin-github commented Oct 11, 2022

Phase2 development items


  • Testing on cosmos node
  • Find issue during the test
  • Freeze for open to the public

@xellos00
Copy link
Member

@heejin-github
I've installed following plugins

  • vatz-plugin-sysutil
  • vatz-plugin-cosmos-sdk

is there any command that you used pm2 or other method.
start & stop plugins easy?

@heejin-github
Copy link
Member Author

@heejin-github I've installed following plugins

  • vatz-plugin-sysutil
  • vatz-plugin-cosmos-sdk

is there any command that you used pm2 or other method. start & stop plugins easy?

@xellos00
no longer use pm2. I think It's not familiar way other than node.js.
I'm just using a simple start/stop script.

root@provenance-testnet-validator-dc-seoul:~/dsrv/bin/vatz# ls
default.yaml  plugin_start.sh  plugin_stop.sh  vatz_start.sh  vatz_stop.sh
root@provenance-testnet-validator-dc-seoul:~/dsrv/bin/vatz# cat vatz_start.sh
#!/bin/bash

vatz start --config=/root/dsrv/bin/vatz/default.yaml >> /var/log/vatz/vatz.log 2>&1 &
echo "true"
root@provenance-testnet-validator-dc-seoul:~/dsrv/bin/vatz# cat vatz_stop.sh
#!/bin/bash
set -e
set -v

pid=`pidof vatz`
# Kill process
kill -15 $pid

# wait Kill process
sleep 1

while (( `lsof -p $pid | wc -l` > 0 ))
do
        echo `lsof -p $pid | wc -l`
        sleep 1
done

echo "vatz $pid is killed."
root@provenance-testnet-validator-dc-seoul:~/dsrv/bin/vatz# cat plugin_start.sh
#!/bin/bash

#cosmos-sdk-blocksync >> /var/log/vatz/cosmos-sdk-blocksync.log 2>&1 &
is_alived --rpcAddr="http://localhost:16657" >> /var/log/vatz/is_alived.log 2>&1 &
peer_count --port=9092 >> /var/log/vatz/peer_count.log 2>&1 &
active_status --port=9097 --rpcURI="http://localhost:11317" --valoperAddr="tpvaloper1cnar5gh3mycnlhw9kkmsg3s792e74xs5x787j6" >> /var/log/vatz/active_status.log 2>&1 &
cpu_monitor >> /var/log/vatz/cpu_monitor.log 2>&1 &
mem_monitor >> /var/log/vatz/mem_monitor.log 2>&1 &
disk_monitor >> /var/log/vatz/disk_monitor.log 2>&1 &
echo "true"
root@provenance-testnet-validator-dc-seoul:~/dsrv/bin/vatz# cat plugin_stop.sh
#!/bin/bash

pid=`pidof cosmos-sdk-blocksync`
kill -15 $pid
echo "cosmos-sdk-blocksync $pid is killed."

pid=`pidof is_alived`
kill -15 $pid
echo "is_alived $pid is killed."

pid=`pidof peer_count`
kill -15 $pid
echo "peer_count $pid is killed."

pid=`pidof active_status`
kill -15 $pid
echo "active_status $pid is killed."

pid=`pidof cpu_monitor`
kill -15 $pid
echo "cpu_monitor $pid is killed."

pid=`pidof mem_monitor`
kill -15 $pid
echo "mem_monitor $pid is killed."

pid=`pidof disk_monitor`
kill -15 $pid
echo "disk_monitor $pid is killed."


@xellos00
Copy link
Member

@heejin-github I've installed following plugins

  • vatz-plugin-sysutil
  • vatz-plugin-cosmos-sdk

is there any command that you used pm2 or other method. start & stop plugins easy?

@xellos00 no longer use pm2. I think It's not familiar way other than node.js. I'm just using a simple start/stop script.

root@provenance-testnet-validator-dc-seoul:~/dsrv/bin/vatz# ls
default.yaml  plugin_start.sh  plugin_stop.sh  vatz_start.sh  vatz_stop.sh
root@provenance-testnet-validator-dc-seoul:~/dsrv/bin/vatz# cat vatz_start.sh
#!/bin/bash

vatz start --config=/root/dsrv/bin/vatz/default.yaml >> /var/log/vatz/vatz.log 2>&1 &
echo "true"
root@provenance-testnet-validator-dc-seoul:~/dsrv/bin/vatz# cat vatz_stop.sh
#!/bin/bash
set -e
set -v

pid=`pidof vatz`
# Kill process
kill -15 $pid

# wait Kill process
sleep 1

while (( `lsof -p $pid | wc -l` > 0 ))
do
        echo `lsof -p $pid | wc -l`
        sleep 1
done

echo "vatz $pid is killed."
root@provenance-testnet-validator-dc-seoul:~/dsrv/bin/vatz# cat plugin_start.sh
#!/bin/bash

#cosmos-sdk-blocksync >> /var/log/vatz/cosmos-sdk-blocksync.log 2>&1 &
is_alived --rpcAddr="http://localhost:16657" >> /var/log/vatz/is_alived.log 2>&1 &
peer_count --port=9092 >> /var/log/vatz/peer_count.log 2>&1 &
active_status --port=9097 --rpcURI="http://localhost:11317" --valoperAddr="tpvaloper1cnar5gh3mycnlhw9kkmsg3s792e74xs5x787j6" >> /var/log/vatz/active_status.log 2>&1 &
cpu_monitor >> /var/log/vatz/cpu_monitor.log 2>&1 &
mem_monitor >> /var/log/vatz/mem_monitor.log 2>&1 &
disk_monitor >> /var/log/vatz/disk_monitor.log 2>&1 &
echo "true"
root@provenance-testnet-validator-dc-seoul:~/dsrv/bin/vatz# cat plugin_stop.sh
#!/bin/bash

pid=`pidof cosmos-sdk-blocksync`
kill -15 $pid
echo "cosmos-sdk-blocksync $pid is killed."

pid=`pidof is_alived`
kill -15 $pid
echo "is_alived $pid is killed."

pid=`pidof peer_count`
kill -15 $pid
echo "peer_count $pid is killed."

pid=`pidof active_status`
kill -15 $pid
echo "active_status $pid is killed."

pid=`pidof cpu_monitor`
kill -15 $pid
echo "cpu_monitor $pid is killed."

pid=`pidof mem_monitor`
kill -15 $pid
echo "mem_monitor $pid is killed."

pid=`pidof disk_monitor`
kill -15 $pid
echo "disk_monitor $pid is killed."

Yeah. so currently there's no options to run those plugins overall in the codes, right?

@heejin-github
Copy link
Member Author

Yeah. so currently there's no options to run those plugins overall in the codes, right?

@xellos00 Yes, you're right. we don't have any option.

@heejin-github
Copy link
Member Author

2022-12-28

@heejin-github
Copy link
Member Author

@xellos00 xellos00 removed the good_first_issue Good for newcomers label Jan 26, 2023
@xellos00 xellos00 added the good_first_issue Good for newcomers label Nov 7, 2023
@xellos00 xellos00 changed the title Plugin Development : Cosmos Plugin Development : Cosmos (V1) Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:plugin Anything related to Vatz plugin. good_first_issue Good for newcomers type:feature-development Any development regarding Vatz service/plugin, etc. Vatz Project Name
Projects
None yet
Development

No branches or pull requests

5 participants