项目作者: AndreiD

项目描述 :
an arweave datafeed
高级语言: Go
项目地址: git://github.com/AndreiD/arweave-currency-datafeed.git
创建时间: 2019-11-17T13:52:44Z
项目社区:https://github.com/AndreiD/arweave-currency-datafeed

开源协议:MIT License

下载



Arweave Currency Datafeed


currency rates, on Arweave



:moneybag:

Wallet of this feed -> hjCuCtTDySi9_KNtRxmPIsAyYVrTXeJZNP3R1aHfNPg

License

currency rates, on Arweave

Click here for what it stores -> currencies.json

Features

Get the currency rates API

People should query using ARQL for the latest file like this

Tip: you can use https://ibwslcweo3rb.arweave.net/1w40L6Z8WLrRTZiBRcp4qMPaMuJfblUlB9pqovkh5PQ
if you want to quickly test it

  1. {
  2. op: 'and',
  3. expr1: {
  4. op: 'equals',
  5. expr1: 'from',
  6. expr2: 'hjCuCtTDySi9_KNtRxmPIsAyYVrTXeJZNP3R1aHfNPg'
  7. },
  8. expr2: {
  9. op: 'equals',
  10. expr1: 'TIME-HOUR',
  11. expr2: '2019-11-17T15'
  12. }
  13. }

Since it updates hourly, I’ve added a tag called “TIME-HOUR”

TIME-HOUR represents the first part of the ISO8601 time formatting (UTC)
so get the unix time, transform it to ISO8601, and leave just the date & hours

If you think of a better way to do this, let me know

Code your own datafeed

  • step 1: think about how would people query your datafeed
  • step 2: check the logic under sync.go.
  • step 3: reuse the config file & the push to arweave functions

Use it as a template

If you want to use this as a template for your project, for whatever reason, it’s simple

  • edit the config file
  • check the logic under sync.go

Configuration file

  1. {
  2. "debug": true,
  3. "nodeURL": "https://arweave.net",
  4. "appID": "YOUR_OPENEXCHANGERATES_ORG_APPID_HERE",
  5. "walletFile": "/PATH/TO/YOUR/arweave-wallet.json",
  6. "server": {
  7. "host": "localhost",
  8. "port": 5555
  9. }
  10. }

Where:

  • debug run with move verbosity
  • nodeURL the arweave node url
  • appID the https://openexchangerates.org APP ID
  • walletFile the location of the wallet.json file
  • server ip & port where this service should run

Special thanks to:

https://github.com/Dev43/arweave-go -> for the transaction signing & transmitting code

Bugs / Features / Questions

fell free to create an issue

TODO://

  • tags
  • awaiting your idea

Sponsors

Does your company use arweave-datafeed ? Help keep the project bug-free and feature rich by sending a small donation

License

:moneybag: Arweave Currency Datafeed is released under the MIT license.