Skip to content

Commit 2b0b423

Browse files
author
Igor
committed
fix feedback
1 parent 297bffe commit 2b0b423

File tree

1 file changed

+27
-11
lines changed

1 file changed

+27
-11
lines changed

README.md

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
# Async Substrate Interface
22
This project provides an asynchronous interface for interacting with [Substrate](https://substrate.io/)-based blockchains. It is based on the [py-substrate-interface](https://github.com/polkascan/py-substrate-interface) project.
33

4-
## Features
5-
6-
- Asynchronous API calls
7-
- Uses [bt-decode](https://github.com/opentensor/bt-decode) instead of [py-scale-codec](https://github.com/polkascan/py-scale-codec) for faster [SCALE](https://polkascan.github.io/py-scale-codec/) decoding.
4+
Additionally, this project uses [bt-decode](https://github.com/opentensor/bt-decode) instead of [py-scale-codec](https://github.com/polkascan/py-scale-codec) for faster [SCALE](https://docs.substrate.io/reference/scale-codec/) decoding.
85

96
## Installation
107

@@ -16,36 +13,55 @@ pip install async-substrate-interface
1613

1714
## Usage
1815

19-
Here is a basic example of how to use the async-substrate-interface:
16+
Here are examples of how to use the sync and async inferfaces:
2017

2118
```python
22-
import asyncio
2319
from async_substrate_interface import SubstrateInterface
2420

25-
async def main():
21+
def main():
2622
substrate = SubstrateInterface(
2723
url="wss://rpc.polkadot.io"
2824
)
2925

30-
result = await substrate.query(
26+
result = substrate.query(
3127
module='System',
3228
storage_function='Account',
33-
params=['5FHneW46xGXgs5mUiveU4sbTyGBzmto4oT9v5TFn5u4tZ7sY']
29+
params=['5CZs3T15Ky4jch1sUpSFwkUbYEnsCfe1WCY51fH3SPV6NFnf']
3430
)
3531

3632
print(result)
3733

34+
main()
35+
```
36+
37+
```python
38+
import asyncio
39+
from async_substrate_interface import AsyncSubstrateInterface
40+
41+
async def main():
42+
substrate = AsyncSubstrateInterface(
43+
url="wss://rpc.polkadot.io"
44+
)
45+
async with substrate:
46+
result = await substrate.query(
47+
module='System',
48+
storage_function='Account',
49+
params=['5CZs3T15Ky4jch1sUpSFwkUbYEnsCfe1WCY51fH3SPV6NFnf']
50+
)
51+
52+
print(result)
53+
3854
asyncio.run(main())
3955
```
4056

4157
## Contributing
4258

43-
Contributions are welcome! Please open an issue or submit a pull request.
59+
Contributions are welcome! Please open an issue or submit a pull request to the `staging` branch.
4460

4561
## License
4662

4763
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
4864

4965
## Contact
5066

51-
For any questions or inquiries, please join the Bittensor Development Discord server: [Church of Rao](https://discord.gg/gavmT4R8sB).
67+
For any questions or inquiries, please join the Bittensor Development Discord server: [Church of Rao](https://discord.gg/XC7ucQmq2Q).

0 commit comments

Comments
 (0)