|
| 1 | +# Polkadot Mempool Explorer API |
| 2 | + |
| 3 | +Mempool Explorer API Definition [api-docs](https://mempool.dot.protofire.io/api/v1/api-docs). |
| 4 | + |
| 5 | +## Environment setup |
| 6 | + |
| 7 | + - Install [Node.js](https://nodejs.org/) |
| 8 | + - Recommended method is by using [NVM](https://github.com/creationix/nvm) |
| 9 | + - Recommended Node.js version is v12 |
| 10 | + |
| 11 | +## Demo |
| 12 | + |
| 13 | +[mempool.dot.protofire.io](https://mempool.dot.protofire.io) |
| 14 | + |
| 15 | +## Custom Polkadot Node |
| 16 | + |
| 17 | +In order to track extrinsics lifecycle. We added a new RPC method ([author_trackExtrinsic](https://github.com/protofire/polkadot-mempool-explorer/blob/develop/api/services/polkadot/custom-rpc-methods.js)) on [Substrate core](https://github.com/jarcodallo/substrate/blob/master/client/rpc-api/src/author/mod.rs). |
| 18 | + |
| 19 | +This basically allows someone to subscribe and track status changes in the extrinsics lifecycle, for example movements getting in or out of queues, and everything that matters for us before including those extrinsics in blocks. |
| 20 | + |
| 21 | + - Substrate change: [github.com/paritytech/substrate](https://github.com/jarcodallo/substrate/commits/master) |
| 22 | + - Polkadot dependencies update: [github.com/paritytech/polkadot](https://github.com/jarcodallo/polkadot/commits/master) |
| 23 | + - Docker image of the polkadot binary: [hub.docker.com/polkadot](https://hub.docker.com/repository/docker/jarcodallo/polkadot) |
| 24 | + |
| 25 | +## Get Started |
| 26 | + |
| 27 | +In the project directory, you can run: |
| 28 | + |
| 29 | +### `npm start` |
| 30 | + |
| 31 | +Runs the NodeJs service in the development mode.\ |
| 32 | +Open [localhost:8081/api/v1/api-docs](http://localhost:8084/api/v1/api-docs) to view it in the browser or Postman. |
| 33 | + |
| 34 | +The service will reload if you make edits. |
| 35 | + |
| 36 | +## Mempool Explorer API Definition |
| 37 | + |
| 38 | +<p align="center"><img src="../assets/swagger.png"/></p> |
| 39 | + |
| 40 | + |
| 41 | +## Endpoints |
| 42 | + |
| 43 | + - `/networks`: Get networks [specs](https://github.com/protofire/polkadot-mempool-explorer/blob/main/api/routes/explorerApiDocumentation.js#L32-L65). |
| 44 | + - `/networks/:networkId/reset`: Reset the listener for a network id. [specs](https://github.com/protofire/polkadot-mempool-explorer/blob/main/api/routes/explorerApiDocumentation.js#L66-L95). |
| 45 | + - `/transactions/:networkId`: Get transactions by network id. [specs](https://github.com/protofire/polkadot-mempool-explorer/blob/main/api/routes/explorerApiDocumentation.js#L96-L133). |
0 commit comments