Oracle that generates verifiable random numbers.
- Run run.js once, it'll crash at this point, that's ok.
node run.js- Generate your RSA private and public keys:
node genKeys.jsYour public key is now saved in pubkey.pem and the private one in privkey.pem in your data folder. The program shows the full paths after running.
- Run
run.jsagain. Note your address in the line like this:
====== my single address: UYBHEJNRNQCC3MGK5UO7T6YUHPWTSLXC
Kill the process with Ctrl-C.
-
Edit
vrf-oracle-template.oscriptand replaceyour_oracle_addressandyour_public_keywith your address and public key respectively. You can remove the header/footer like-----BEGIN PUBLIC KEY-----and line-breaks from the public key. -
Deploy this AA from your Obyte wallet. Note its address.
-
Edit
conf.jsand setexports.vrf_oracle_aato the address of the newly deployed AA. -
Send some Bytes to your VRF oracle address from step 3 (not to the AA address). They are needed to pay fees.
-
Run
run.jsagain and leave it running as a daemon:
node run.js 2>errlogType Ctrl-Z, then bg, then exit the session.
Your oracle will watch for randomness requests from City AA (and maybe other consumers that need secure randomness) and generate and post randomness accordingly.
If you need to add more consumers, edit consumer_aas in conf.js.