Skip to content

proyecto-chaucha/chochin

Repository files navigation

OP_RETURN Buffer API for Notarization

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.

Installation

make install or make install-pip

Config

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

Run

make api or make nohup

You can also check the Makefile for additional commands.

Endpoints

  • /?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'

About

A simple API for message notarization

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published