harmony-one / harmony

The core protocol of harmony
https://harmony.one
GNU Lesser General Public License v3.0
1.47k stars 289 forks source link

[Feature] staking transactions for explorer dashboard #1983

Closed flicker-harmony closed 4 years ago

flicker-harmony commented 4 years ago

Problem/limitation At Hand

Add staking transactions to block explorer dashboard on both backend and frontend. Should be done the same way it's done for normal transactions (see Recent transactions, individual page for transaction, staking transactions list at blocks).https://explorer.testnet.harmony.one

Examples of staking txs can be fetched locally or from devnet or you can check out https://github.com/harmony-one/harmony/blob/master/internal/hmyapi/types.go#L42 CreateValidator message field type (switch from Type field in RPCStakingTransacrtion): https://github.com/harmony-one/harmony/blob/master/internal/hmyapi/types.go#L251 EditValidator: https://github.com/harmony-one/harmony/blob/master/internal/hmyapi/types.go#L268 CollectRewards: https://github.com/harmony-one/harmony/blob/master/internal/hmyapi/types.go#L283 Delegate: https://github.com/harmony-one/harmony/blob/master/internal/hmyapi/types.go#L288 Undelegate: https://github.com/harmony-one/harmony/blob/master/internal/hmyapi/types.go#L295

https://api.s0.pga.hmny.io - devnet {"jsonrpc":"2.0","method":"hmy_getStakingTransactionByHash","params":["0x99c739d48675a875bd57a8359e9a4cf0bef36bade47b633df06a1e5b09af8cfe", true],"id":1} Localnet staking: ./scripts/go_executable_build.sh staking-standalone ./test/debug.sh ./bin/staking-standalone staking-iterate -n 0 -i 0 -d 22 -t create -r 22.22 -m haha

Proposed Solution

Implement the same way it's done for normal transactions on both backend and frontend. Yuriy will do on frontend. Me on backend. Minh can help on both parts.

Alternatives Considered

A clear and concise description of any alternative solutions or features you've considered.

Additional Context

Add any other context or screenshots about the feature request here.

potvik commented 4 years ago

Front: https://github.com/harmony-one/harmony-dashboard