This is a simple API for sending OP_RETURN messages. And retry them using a cron job until they are notarized.
This is a handy script because you could not send transactions when you have no confirmations in the previous transaction.
With this buffer you can send any number of messages and they will get to the Chaucha blockchain eventually.
Configure the .env
file
INPUT_PRIVKEY="" # Private key to sign the tx
INPUT_PUBKEY="" # Public key to get the amount
INPUT_SENDKEY="" # Public key to send the tx to
make api
or make nohup
You can also check the Makefile for additional commands.
-
/?message=""
: Store the message in the queue.
Example:
curl -i -X GET 'http:/0.0.0.0:8000/?message=holamundo'
-
/cron
: Execute OP_RETURN using the latest item inside queue. Setup a cronjob to call this endpoint at least every 2 minutes.
Example:
curl -i -X GET 'http:/0.0.0.0:8000/cron'
-
/notary
: Show all the notarizations.
Example:
curl -i -X GET 'http:/0.0.0.0:8000/notary'
-
/history
: Show all the message stored (including non notarized ones).
Example:
curl -i -X GET 'http:/0.0.0.0:8000/history'