Skip to content

Instantly share code, notes, and snippets.

@nonsense
Created September 6, 2022 19:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nonsense/e0b3d2424a094f4c9ab43d8f4f2ac5d3 to your computer and use it in GitHub Desktop.
Save nonsense/e0b3d2424a094f4c9ab43d8f4f2ac5d3 to your computer and use it in GitHub Desktop.
#!/usr/bin/zsh
sectors=`lotus-miner sectors list | grep Available | grep -v "24 weeks" | awk '{print $1}' | paste -s -d' ' | tr -d '"'`
sectors_array=(`echo ${sectors}`);
epoch=`lotus status | grep Sync | awk '{print $3}'`
nextepoch=$((1555200+$epoch))
lotus-miner sectors extend --new-expiration $nextepoch ${sectors_array[@]}
@Angelo-gh3990
Copy link

Angelo-gh3990 commented Sep 18, 2022

@nonsense thank you for putting this together!
I would add --fast to line 3, works faster and has less impact on the execution.

Like:

lotus-miner sectors list --fast | grep Available | grep -v "24 weeks" | awk '{print $1}' | paste -s -d' ' | tr -d '"'`

@nonsense
Copy link
Author

@Angelo-gh3990 --fast doesn't return the expiration for the sectors, so we wouldn't know which Available sectors to extend. Or are you suggesting just always extending all Available sectors?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment