https://github.com/xcaptain/chain-util
https://github.com/xcaptain/chain-util
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/xcaptain/chain-util
- Owner: xcaptain
- Created: 2022-03-12T06:33:43.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-09-29T07:33:50.000Z (over 2 years ago)
- Last Synced: 2025-01-20T06:46:20.917Z (5 months ago)
- Language: TypeScript
- Size: 20.5 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# chain utils
## build
```bash
npm i
```## test
1. start a dev chain server
```bash
./deeper-chain --dev
```2. start a dev api sidecar server
```bash
docker run --rm -it --read-only -e SAS_SUBSTRATE_URL=ws://172.17.0.1:9955 -p 8080:8080 docker.io/parity/substrate-api-sidecar:v13.1.0
```3. run jest test cases
```bash
npm test
```## architecture
This package uses `txwrapper-deeper` to submit extrinsics offline, `txwrapper-deeper` helps you encode payload and generate signature of this payload, it's very tedious if you do it manually. Note `txwrapper-deeper` is wrapper for deeper-chain, if you want to submit to other chain, create your own `txwrapper-{YOUR CHAIN}`. You can follow instructions at [https://github.com/paritytech/txwrapper-core](https://github.com/paritytech/txwrapper-core).
If you want to know how to generate signed transaction payload manually, check [https://github.com/paritytech/polkadot-interaction-examples-rs/blob/main/src/bin/05_transfer_balance.rs](https://github.com/paritytech/polkadot-interaction-examples-rs/blob/main/src/bin/05_transfer_balance.rs)