Skip to content
This repository has been archived by the owner on Jan 26, 2024. It is now read-only.

Latest commit

 

History

History
82 lines (51 loc) · 3.49 KB

workflow.md

File metadata and controls

82 lines (51 loc) · 3.49 KB

TEZOS API GATEWAY WORKFLOW

There are 2 main objectives of Tezos API Gateway project:

  • Interact with Tezos smart contract
  • Follow up an operation

The diagrams shown in this documentation illustrate the asynchronous mode, where RabbitMQ is used to transfer messages between the web server and the workers (for the injection and send processes).

The synchronous mode doesn't use the workers or RabbitMQ : all actions are processed by the web server.

Definitions

JOBS

A job is created after a request to interact with Tezos smart contract sent to Tezos Api Gateway (through forge or send transactions)

JOB STATUS

The status of the job:

Status Explanation
CREATED The job is just created, which means a request to forge/send is just sent
PUBLISHED The request to interact with Tezos smart contract is published to Tezos (which means operation hash is formed)
DONE The job is done when the operation associated to it is confirmed on Tezos Block Chain

Interact with Tezos smart contract

There are 2 ways that user can interact with Tezos smart contract:

1. Send transactions

Tezos Api Gateway supports the Vault Signer.

If user want to perform the signing inside the Tezos Api Gateway using Vault, send transactions option is preferred. Send transactions will handle all the steps to submit the operation to Tezos Block Chain (forge, sign, pre-apply and inject).

DIAGRAM send_transactions.png

SERVICES INVOLVE

2. Forge and Injection

For any reasons that user does not want to use Vault Signer, or want to perform the signing process outside the system, he/she can choose forge and injection option. This process break the interaction into 2 steps:

  • Forge: Using the parameters of the forge operation, a new raw transaction is created. The raw transaction requires the signature and can be sent to the blockchain at a later stage.
  • Inject: Pre-apply the transactions and inject the operation using the signed raw transaction and signature.

DIAGRAM forge_and_injection.png

SERVICES INVOLVE

Follow up an operation

After submitting an operation to Tezos Blockchain, user might want to check the operation status (confirmed/failed) and build an alert system for that. Check operation status worker is built to serve this goal.

The worker will get the operation hash of the jobs with status PUBLISHED, then check the operation status by using Indexer Pool. If an operation is successfully confirmed on Tezos Blockhain, publish a message with the operation details.

DIAGRAM check_operation_status.png

SERVICES INVOLVE