Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Poor man's CLI block explorer (#6946)
Adds a command line block explorer in the CLI via a new `get-block` command, with an optional `--follow` for streaming new blocks. Required adding a new call to the PXE to return a contract artifact (as opposed to a class) and a new note filter to retrieve notes by nullifier. ``` Block 1 (0x2b89265d2de0519612c4a9efa8972cd2c4afccd12264e9ce299730ce0a0766bc) Total fees: 210250112 Fee per gas unit: DA=1 L2=1 Coinbase: 0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266 Fee recipient: 0x0000000000000000000000000000000000000000000000000000000000000000 Timestamp: Thu Jan 01 1970 01:00:00 GMT+0100 (Greenwich Mean Time) Tx 28a4883a47c7a12cc7479dab2936f05ed6b3ddce69f46fcd5203366206a29221 Status: success (OK) Fee: 210250112 Logs: ContractClassRegisterer<0x077649ac726c10e628e99c5f2a35fdee1fbdc171cde6fba64ca8985ca35f9045>: 0x000000006999d1e02b08a447a463563453cb36919c9dd7150336fc7c4d2b52f81428d8e644ec87bb40301ac06cb69d6884e063109dc422ae2a13dcd22402ebf5000000000000000000000000000000000000000000000000000000000000000110b77dfc4f54289b862f5260efb46d933935ba56188fd516d0dd472b6ca0391515d28cad4c0736decea8997cb324cf0a0e0602f4d74472cd977bce2c8dd9923f00000000000000000000000000000000000000000000000000000000000064010000000002d11c1929000016da1f8b08000000000002ffed9ddb6f2cc95dc77b003c37db63b78f3dbe8f2fe3cbd8e3dbd833e3f16d7c7c7cbc67b311122b101200e2011e36c99220028b96041424081152de7840fc01f04c1490108a16d02a820048ab65414428e415912790f2020fac907880fefd7e55bf5f5775cfe91f0d7100b2512ccd39d5d5dfcfaf2edd5d555d555db51b9402fc1bafc2bfeb81f98b8e00c68330a844ff8dc1ef36b0aec801bf421814ac570b4e0245aec83f28b60c100094d0558cfe29a30bc2aba0ab0ce1a0ab02ff6c47ff84038ecaae8d1984134c00b66ccc26023e3109ffb46c8c26461163690444686c14514c234a982c70559200f12b0951626242a9ab2a75634addb8525756ea0a0a9dcdba42741927175b2600dfe93ec0ccc6fb00d9a297ed05ca5a93d9c5... ContractInstanceDeployer<0x02f1337e8c79dd0247ccbde85241ad65ee991ae283a63479e095e51f0abbc7e3>: 0x0000000085864497636cf755ae7bde03f267ce01a520981c21c3682aaf82a6311585e564a60e6ec974bc151b62705292ebfc75c33341986a47fd9749cedb567e000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000011428d8e644ec87bb40301ac06cb69d6884e063109dc422ae2a13dcd22402ebf5000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 Nullifiers: Transaction hash nullifier 0x28a4883a...9221 Class KeyRegistryClass<0x1428d8e644ec87bb40301ac06cb69d6884e063109dc422ae2a13dcd22402ebf5> registered via nullifier 0x1744fe44...097d Contract KeyRegistry<0x1585e564a60e6ec974bc151b62705292ebfc75c33341986a47fd9749cedb567e> deployed via nullifier 0x2c94554f...a9c4 Block 2 (0x23229ae8b82203c7d12d69c5af8a9452c495d098d96484ce24432d4890c3a066) Total fees: 200011840 Fee per gas unit: DA=1 L2=1 Coinbase: 0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266 Fee recipient: 0x0000000000000000000000000000000000000000000000000000000000000000 Timestamp: Thu Mar 20 1997 06:19:57 GMT+0000 (Greenwich Mean Time) Tx 2fe9c0b77ce7af6f2cc309b66a15fc4eadea21eff14abc1dd06b94235cfe4055 Status: success (OK) Fee: 200011840 Created notes: Note type 0x00000000...f345 at SchnorrAccount Owner: SchnorrAccount<0x0f3a5bc7d4b298a87c1b8e2cfd065dd2294e6329324092420e9bcf3899ad862b> 0x3024c8a955160c6765e4d118c88cd4f67099bdebdd166d292aaf16341b861959 0x18e3c5c52a7704daa972d9b3cef34be01037aa5eccbc99f9395e17fb63dc2f4a 0x2c59248c91ae2f96d0873c9ac05fef17065229e31eb80db4c8925cd793a2258d Nullifiers: Transaction hash nullifier 0x2fe9c0b7...4055 Unknown nullifier 0x07d5054454752a94064c6d914a7df14ee311c6a6561b0feb1031cd4d5b3bcb2b Contract SchnorrAccount<0x0f3a5bc7d4b298a87c1b8e2cfd065dd2294e6329324092420e9bcf3899ad862b> initialized via nullifier 0x0b22eff4...59f3 Block 3 (0x276d4ce31d7acbf40b00efe3fe967383c75ba4e8c8024372946ab463dca8b4ba) Total fees: 200011840 Fee per gas unit: DA=1 L2=1 Coinbase: 0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266 Fee recipient: 0x0000000000000000000000000000000000000000000000000000000000000000 Timestamp: Thu Mar 20 1997 06:34:58 GMT+0000 (Greenwich Mean Time) Tx 239fdac7d4dd6fd2871c2c78506f6915272acc0d6c518367b2695c3576d18047 Status: success (OK) Fee: 200011840 Created notes: Note type 0x00000000...f345 at SchnorrAccount Owner: SchnorrAccount<0x208c952a5a8caa6f0e3c9c9a2b5588e84df882a632be92ed14ed4ba3a6cb4889> 0x20dce8a520f3d85c3c1814e11f49c1ddd5ed8795779b56ce24d04795672ea19c 0x160ef84102b88050fdc3b5d26b4fd5552401dd1e7766428e460e8419479774c1 0x1f22cd5b4123dccdf6bac0a135248dbbb1481fb0ecd1d86e288db71314f82bdb Nullifiers: Transaction hash nullifier 0x239fdac7...8047 Unknown nullifier 0x20c4572a23676aeb43ff381d6f09badbbaf958426cb999946fa5a9490d0bcbf2 Contract SchnorrAccount<0x208c952a5a8caa6f0e3c9c9a2b5588e84df882a632be92ed14ed4ba3a6cb4889> initialized via nullifier 0x17441328...4ace Block 4 (0x1e86e3f40cc9bd904229f12aaeb0f5ccb1ed2b4cd5ef82e665075f42ce2ddea2) Total fees: 200011328 Fee per gas unit: DA=1 L2=1 Coinbase: 0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266 Fee recipient: 0x0000000000000000000000000000000000000000000000000000000000000000 Timestamp: Thu Mar 20 1997 06:36:22 GMT+0000 (Greenwich Mean Time) Tx 1935e158e53f92ee28fbb6a44d544aa6409151745888d07eb435c9adf0b6fa74 Status: success (OK) Fee: 200011328 Created notes: Note type 0x00000000...d345 at Counter Owner: SchnorrAccount<0x208c952a5a8caa6f0e3c9c9a2b5588e84df882a632be92ed14ed4ba3a6cb4889> 0x0000000000000000000000000000000000000000000000000000000000000014 0x1f22cd5b4123dccdf6bac0a135248dbbb1481fb0ecd1d86e288db71314f82bdb 0x24bc453d236efaa0af7978fc40d1d32d5ad04514393686195a2592a897842352 Nullifiers: Transaction hash nullifier 0x1935e158...fa74 Contract Counter<0x2a0e4a235aa1c517e04a41bc558688e5d0fbe659bdd0e2187625ba135b0ed147> initialized via nullifier 0x2d14862d...e6fb Block 5 (0x28c6453635fe3e6192434b82ea5b704a553b9bb983ffa8eb0634226cbec388a5) Total fees: 210299762 Fee per gas unit: DA=1 L2=1 Coinbase: 0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266 Fee recipient: 0x0000000000000000000000000000000000000000000000000000000000000000 Timestamp: Thu Mar 20 1997 06:36:44 GMT+0000 (Greenwich Mean Time) Tx 026ee6d9880d1fb58835ce759cc86b911b28f3d402a589d4b3a5aac15e7c22b5 Status: success (OK) Fee: 210299762 Logs: ContractClassRegisterer<0x077649ac726c10e628e99c5f2a35fdee1fbdc171cde6fba64ca8985ca35f9045>: 0x000000006999d1e02b08a447a463563453cb36919c9dd7150336fc7c4d2b52f801222ccbfa5e4da8aa941f05b44fdb6f9e243570a4133c17131d429a128bc35500000000000000000000000000000000000000000000000000000000000000010af070de86150b457bacbaa2d68104f1f76b746e2d57a67d9064a2939da2fd050488114b880887348c50fbaeebde008bfca23238238be04c262ea0fd4d050bf8000000000000000000000000000000000000000000000000000000000000d0b900000000121076393200000b711f8b08000000000002ffe59b5b5714cb15c7bb00a7bb079111af208a8cb4d0721310111418042f2883c3c5837251514611e12c004fcc3ac7246be5cbe4fbe4210f79c8433e409ef29cd7a4f7ae5db56777cf380095ce3aae9c7566ad61aa77ff7fb5ebb2ebd2354cbfe33bf83a11c0df1e875e00f1d509a7ddc9c71f3978971c9d8a13f076db1d579b22b809944ac576c78b0800707c4c799027a6c05ffe5afca73065dc463a57a75f970772775a1c73d9627400bea52e6fa9f32c7581a5ceb5d0e96676e386f0ff8297809ec01434654ba4d9001332ab56172f41d38a844b57aea52eb0d47996babca5ceb7d4e51a05432b370062ab69ec164b9d6fa9cb5bea3c4b5d60a9732d740d82e624a64e82cc04cd490099559b6a6cd0b421e1d2956ba90b2c759ea5... ContractInstanceDeployer<0x02f1337e8c79dd0247ccbde85241ad65ee991ae283a63479e095e51f0abbc7e3>: 0x0000000085864497636cf755ae7bde03f267ce01a520981c21c3682aaf82a631060cfd1d7e084707f9dbff1e91e5ff25f42a96eda32c3efa7857a9c245ad349800000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000ba4a4a01222ccbfa5e4da8aa941f05b44fdb6f9e243570a4133c17131d429a128bc3550f1c0b89cacad7f894b03f2df0fe34f90017b30e7a20788abf1c6eb1fc28072f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 Public data writes: Leaf 0x01274dce5f5b02dff31e464a12626bcce1311ec716b070179739f8a1ca7c9261 = 0x000000000000000000000000000000000000000000000000000000000000dead Leaf 0x071ca21d4cb06c55f09e4a686a9d108b942856a2582c73c0d43e09f8d038a756 = 0x0000000000000000000000000000000000000000000000000000000000000006 Leaf 0x08a8ceb0fdeb27b3f98234d8603541f95306dae8ab15d4ace52357fe4d11f90a = 0x0000000000000000000000000000000000000000000000000000000000000001 Leaf 0x0d234845ac847cb60b73201db97c6e8675d52d72adc69581aa5914fc11a0ed7c = 0x000000000000000000000000000000000000000000000000000000000000dead Leaf 0x0fc858ef91c153285fbc819e98b1c31b55ed5cd074eaf55605b071f3ccd4e145 = 0x0042414e414e4100000000000000000000000000000000000000000000000000 Leaf 0x16008cf0f0385284517082f9728e372bcf1df56d725d16b73bae4a5a0c0506ce = 0x0042414e414e4100000000000000000000000000000000000000000000000000 Leaf 0x1cc9f461a515b0b2754d9e249bb97fe69c1a62d423df9293336c978685612dbc = 0x000000000000000000000000000000000000000000000000000000000000dead Leaf 0x1d11db8907a98c978972653ddc4171a238495b048d3af7497211e53f18bc60c6 = 0x208c952a5a8caa6f0e3c9c9a2b5588e84df882a632be92ed14ed4ba3a6cb4889 Nullifiers: Transaction hash nullifier 0x026ee6d9...22b5 Class TokenClass<0x01222ccbfa5e4da8aa941f05b44fdb6f9e243570a4133c17131d429a128bc355> registered via nullifier 0x00419c0d...1e71 Contract Token<0x060cfd1d7e084707f9dbff1e91e5ff25f42a96eda32c3efa7857a9c245ad3498> deployed via nullifier 0x2172e4eb...48b8 Contract Token<0x060cfd1d7e084707f9dbff1e91e5ff25f42a96eda32c3efa7857a9c245ad3498> initialized via nullifier 0x3056b711...adce Block 5 (0x28c6453635fe3e6192434b82ea5b704a553b9bb983ffa8eb0634226cbec388a5) Total fees: 210299762 Fee per gas unit: DA=1 L2=1 Coinbase: 0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266 Fee recipient: 0x0000000000000000000000000000000000000000000000000000000000000000 Timestamp: Thu Mar 20 1997 06:36:44 GMT+0000 (Greenwich Mean Time) ```
- Loading branch information