[Updated] I was looking for an example grpcurl script that has full parameters required to change the power target on a miner. My use case is to run miner at the lowest power possible during evening, and max/full power during the day when my solar panels are active. I've put this into cron job on a nearby linux machine.
I reviewed the authenticate script and proto files and figured out that the message parameters are positional along with the names of the variables. Some variables are expected in json format, and was able to work out this syntax after reviewing the other proto files (units for Power) and reverse engineered the json format. Suggest adding something like this to the package in examples directory. May be cleaner with proto files ?
thanks for making this possible.
examples/setPowerTarget.sh:
#!/bin/sh
USERNAME=xxx
PASSWORD=yyy
BOSMINER=miner:50051
# authenticate to miner
BOSAUTH=$(grpcurl -plaintext -vv -d '{"username": "'"$USERNAME"'", "password": "'"${PASSWORD}"'"}' "${BOSMINER}" braiins.bos.v1.AuthenticationService/Login|awk '$1=="authorization:" {printf "%s%s",$1,$2}')
# set miner performance power target
SAVE_ACTION_AND_APPLY=2
WATTS=1800
grpcurl -plaintext -vv -H "${BOSAUTH}" -d '{"save_action": "'"${SAVE_ACTION_AND_APPLY}"'", "power_target": { "watt": "'"${WATTS}"'"}}' "${BOSMINER}" braiins.bos.v1.PerformanceService/SetPowerTarget
thanks
[Updated] I was looking for an example grpcurl script that has full parameters required to change the power target on a miner. My use case is to run miner at the lowest power possible during evening, and max/full power during the day when my solar panels are active. I've put this into cron job on a nearby linux machine.
I reviewed the authenticate script and proto files and figured out that the message parameters are positional along with the names of the variables. Some variables are expected in json format, and was able to work out this syntax after reviewing the other proto files (units for Power) and reverse engineered the json format. Suggest adding something like this to the package in examples directory. May be cleaner with proto files ?
thanks for making this possible.
examples/setPowerTarget.sh:
thanks