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.js
Your 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.js
again. Note your address in the line like this:
====== my single address: UYBHEJNRNQCC3MGK5UO7T6YUHPWTSLXC
Kill the process with Ctrl-C.
-
Edit
vrf-oracle-template.oscript
and replaceyour_oracle_address
andyour_public_key
with 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.js
and setexports.vrf_oracle_aa
to 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.js
again and leave it running as a daemon:
node run.js 2>errlog
Type 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
.