0xs34n / blockchain-cli

⛓️ A minimal blockchain command-line interface.
Apache License 2.0
1.16k stars 169 forks source link

Display entire hash #13

Open jakecraige opened 7 years ago

jakecraige commented 7 years ago

Hi there,

Thanks for building this CLI. It's a really cool way to play around with a blockchain in a really interactive way.

Is there a way to display the full hash and previous hash values? I think it would be helpful if one could take the previous block and manually calculate the next hash to get a deeper understanding of how the blocks are generated, unfortunately the hash is clipped in the table display like so:

┌─────────────────────────────────────────┐
│               ⛓  Block #1               │
├────────────────────┬────────────────────┤
│ ⏮  Previous Hash   │ 0000018035a828da0… │
├────────────────────┼────────────────────┤
│ 📅  Timestamp       │ Fri, 15 Sep 2017   │
│                    │ 16:04:40 GMT       │
├────────────────────┼────────────────────┤
│ 📄  Data            │ hello              │
├────────────────────┼────────────────────┤
│ 📛  Hash            │ 00002ddfc3a099f0b… │
├────────────────────┼────────────────────┤
│ 🔨  Nonce           │ 86328              │
└────────────────────┴────────────────────┘
0xs34n commented 7 years ago

@jakecraige Thank you for the kind words 😄

The hash was shorten so the table wouldn't look too overwhelming.

Maybe an option in the cli (--json) to display the JSON instead of the table, which would include the entire hash.

Or maybe an --long to show the entire hash for the table.

gengxuelei commented 6 years ago

@seanjameshan So what should I do ?