Skip to content

Commit

Permalink
fix ipfs and tee launch bugs (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
LowEntropyBody committed Mar 2, 2020
1 parent 1e2cb2b commit e1ab718
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,8 @@ you will see a warning like:

Need to make sure your tee has plotted your empty disk and reported your first work report.

- Waiting one era

- Click "Validate" button, like:
![set session key](doc/img/start_validate.PNG)

Expand Down
13 changes: 9 additions & 4 deletions stcript/crust-client.sh
Original file line number Diff line number Diff line change
Expand Up @@ -505,9 +505,13 @@ ipfsLaunch()
eval $cmd_run
else
nohup $cmd_run &>$2 &
ipfs_pid=$(ps -ef | grep "$cmd_run" | grep -v grep | awk '{print $2}')
sleep 5
ipfs_pid_str=$(netstat -ntulp | grep $api_port)
ipfs_pid_str=${ipfs_pid_str[0]#tcp 0 0 0.0.0.0:$api_port 0.0.0.0:* LISTEN }
ipfs_pid_str=${ipfs_pid_str[0]/\/ipfs/}
ipfs_pid=$(echo $ipfs_pid_str)
mv $2 $2.$ipfs_pid
verbose INFO "Launch ipfs in backend (pid is $ipfs_pid), log information will be saved in $2.$ipfs_pid . If ipfs launch failed, please check the port usage, old ipfs may be running.\n"
verbose INFO "Launch ipfs in backend (pid is $ipfs_pid), log information will be saved in '$2.$ipfs_pid'. If ipfs launch failed, please check the port usage, old ipfs may be running.\n"
fi
}

Expand Down Expand Up @@ -567,9 +571,10 @@ teeLaunch()
eval $cmd_run
else
nohup $cmd_run &>$2 &
sleep 3
tee_pid=$(ps -ef | grep "$cmd_run" | grep -v grep | awk '{print $2}')
mv $2 $2.$tee_pid
verbose INFO "Launch tee with $1 configurations in backend (pid is $tee_pid), log information will be saved in $2.$tee_pid\n"
mv $2 $2.${tee_pid[0]: 0: 5}
verbose INFO "Launch tee with $1 configurations in backend (pid is $tee_pid), log information will be saved in $2.${tee_pid[0]: 0: 5}\n"
fi
}

Expand Down

0 comments on commit e1ab718

Please sign in to comment.