Goal clerk password

Hi There,

I am trying to write a script on my mac to participate in consensus, but I am having trouble with setting the wallet password in my script. I am trying to set the online status to true every 5000 seconds (~ 5 sec per round) for 1000 rounds, but every time I use goal account changeonlinestatus ... I am asked for my wallet password. I thought I could just do something like this:

`echo password | goal account changeonlinestatus ... `

but when I do this I get an error about invalid ioctl…

What am I missing?

Thanks,
Jose

Jose,

The goal command is trying to read the password from the tty and not from the stdin, which is why passing the password via a pipe doesn’t work.

For our automation processes, we use a tool called expect that knows how to bind a pseudo tty input to the goal command, and passing in the password - see go-algorand/goalExpectCommon.exp at master · algorand/go-algorand · GitHub for example.

Is there any particular reason you want to renew the participation key every 5000 rounds ? most of the keys, I believe, I being generated ( and registered online ) for a long duration; i.e. several millions of rounds.

Another approach is to use an empty password, which would save you the needs to re-type the password over and over. It might be slightly less secured, but keep in mind that the KMD ( who receives the password ) only accept incoming connections from your computer. So, as long as your computer doesn’t get compromised, it shouldn’t be a horrendous security issue.

@tsachi
Thank you for your response. The intent is to go online to participate in consensus every 1000 rounds. Every round is around 4.5 seconds. So every 5000 seconds (5 * 1000) I do the following:

goal account changeonline status ... --online=true 
goal clerk sign ...
goal clerk rawsend

From what I understand, the online status is only good for 1000 rounds max. Am I understanding this right? It does seem odd that I need to continue to set the online status so often.

Regards,
Jose

@josep01972, ahh - I see where the confusion is coming from.

There are two different “time lines”. The first one is the participation key validity range.
You create a participation key that is good for voting starting the current round, and (let’s say) up to 10 million round from now.

Separately, you create a transaction that inform the network that your participation key is going to (sometimes) vote in the consensus. This transaction ( like all other transaction types ), has a limit of 1000 rounds before need to be applied to the blockchain.

If you “miss” the 1000 rounds window, you can send another transaction.

The 1000 rounds maximum you referenced is for the transaction validity period.

Have a look at this example for the renewal of participation keys showing 3M rounds per key:

@tsachi

That is what I understand as well. The participation key is set for 30 million rounds so I think I understand that correctly. I think what I was describing is the transaction to attempt to vote in consensus. Do I have to send a transaction every 1000 rounds to make sure I participate, or do I just have to send 1 transaction to go online?

Thanks,
Jose

no, you send only a single transaction to go online.

Once your account is registered as an online account, your node would send votes ( when elected by the consensus protocol ).

Your account won’t change its state because your laptop got turned off, if that was your concern.

expanding on this - you will need to send another transaction with a new key once the 30 million rounds have passed.

@tsachi - Thank you for all the information. I think I understand now.