hermeznetwork / price-updater-service Goto Github PK
View Code? Open in Web Editor NEWNew service to Price Update feature from Hermez
New service to Price Update feature from Hermez
Maybe rename the file price_updater_collection.json
to postman_price_updater_collection.json
it going to help the users clearly identifies the files purposes.
It is necessary to add a README
that explains the usage service and environment variables.
It could be worth it have another provider wich would be "hardcoded", and then the hardcoded prices would be all in the same file
We had a chat with @laisolizq and we have some questions regarding price-updater functionality xD
Price-updater service requires some environment variables which includes connection to postgres hermez database:
thanks !!
Add uniswap file to allow modify the uniswap token addresses
Use the hermez node logger because it is much better
It is necessary to add unit tests for all functionalities and endpoints.
As user, I want to know what commands are required or optional to run on set up.
As a developer, I want to know that all requests need of Origin header
Add the ability to use other provider for a specific token If the price can't be retrieved from the first provider by any reason.
It would be nice if we could config a priority list of providers.
If there some error not expected, we should logging the message correctly.
related to #9
The price updater can load configurations from a json file to be used as configuration of provider. The struct is pretty simple:
Bitfinex example:
{
"provider": "bitfinex",
"config": {
"0": "eth-add"
}
The config
object represent the relation of tokenID on hermez-node and ethereum address of token on mainnet.
As we test from Origin localhost
, it won't work once we do apply Origin limits. A possible solution is to have an easy to change API key that we can then share on Notion for internal development.
The context is: A lot error logs are sent to elastic service, even this log isn't related to an error because are using a wrong log level.
Use only one price updater service to update the prices in many hermez node synchronized in the same network (environment).
This will ovoid the need of having multiple price updater services that sync the same tokens
If the token it is not defined in the json, get the information from the table "token" and try to retrieve the price using this symbol or contract address. This is necesary for new tokens that can be set from the smart contract any time
[ ] - Create a documentation to setup the price updater
[ ] - Improvements to README
$
in a text command to users know that command is runnable by binaryCould the actual endpoint: /v1/tokens accepts an optional value to filter the list to a specific tokens. Params could be as Filter currencies endpoint that symbols are separated by | so we can request id=0|1 and maybe with this improvement we could remove the other endpoint /v1/tokens/<TOKEN_ID> or replace it to this approach.
Returns format could be the same
It will help the user to have Price Updater as a Linux Service.
However, to make it opcional and easy to use I would suggest to do not include it in a make file, I would suggest to let it as priceupdater.service
configuration file in project root folder and another specific priceupdaterserviceconfig.md
markdown file giving instructions how to setup it.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.