Skip to content

dotbitHQ/das_parser_tool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

77 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Das parser tool

Command tool for the das parser on the ckb blockchain.

Install

To compile parse tool is simple, it's only requires GO version 1.15 or above.

  • The first step is to clone the parse tool repository.
  • The second step is to download the dependency libraries required for compilation.
  • The third step is to compile the parse tool binary executable.

execute file have three os type, it is linux, macOS, windows.

git clone https://github.com/dotbitHQ/das_parser_tool.git
make update
make default

make tx_parser_linux
make tx_parser_mac
make tx_parser_win

Note You can put the executable in a system variable so that you don't need to enter the relative path of the executable when using it.

Usage

Running the parser tool will output a list of commands, equivalent to the help command.

tx_parser

tx_parser -h

Version

Output the version of parser tool.

tx_parser version

Configuration

When using parser tool, it's need a config file for parser transaction data.

The default config path is ./config.yaml, ./config/config.yaml and ../config/config.yaml, But you can customize another.

// testnet 
  net: 2

// mainnet
  net: 1

Hash parser

Output the parser data by one or more transaction hash with parser tool.

./tx_parser hash 0x2d4cafcea2065b4fed64331d67c1c50a505f553aa3c27fbfc86ec26c7d5ca98c
./tx_parser hash 0x2d4cafcea2065b4fed64331d67c1c50a505f553aa3c27fbfc86ec26c7d5ca98c 0x1222546aec19e4b13bb40bd84dee5e87143e0b3bdd6d81796c586e0e6b2fe44f

./tx_parser -c ./config/config.yaml hash 0x35d584ec7979f518008a308c0716f07f5a24527c2c7592de382e1fee9af18c3c
./tx_parser hash 0x35d584ec7979f518008a308c0716f07f5a24527c2c7592de382e1fee9af18c3c -c ./config/config.yaml

Witness parser

Output the parser witness data by one or more transaction witness with parser tool.

tx_parser witness 0x64617300000000c80000000c0000001b0000000b0000006275795f6163636f756e74a90000005f000000100000003000000031000000326df166e3f0a900a0aee043e31a4dea0f01ea3307e6e235f09d1b4220b75fbd012a000000053a8ac9ad3efd980ffaad37aec39ba9455aa8bb76053a8ac9ad3efd980ffaad37aec39ba9455aa8bb76490000001000000030000000310000009bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce80114000000d0e1f9a79ab9361821cbc3b31fccee094cafacd000

tx_parser witness 0x64617300000000c80000000c0000001b0000000b0000006275795f6163636f756e74a90000005f000000100000003000000031000000326df166e3f0a900a0aee043e31a4dea0f01ea3307e6e235f09d1b4220b75fbd012a000000053a8ac9ad3efd980ffaad37aec39ba9455aa8bb76053a8ac9ad3efd980ffaad37aec39ba9455aa8bb76490000001000000030000000310000009bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce80114000000d0e1f9a79ab9361821cbc3b31fccee094cafacd000   0x646173020000009b00000010000000100000009b0000008b00000010000000140000001800000001000000020000006f0000006f0000001c00000030000000420000004a000000630000006b000000cdb42ebe687b069e5e3f3164b497e646f9b1a5f50e00000074616e677465737430312e62697400e876481700000015000000626573742064617320746f20746865206d6f6f6e2e6c96db6100000000e8030000

Json parser

Output the parser data by one transaction json with parser tool.

./tx_parser json file tx.json

./tx_parser json data '{"cell_deps":[{"dep_type":"code","out_point":{"index":"0x0","tx_hash":"0x45fd29a64e68c8ec8b36cabc213e9cc03f9334df28b28dbe8b537e6d6c663ff8"}},{"dep_type":"code","out_point":{"index":"0x0","tx_hash":"0xec9cf67b5b4de3845c215b6f2f1f0135c61c7981109abb99d60a9ddfee150364"}},{"dep_type":"code","out_point":{"index":"0x1","tx_hash":"0x451b5b48bb8ee229e4c01312dcd9a466b05ff118c3b1345f30ca71b5a604d5a6"}},{"dep_type":"code","out_point":{"index":"0x1","tx_hash":"0x9d18b216fc8c3763997354002825de390c3303dbe2dcce1697f6ed0dc787725f"}},{"dep_type":"code","out_point":{"index":"0x0","tx_hash":"0xa7ff448225fc131d657af882a3f97a8219be230d7e25d070a9282de89302c640"}},{"dep_type":"code","out_point":{"index":"0x0","tx_hash":"0x2cd66dbd384af59c7fd4ffc1794cbc06b91cb57f02f7bfb574a9d195e05c26e4"}},{"dep_type":"code","out_point":{"index":"0x0","tx_hash":"0xed37fb6af3ab31713ac648a0aa6d92e51ec72ef37b1536a208acf3beb44d20d2"}},{"dep_type":"code","out_point":{"index":"0x0","tx_hash":"0xf246c71e24716b47f0aa2b48123632dd4bb6ade851bce45e345dfdb33b8eab48"}},{"dep_type":"dep_group","out_point":{"index":"0x0","tx_hash":"0xf8de3bb47d055cdf460d93a2a6e1b05f7432f9777c8c474abf4eec1d4aee5d37"}}],"hash":"0xdd1984190835b61d99a4748b768bf0dcf5658c011cd5f59a441b72a16b64a3f5","header_deps":[],"inputs":[{"previous_output":{"index":"0x3","tx_hash":"0x8e07e8014d85d707149bba4d84af6db1ff149b9e16b0fe6a9ab436fdc079a898"},"since":"0x0"},{"previous_output":{"index":"0x1","tx_hash":"0xd727b3c16648564b7850af51fed308d9fe07ca5eab434513e9522e976af08180"},"since":"0x0"}],"outputs":[{"capacity":"0x277cf2a00","lock":{"args":"0x","code_hash":"0xf1ef61b6977508d9ec56fe43399a01e576086a76cf0f7c687d1418335e8c401f","hash_type":"type"},"type":{"args":"0x","code_hash":"0x67d48c0911e406518de2116bd91c6af37c05f1db23334ca829d2af3042427e44","hash_type":"type"}},{"capacity":"0x32624ae40","lock":{"args":"0x34cf511994ea71d7db50306b932a2060bc2b3063","code_hash":"0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8","hash_type":"type"},"type":null}],"outputs_data":["0xe039a0581012bdfaf15259b4eff3092bb70c9a7ef78d92f5f5acbb5f0c3c512a","0x"],"version":"0x0","witnesses":["0x5500000010000000550000005500000041000000d408d1a581658eb85c0fe06aa6a5e74cb66a062bd9adc89bf65e5cb383033f9d4ae44dce62a5f9e1556b8ba2d5073c75b65c60a8fa63acbfa2585bc10ca1639200","0x","0x646173000000001c0000000c000000170000000700000070726f706f73650100000000","0x64617301000000d201000010000000d2010000d2010000c20100001000000014000000180000000000000002000000a6010000a6010000240000003800000081010000890100009101000099010000a1010000a20100001cf144bec20b7740ef83ae9a07da2b5632270ec449010000380000004d00000062000000770000008c000000a1000000b6000000cb000000e0000000f50000000a0100001f01000034010000150000000c00000010000000020000000100000066150000000c00000010000000020000000100000066150000000c00000010000000020000000100000066150000000c00000010000000020000000100000075150000000c00000010000000020000000100000066150000000c00000010000000020000000100000075150000000c00000010000000020000000100000061150000000c00000010000000020000000100000073150000000c00000010000000020000000100000075150000000c00000010000000020000000100000064150000000c00000010000000020000000100000061150000000c00000010000000020000000100000073150000000c00000010000000020000000100000064e5168e61000000000000000000000000000000000000000000000000000000000004000000","0x646173050000004202000010000000420200004202000032020000100000001400000018000000010000000100000016020000160200002c00000094000000dd0000000b0100002301000082010000e1010000020200000a0200000e0200006800000014000000290000003e00000053000000150000000c00000010000000020000000100000061150000000c00000010000000020000000100000064150000000c00000010000000020000000100000076150000000c00000010000000020000000100000061490000001000000030000000310000009bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce80114000000ecacad713f776325f926c496bbb2c655486bfe542a00000005224591aed0189a5c9d102b070bd145567868d5eb05224591aed0189a5c9d102b070bd145567868d5eb14000000ceb2269f9f82c2f8f52657df28108a5b6b2c41ef5f000000100000003000000031000000326df166e3f0a900a0aee043e31a4dea0f01ea3307e6e235f09d1b4220b75fbd012a0000000578100ef7dfa4485dd1118b0d1bca3ef65d742ce00578100ef7dfa4485dd1118b0d1bca3ef65d742ce05f000000100000003000000031000000326df166e3f0a900a0aee043e31a4dea0f01ea3307e6e235f09d1b4220b75fbd012a0000000578100ef7dfa4485dd1118b0d1bca3ef65d742ce00578100ef7dfa4485dd1118b0d1bca3ef65d742ce02100000010000000110000001900000004809698000000000080969800000000005737000000000000f4010000d946f26100000000","0x6461730400000013010000100000001000000010000000030100001000000014000000180000000000000001000000e7000000e7000000100000005900000061000000490000001000000030000000310000009bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8011400000034cf511994ea71d7db50306b932a2060bc2b30635b2840000000000086000000080000007e0000000c00000045000000390000001000000024000000250000001cf144bec20b7740ef83ae9a07da2b5632270ec4001cf55fa1d32a34cae18eb78b68734b5dee18f0e0390000001000000024000000250000001cf55fa1d32a34cae18eb78b68734b5dee18f0e0021d403e25446b6c7453f7e87de9efefbfd3c0e468","0x6461736a0000002300000018000000190000001a0000001b0000001f0000000001083200000032000000","0x646173680000004902000010000000110000007d010000016c0100002c0000004c0000006c0000008c000000ac000000cc000000ec0000000c0100002c0100004c0100001106d9eaccde0995a7e07e80dd0ce7509f21752538dfdd1ee2526d24574846b10fbff871dd05aee1fda2be38786ad21d52a2765c6025d1ef6927d761d51a3cd14ff58f2c76b4ac26fdf675aa82541e02e4cf896279c6d6982d17b959788b2f0c08d1cdc6ab92d9cabe0096a2c7642f73d0ef1b24c94c43f21c6c3a32ffe0bb5e6c8441233f00741955f65e476721a1a5417997c1e4368801c99c7f617f8b754467d48c0911e406518de2116bd91c6af37c05f1db23334ca829d2af3042427e449438124abdf4cbbfd61065e8b64523172bef5eefe27cb769c40acaf036aa89c200000000000000000000000000000000000000000000000000000000000000001a3f02aa89651a18112f0c21d0ae370a86e13f6a060c378184cd859a7bb6520361711416468fa5211ead5f24c6f3efadfbbc332274c5d40e50c6feadcb5f9606cc000000180000003c0000006000000084000000a8000000209b35208da7d20d882f0871f3979c68c53981bcc4caa71274c035449074d08200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f273e6c581ad6bda82315bc06f1b9df4efae20fc5394995231ea96ab2b0ee3dd000000007dc4ae8fe597045fbd7fe78f2bd26435644a69b755de3824a856f681bacb732b00000000"]}'

./tx_parser json data -c ./config/config.yaml '{"cell_deps":[{"dep_type":"code","out_point":{"index":"0x0","tx_hash":"0x317def0ea84cfbfa025d2342005437426acddc3300c846353bf68742a58ceda7"}},{"dep_type":"code","out_point":{"index":"0x0","tx_hash":"0xf85906c3a3f780556a09fc0ec8698b232fcc2e0ef26aaab06de642c9add4645b"}},{"dep_type":"code","out_point":{"index":"0x1","tx_hash":"0x331b828247899a7af332eb97dd5c94b18c5590ffb129525738dc1ae9abd65c7f"}},{"dep_type":"code","out_point":{"index":"0x1","tx_hash":"0x048f2e5d0ffc8757ea2713d34e809d39a416d4ab76ff1d12149ee4f4dd3fe971"}},{"dep_type":"code","out_point":{"index":"0x0","tx_hash":"0xcfd3350aa2a5a9277cba3cd784262d206646a10244c9ae924fd39cb4005dd653"}},{"dep_type":"code","out_point":{"index":"0x0","tx_hash":"0x5a7a72eba39239d1bae6f55cd8bd6593ce1dcdac43bb824cd99f67eae8405972"}},{"dep_type":"code","out_point":{"index":"0x0","tx_hash":"0x9bc0d2a30140f31db95229923324785e254a9b1f70a006c9a99aabc295d9848c"}},{"dep_type":"code","out_point":{"index":"0x0","tx_hash":"0xff35ab5cee3dab7a3429f2208fc3ba7e5d945916d6061d4070e3ed7849b430ea"}},{"dep_type":"dep_group","out_point":{"index":"0x0","tx_hash":"0x71a7ba8fc96349fea0ed3a5c47992e3b4084b031a42264a018e0072e8172e46c"}}],"hash":"0x9d2a035b13159b38c45274230f415c3a686123a4f31e1ddcea22034e5f97af0a","header_deps":[],"inputs":[{"previous_output":{"index":"0x3","tx_hash":"0x4305ee9bfc73e8d8cc21fce0aeda429447bce2c88dc85037fa9ae4b9dceb5f2e"},"since":"0x0"},{"previous_output":{"index":"0x1","tx_hash":"0x8f3c681eecdd2ebc927cecdeacf8b8ab8f4d6cbb2a44ee6e4951dbeb2e50128f"},"since":"0x0"}],"outputs":[{"capacity":"0x277cf2a00","lock":{"args":"0x","code_hash":"0x303ead37be5eebfcf3504847155538cb623a26f237609df24bd296750c123078","hash_type":"type"},"type":{"args":"0x","code_hash":"0x6127a41ad0549e8574a25b4d87a7414f1e20579306c943c53ffe7d03f3859bbe","hash_type":"type"}},{"capacity":"0x381bf8838","lock":{"args":"0x91149df19a6765a91c55a5e9ed0ce1251c8fada6","code_hash":"0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8","hash_type":"type"},"type":null}],"outputs_data":["0xbceef3552b9a48d635b8d0caf1b0e25ef301e7d44fdfd409054ec3338a51e651","0x"],"version":"0x0","witnesses":["0x55000000100000005500000055000000410000009a4ad6b8cefcf5429abe8445aa1c4e683ac69b9a60b11ffea313a85dbbde63e9579852051cf3898dc7dead8562d3260146f3e360dea7db4874e510d58e97d48c01","0x","0x646173000000001c0000000c000000170000000700000070726f706f73650100000000","0x64617301000000870100001000000087010000870100007701000010000000140000001800000000000000020000005b0100005b0100002400000038000000360100003e010000460100004e010000560100005701000008bcc5e96a4c79f77cd2ea585e61533e8c4334e2fe0000002c00000041000000560000006b0000008000000095000000aa000000bf000000d4000000e9000000150000000c00000010000000020000000100000065150000000c00000010000000020000000100000074150000000c00000010000000020000000100000068150000000c0000001000000002000000010000006f150000000c00000010000000020000000100000076150000000c00000010000000020000000100000065150000000c00000010000000020000000100000072150000000c00000010000000020000000100000062150000000c00000010000000020000000100000074150000000c00000010000000020000000100000063c162826100000000c17acd6100000000d176cd610000000000000000000000000004000000","0x64617305000000a003000010000000a0030000a003000090030000100000001400000018000000010000000100000074030000740300002c000000f20100003b0200006902000081020000e00200003f03000060030000680300006c030000c60100004c00000061000000760000008b000000a0000000b5000000ca000000df000000f4000000090100001e01000033010000480100005d01000072010000870100009c010000b1010000150000000c0000001000000002000000010000006d150000000c00000010000000020000000100000075150000000c00000010000000020000000100000074150000000c00000010000000020000000100000061150000000c0000001000000002000000010000006e150000000c00000010000000020000000100000074150000000c00000010000000020000000100000061150000000c00000010000000020000000100000070150000000c00000010000000020000000100000065150000000c00000010000000020000000100000079150000000c00000010000000020000000100000061150000000c00000010000000020000000100000074150000000c00000010000000020000000100000063150000000c00000010000000020000000100000068150000000c00000010000000020000000100000063150000000c0000001000000002000000010000006c150000000c00000010000000020000000100000075150000000c00000010000000020000000100000062490000001000000030000000310000009bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce801140000006d91285768e7c96f1cea0173c8167ada2cfeabe82a00000005334dd0d0eda7f3e11f484d20d4584042d516285405334dd0d0eda7f3e11f484d20d4584042d516285414000000795a25ef0389d4fcb2b631d0d4ef5edd6a75ffe85f0000001000000030000000310000009376c3b5811942960a846691e16e477cf43d7c7fa654067c9948dfcd09a32137012a000000050d030ee5d245c402a0e0baace10a2ffde052f79b050d030ee5d245c402a0e0baace10a2ffde052f79b5f0000001000000030000000310000009376c3b5811942960a846691e16e477cf43d7c7fa654067c9948dfcd09a32137012a000000056e961f8d234e9e8c7e8d50a650a00547b99dbe86056e961f8d234e9e8c7e8d50a650a00547b99dbe862100000010000000110000001900000008404b4c0000000000404b4c0000000000cc37000000000000f40100006702f16100000000","0x6461730400000013010000100000001000000010000000030100001000000014000000180000000000000001000000e7000000e7000000100000005900000061000000490000001000000030000000310000009bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8011400000091149df19a6765a91c55a5e9ed0ce1251c8fada6374d61000000000086000000080000007e0000000c000000450000003900000010000000240000002500000008bcc5e96a4c79f77cd2ea585e61533e8c4334e20008bde72fae1b84a25c04b925162bee75a67abe423900000010000000240000002500000008bde72fae1b84a25c04b925162bee75a67abe420208bdfa5062c2e02906314cbbe0f8e9eb4480f920","0x6461736a0000002300000018000000190000001a0000001b0000001f0000000001083200000032000000","0x646173680000004902000010000000110000007d010000016c0100002c0000004c0000006c0000008c000000ac000000cc000000ec0000000c0100002c0100004c0100004f170a048198408f4f4d36bdbcddcebe7a0ae85244d3ab08fd40a80cbfc70918c024b6efde8d49af665b3245223a8aa889e35ede15bc510392a7fea2dec0a758ebafc1ebe95b88cac426f984ed5fce998089ecad0cd2f8b17755c9de4cb021626c1d69a358954fc471a2ffa82a98aed5a4912e6002a5e761524f2304ab53bf3918ab87147e8e81000ab1b9f319a5784d4c7b6c98a9cec97d738a5c11f69e72546127a41ad0549e8574a25b4d87a7414f1e20579306c943c53ffe7d03f3859bbe80f520a379c41c019ab56afd426b536175bff9c574b17524da81d2d82f3fb73700000000000000000000000000000000000000000000000000000000000000001100b00d25dd5f19318b9034a5e2439672e846021ad1ec0bcb19775320fd2f21ebc9e13658f6df13593cf59b7e9cd159602b6c3c7d54b14dea43bae600ebae11cc000000180000003c0000006000000084000000a80000001373db89fd2c7ff1617d4fd6740e916169631c5ab6c9995786645071ab19b8220000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000062250fd2656332ba8fe86054071d9194de05d93ad48799a00d9960aa2ab54cc90000000017d992cd2c7aaa298c5d3f7c365709f4ac7b25c44aa5d618b6245cfc4a0f035200000000"]}'

Args parser

Output the parser witness data by one or more args with parser tool.

./tx_parser args 0x64000000

./tx_parser args 0x64000000 0x68000000

./tx_parser args -c ./config/config.yaml 0x64000000 0x68000000