craftcoin/craftcoin — pull request #10 by TierNolan (2013-08-12 21:59:59+00:00)
Title: Add sendalert rpc call

This adds alert support for the rpc interface.

It would be more secure to have an offline signing computer. However, this system works.

Instructions for generating the keys are included in the alertgen.cpp file.

I only tweaked the unix craftcoind build. To build qt, the qt makefile would have to have alertgen added.

The parameters in the rpc call are

sendalert \ \ \ \[priority=20\] \[cancelid=0\] \[expiration=relayuntil\] \

id: The id of the message (new alerts should have a higher id than old ones)
message: The actual message (needs quotes if more than 1 word)
relayuntil: The unix timestamp for when to stop relaying the alert
priority: The priority of the message
cancelid: Cancels all alerts with an id less than or equal to this
expiration: The unix timestamp for when to stop displaying the alert
privatekey: Hex representation of the 279 byte encoded private key

For priorities
1000 priority is warnings (like low disk space)
2000 priority is major warnings (chain reorg of more than 6 blocks)

2001 would guarantee that no system message has higher priority than the alert.
20 means display the alert unless there is a system message