peerassets / papi Goto Github PK
View Code? Open in Web Editor NEW[DEPRECATED] Dockerized PeerAssets API service.
License: BSD 3-Clause "New" or "Revised" License
[DEPRECATED] Dockerized PeerAssets API service.
License: BSD 3-Clause "New" or "Revised" License
A rollback of the database needs to be executed once the server receives an alert of a blockchain reorganization.
Example:
db_engine = 'sqlite'
or
db_engine = 'postgresql'
papi has no record of the issuance with txid=229f04efa082d2087bdc31bdefb95f448c6a5ad2289682ab2679e2b8e5d0b2e08e9, but we've confirmed with pacli that it exists:
pacli card decode 6a0f08011201011801220675ab5ab5ab5a
version: 1
number_of_decimals: 1
amount: [1]
asset_specific_data: b'u\xabZ\xb5\xabZ'
Deck spawning is still working fine, so I guess it's not just an issue of synchronization
Discovered as a result of investigating the problem's effect on chizukeki
These variable will be imported and used in app.py
app.run(host=host, port=port, debug=debug)
Where host is a string, port is an integer, and debug is a boolean.
Replace the application initialization functions with proper coroutines to be scheduled for execution with asyncio tasks.
full with docker examples and so on
Updated issue from @saeveritt - host and port have been added to conf.
jobs.py needs the following.
@rq.job recurring 5 minute crontask that checks the Queue class found in sync.py ( redis connection ) for transactions that need to be processed. These transactions come from walletnotify. The transactions need to be put together in a batch gettransaction
rpc call and parsed to determine if they're valid PeerAssets transactions. If so, determine which deck they belong to and add them to the papi database then update their respective deckstates.
@rq.job recurring 5 minute crontask that grabs the most recent card recorded into papi.db, grabs the checkpoint (blockhash) of that card, and then validates that the blockhash is still valid on the chain with a getblock <blockhash>
rpc call. If not, grab the next card until a valid blockhash appears. From that point remove all cards/decks that come after that checkpoint chronologically and rescan/recalculate deckstates.
Docker settings for rq worker. May need to define the FLASK_APP environment variable so the
flask rq scheduler
or flask rq worker
points to the correct directory.
.
Due to possibility of blockchain reorg, db should be rescanned once a hour.
This can be done using https://github.com/coleifer/huey
There needs to be a background task, perhaps initialized by blocknotify, that checks for blockchain reorganizations. If one is detected then throw an alert to the server.
With conf parameter on where to save the log.
https://github.com/PeerAssets/papi/blob/master/papi/data.py#L8 should be taking parameters from the conf file, like port, directory and username/password.
Example:
host:port/api/v1/decks/<deckid>/balance/<address>
This would return the current balance of a given address per the specified deck.
Configure the scheduling of startup coroutine execution.
The app should preferably be deployed via docker container.
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.