Advertisement
Gryph_The_Grey

v0.8.0-rc6 ~/.bash_profile

Dec 3rd, 2019
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.04 KB | None | 0 0
  1. export ARCHFLAGS="-arch x86_64"
  2. test -f ~/.bashrc && source ~/.bashrc
  3.  
  4. function start() {
  5. GREEN=$(printf "\033[0;32m")
  6. nohup jormungandr --config config.yaml --genesis-block-hash $GENESIS_BLOCK_HASH >> /home/griff1/nightly/node.out 2>&1 &
  7. echo ${GREEN}$(ps | grep jormungandr)
  8. }
  9.  
  10. function stop() {
  11. echo "$(jcli rest v0 shutdown get -h http://127.0.0.1:${REST_PORT}/api)"
  12. }
  13.  
  14. function stats() {
  15. echo "$(jcli rest v0 node stats get -h http://127.0.0.1:${REST_PORT}/api)"
  16. }
  17.  
  18. function bal() {
  19. echo "$(jcli rest v0 account get $(cat account.txt) -h http://127.0.0.1:${REST_PORT}/api)"
  20. }
  21.  
  22. function faucet() {
  23. echo "$(curl -X POST https://faucet.beta.jormungandr-testnet.iohkdev.io/send-money/$(cat home/griff1/nightly/account.txt))"
  24. }
  25.  
  26. function get_ip() {
  27. echo "${PUBLIC_IP_ADDR}"
  28. }
  29.  
  30. function get_pid() {
  31. ps auxf | grep jor
  32. }
  33.  
  34. function memory() {
  35. top -o %MEM
  36. }
  37.  
  38. function nodes() {
  39. nodes="$(netstat -tupan | grep jor | grep EST | cut -c 1-80)"
  40. total="$(netstat -tupan | grep jor | grep EST | cut -c 1-80 | wc -l)"
  41. printf "%s\n" "${nodes}" "----------" "Total:" "${total}"
  42. }
  43.  
  44. function num_open_files() {
  45. echo "Calculating number of open files..."
  46. echo "$(lsof -u $(whoami) | wc -l)"
  47. }
  48.  
  49. function is_pool_visible() {
  50. echo ${GREEN}$(jcli rest v0 stake-pools get --host "http://127.0.0.1:${REST_PORT}/api" | grep $(cat stake_pool.id))
  51. }
  52.  
  53. function create_stake_pool() {
  54. echo "$(./createStakePool.sh ${REST_PORT} $(cat secret.key))"
  55. }
  56.  
  57. function delegate() {
  58. echo "$(./delegate-account.sh $(cat stake_pool.id) ${REST_PORT} $(cat secret.key))"
  59. }
  60.  
  61. function start_leader() {
  62. GREEN=$(printf "\033[0;32m")
  63. nohup jormungandr --config config.yaml --secret node_secret.yaml --genesis-block-hash ${GENESIS_BLOCK_HASH} >> /home/griff1/nightly/node.out 2>&1 &
  64. echo "${GREEN}$(ps | grep jormungandr)"
  65. }
  66.  
  67. function leader_logs() {
  68. echo "Has this node been scheduled to be leader?"
  69. echo "$(jcli rest v0 leaders logs get -h http://127.0.0.1:${REST_PORT}/api)"
  70. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement