Skip to content

Commit 3744b5c

Browse files
committed
Update polkadot dependencies an fix node connection issue.
1 parent e0e42e3 commit 3744b5c

File tree

10 files changed

+540
-528
lines changed

10 files changed

+540
-528
lines changed

README.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,6 @@ Displays log output from custom `polkadot-westend` service.
8383

8484
Displays log output from custom `polkadot-main` service.
8585

86-
## Mempool Explorer API Definition
87-
88-
<p align="center"><img src="./assets/swagger.png"/></p>
89-
90-
You can read more about the API Definition [here](https://mempool.dot.protofire.io/api/v1/api-docs).
91-
9286
## Contributing
9387

9488
### Code of Conduct

api/README.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
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).

api/constants/networks.js

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,29 @@
11
const DEFAULT_NETWORK = {
22
id: 'polkadot',
33
name: 'Polkadot',
4-
url: 'wss://cc1-1.polkadot.network',
4+
url: 'wss://rpc.polkadot.io',
55
};
66

77
const LIVE_NETWORKS = [
88
DEFAULT_NETWORK,
99
{
1010
id: 'kusama',
1111
name: 'Kusama',
12-
url: 'wss://cc3-5.kusama.network',
12+
url: 'wss://kusama-rpc.polkadot.io',
1313
},
1414
];
1515

1616
const TEST_NETWORKS = [
17-
{
18-
id: 'amber',
19-
name: 'Amber',
20-
url: 'wss://fullnode.amber.centrifuge.io',
21-
},
2217
{
2318
id: 'westend2',
2419
name: 'Westend',
2520
url: 'wss://westend-rpc.polkadot.io',
2621
},
27-
// {
28-
// id: 'rococo',
29-
// name: 'Rococo',
30-
// url: 'wss://rococo-rpc.polkadot.io',
31-
// },
22+
{
23+
id: 'rococo',
24+
name: 'Rococo',
25+
url: 'wss://rococo-rpc.polkadot.io',
26+
},
3227
// {
3328
// id: 'rococo-tick',
3429
// name: 'Rococo Tick',

api/env.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,7 @@ module.exports = Object.assign({}, variables, {
2121
CACHE_MAX_AGE: variables.CACHE_MAX_AGE || 3600000 * 24, // Default 24 hours
2222
NETWORK_MAX_ITEMS: variables.NETWORK_MAX_ITEMS || 50, // Default 50
2323
DATE_FORMAT: variables.DATE_FORMAT || 'MMM D, YYYY, h:mm:ss A',
24+
WS_PROVIDER_RETRIES: variables.WS_PROVIDER_RETRIES || 5, // Default 10 times
25+
WS_PROVIDER_RETRY_DELAY: variables.WS_PROVIDER_RETRY_DELAY || 5000, // Default 5 seconds
26+
FETCH_PENDING_EXTRINSICS_DELAY: variables.FETCH_PENDING_EXTRINSICS_DELAY || 5000, // Default 5 seconds
2427
});

0 commit comments

Comments
 (0)