Cosmos TXs Tracer is a repository containing a TypeScript-based package, the
txs-tracer-core
that enables to track a transaction on the Cosmos ecosystem,
and some demo applications that allow to test such a package. The tracer is
able to track both single chain transactions and IBC (cross-chain) ones, by
listening on the channel through a websocket connection, wihtout the usage of
polling.
The core package, is the implementation of two different FSMs that are represented below. The first, implementing a tracker for single chain transactions, which, in the success scenario, proceeds as follows:
- initiates a websocket connection to the node server;
- sends a query message to subscribe a specific event;
- if does not receive any tx up to a particular point in time, a timeout fires and a search is performed.
The second, implements a tracker for IBC transactions, which involves tracking transactions between multiple chains. In the success scenario, it proceeds as follows:
- send a packet (executing the listening as described above);
- wait for the acknowledgement of the packet (executing the listening as described above);
- it is considered completed only if receives the acknowledgement packet.
In the end, the demo applications provides the ability to test the package in two different scenarios:
- The
apps/demo-app
simply show an example where it is possible to track a single tx. In particular, it listen on the first swap message it is sent; - The
apps/demo-app-cosmos
is a more complex example, using also the cosmos-kit, where the user is able to connect his wallet and perform TXs on the mainnet. More specifically, the user can:
- SEND and check the status of such a send transaction
- Perform an IBC between Osmosis and Cosmos and follow the whole transaction, by checking the IBC transfer status.
Node.js is required to run the project.
- Clone the repository to your local machine:
git clone https://github.com/nabla-studio/cosmos-tx-tracer.git
- Install the dependencies:
cd cosmos-tx-tracer
pnpm i
- Start the development server for the one of the example app:
nx serve APP_NAME
example, to run the example apps/demo-app
:
nx serve demo-app
- Open your browser and navigate to http://localhost:4200 to see the app in action.
Run nx graph
to see a diagram of the dependencies of the projects.
Run npx nx connect-to-nx-cloud
to enable remote caching and make CI faster.
👤 Davide Segullo (Code)
- Github: @DavideSegullo
- Twitter: @davide_segullo
We ❤️ contributions! If you'd like to contribute, please read our contributing guidelines.
This project is licensed under the Apache-2.0 License. See the LICENSE file for more information.
If you have any questions or comments about this project, please feel free to contact us on discord.
Copyright © 2023 nabla.