Skip to content

Commit 23a26f9

Browse files
authored
Merge pull request 0xPolygon#257 from 0xPolygon/cdk/how-to-test
CDK: How to quickly test a transaction
2 parents aa51600 + 706569a commit 23a26f9

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
A quick and easy method for testing a running CDK stack, whether in validium or rollup mode, is by sending a zero-value transaction and examining the result.
2+
3+
## Cast method
4+
5+
In a terminal window, run the following command where the mnemonic is used just for testing and the address can be any valid account address.
6+
7+
```sh
8+
cast send --legacy --mnemonic 'code code code code code code code code code code code quality' --value 0 --gas-price 0 --rpc-url http://127.0.0.1:8123 0x0bb7AA0b4FdC2D2862c088424260e99ed6299148
9+
```
10+
11+
You should see something like this as output:
12+
13+
```sh
14+
blockHash 0x5d6d45f46e54c5d0890dd8a4ede989dc8042d7d3aeada375ea11d2e77c91a298
15+
blockNumber 1
16+
contractAddress
17+
cumulativeGasUsed 21000
18+
effectiveGasPrice 0
19+
from 0x85dA99c8a7C2C95964c8EfD687E95E632Fc533D6
20+
gasUsed 21000
21+
logs []
22+
logsBloom 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
23+
root 0x97b15537641583db08f1e3db15cb1e89212ed8d147670a11f93f368d5960e72f
24+
status 1
25+
transactionHash 0xd5443cff8dcc1147ead09d978d3abe9179615aa3eecbe4819c6768390bc467a3
26+
transactionIndex 0
27+
type 0
28+
to 0x66ec…89fd
29+
```
30+
31+
Status `1` signifies a successful transaction.
32+
33+
<!--
34+
## MetaMask method todo:
35+
-->

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ nav:
8383
- Start services: cdk/get-started/deploy-rollup/start-services.md
8484
- Connect to CDK testnet: cdk/get-started/connect-testnet.md
8585
- How to:
86+
- Quickly test a running stack: cdk/how-to/quick-test-stack.md
8687
- Manage allowlists with policies: cdk/how-to/manage-policies.md
8788
- Architecture:
8889
- DAC: cdk/architecture/dac.md

0 commit comments

Comments
 (0)