Skip to content
This repository has been archived by the owner on Dec 7, 2023. It is now read-only.

Added blockchain show block/transactions/contracts commands #905

Merged
merged 22 commits into from
Nov 27, 2023

Conversation

cschuchardt88
Copy link
Member

@cschuchardt88 cschuchardt88 commented Nov 13, 2023

Change Log

  • Add command show block <index>
  • Add command show block <hash>
  • Add command show tx <hash>
  • Add command show contract <name>
  • Add command show contract <hash>

image
image
image
image
image

@cschuchardt88 cschuchardt88 changed the title Added blockchain commands Added blockchain print commands Nov 13, 2023
@cschuchardt88 cschuchardt88 marked this pull request as ready for review November 13, 2023 21:46
Copy link
Member

@shargon shargon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like it :)
My review:

  • print or show?
  • Can you add print and show contract (by id, hash, or name if it's native)?

@cschuchardt88
Copy link
Member Author

image

@EdgeDLT
Copy link

EdgeDLT commented Nov 14, 2023

@cschuchardt88 Can we add application logs if the node supports them (e.g. state, notifications, etc)? It could be appended on print tx.

@cschuchardt88
Copy link
Member Author

see neo-project/neo-modules#807

@Jim8y
Copy link
Contributor

Jim8y commented Nov 15, 2023

I like it :) My review:

  • print or show?
  • Can you add print and show contract (by id, hash, or name if it's native)?

@cschuchardt88 show has being used as a command to print things to the console, would be good to change to show. We can discuss whether to change from show to print in the future

Jim8y
Jim8y previously approved these changes Nov 15, 2023
Copy link
Member

@shargon shargon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@superboyiii could you test it?

@superboyiii
Copy link
Member

@superboyiii could you test it?

I will

@cschuchardt88
Copy link
Member Author

@superboyiii can you make sure you can get blocks, transactions and contracts with all the attributes on them.

@superboyiii
Copy link
Member

@superboyiii can you make sure you can get blocks, transactions and contracts with all the attributes on them.

I can't get all, but will choose some special cases to see if it still works well.

@cschuchardt88 cschuchardt88 changed the title Added blockchain print commands Added blockchain show block/transactions/contracts commands Nov 15, 2023
@superboyiii
Copy link
Member

superboyiii commented Nov 16, 2023

Maybe it's better to support getting details of attribute, currently it only gets Type, AllowMultiple and size, but for example, for an Oracle response tx, id, code and result is critical.
like tx 0x6ccda4f935da375f32110d321e04b16c59b2118154ff3a8c570384382fc96746 on mainnet

"attributes": [
            {
                "type": "OracleResponse",
                "id": 20847,
                "code": "Success",
                "result": "W251bGxd"
            }
        ]

Test result:
1700117872698

And for conflict attribute, like 0x5ebf8d379ce15d440daedb8f8cbe1215cb0b08988f57d0407bf419cb4ed14dff on testnet, there should be type and hash.

"attributes": [
            {
                "type": "Conflicts",
                "hash": "0x2474ecd9f2e0e0ec149aad323db654a3c60fb00386c204a5175d856fdff853c4"
            }
        ]

Test result:
1700118005604

@shargon
Copy link
Member

shargon commented Nov 16, 2023

Maybe it's better to support getting details of attribute, currently it only gets Type, AllowMultiple and size, but for example, for an Oracle response tx, id, code and result is critical. like tx 0x6ccda4f935da375f32110d321e04b16c59b2118154ff3a8c570384382fc96746 on mainnet

"attributes": [
            {
                "type": "OracleResponse",
                "id": 20847,
                "code": "Success",
                "result": "W251bGxd"
            }
        ]

Test result: 1700117872698

And for conflict attribute, like 0x5ebf8d379ce15d440daedb8f8cbe1215cb0b08988f57d0407bf419cb4ed14dff on testnet, there should be type and hash.

"attributes": [
            {
                "type": "Conflicts",
                "hash": "0x2474ecd9f2e0e0ec149aad323db654a3c60fb00386c204a5175d856fdff853c4"
            }
        ]

Test result: 1700118005604

Agree, AllowMultiple is not needed.

@cschuchardt88
Copy link
Member Author

image
image

Jim8y
Jim8y previously approved these changes Nov 16, 2023
cschuchardt88 and others added 2 commits November 22, 2023 12:13
Co-authored-by: Jimmy <jinghui@wayne.edu>
Co-authored-by: Jimmy <jinghui@wayne.edu>
Copy link
Member

@superboyiii superboyiii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works well for me.

@superboyiii superboyiii merged commit adfb6e9 into neo-project:master Nov 27, 2023
1 check passed
@cschuchardt88 cschuchardt88 deleted the Blockchain-display branch November 27, 2023 03:52
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants