This is the 2.0 backend (essentially a custom blockchain indexer) for Algodex and also includes the rewards calculations.
You can find the contribution guides for getting started in CONTRIBUTING.md
Algodex Documentation: https://docs.algodex.com
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
sudo apt install build-essential
sudo apt-get install pkg-config libssl-dev
cd rewards-calc
cargo build
First make sure CouchDB and Redis services are running according to .integration.test.env. The node.js should not be running as these will be started by the end-to-end test.
cp .testnet.docker.env .env
docker-compose up -f docker-compose.yml -f docker-compose.docker.yml
(todo) The reverse proxy sits in front of algodex-service. The basic request flow is nginx -> reverse-proxy-rust -> algodex-service API
Some instructions are at https://github.com/algodex/reverse-proxy-rust
npm run end-to-end-light
- Website: http://localhost:8080
- Redis Commander: http://localhost:8081/
- Couch Futon: http://localhost:5984/_utils/#login
- Username: admin
- Password: dex
- Sockets/REST(optional): https://github.com/uNetworking/uWebSockets.js/
- Queue/Worker: https://docs.bullmq.io/
- Events(Pub/Sub): https://github.com/luin/ioredis#pubsub
- Database: https://pouchdb.com/api.html https://docs.couchdb.org/en/main/intro/index.html
- Reverse Proxy: https://github.com/algodex/reverse-proxy-rust
-
Broker (Event Publisher->Queue|Sockets): ./services/broker.js
- All "Events" are published and pushed to Queue for basic example
-
Worker (BullMQ Worker): ./services/worker.js
- Removes items from the Queue and stores them in the Database
-
Socket (Event Subscriber and Socket Publisher - only partially implemented): ./server.js
- Push Broker Events to Subscribed Sockets.
- Future example:
ws://localhost/asset/{id}
would subscribe to the appropriate redis channel coming from the Broker
-
API endpoint: ./api/api_server.ts
-
Rewards Calculator ./rewards-calc/src/main.rs