Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Checking validators missed blocks #80

Closed
aner87 opened this issue Jul 17, 2019 · 1 comment
Closed

Checking validators missed blocks #80

aner87 opened this issue Jul 17, 2019 · 1 comment

Comments

@aner87
Copy link

aner87 commented Jul 17, 2019

Hello,
first of all, amazing project, congrats! :)

Secondly, I'm playing around with the documentation and I'm trying to make some queries via NodeJS...
So far I used with satisfaction many of the queries that are reported here on GitHub, but then I wanted to go deeper and tried some that are not documented in the repo, yet.

Only problem, I just can't figure out how to use the two functions to retrieve data about validators' missed blocks:
"sessionTotalMissedBlocksCount" and "MissedOfPerSession".
Every argument I pass into these 2 funcs exits with result 0...which is obviously not true by consulting https://scan.chainx.org/validators/missed

What am I missing? Am I using the wrong functions?
Can somebody explain to me how they are supposed to be used?
Thanks, appreciated!

@ntduan
Copy link

ntduan commented Jul 17, 2019

hi, this is a sample

const Chainx = require('chainx.js').default;

(async () => {
  const chainx = new Chainx('wss://w1.chainx.org/ws');

  await chainx.isRpcReady();

  chainx.api.query.xStaking.offlineValidatorsPerSession
    .at('0x0665d93ea70447a9597caff3f189e56b5e05c7c8ff35622b4887b0807aaf3d83')
    .then(res => {
      console.log('offlineValidatorsPerSession: ' + res);
    })
    .catch(err => {
      console.log(err);
    });

  chainx.api.query.xStaking.missedOfPerSession
    .at(
      '0x0665d93ea70447a9597caff3f189e56b5e05c7c8ff35622b4887b0807aaf3d83',
      '5QccQsc53KdTnBmaB5HkTZwYyQQj9bcwVLPWqn1DZzgQNdux'
    )
    .then(res => {
      console.log('missedOfPerSession: ' + res);
    })
    .catch(err => {
      console.log(err);
    });
})();

@aner87 aner87 closed this as completed Jul 23, 2019
liuchengxu pushed a commit that referenced this issue May 28, 2020
* refactor for multisig

remove doublemap for multisig

* Feature/linked node (#79)

provide linked node data struct for runtime module storage
this linked node support option data or no option data

* provide linkednode struct in cxsupport
* refactor linked node
* add option for LinkedNode
* refactor linkednode
      remove template mode, use associate type to replace it

* Fix static net address (#80)

* Feature/linked_node provide multinodexindex (#82)

provide multinodexindex

* fix bug for linked_node

when add same index node, do nothing for this node

* refactor financialrecords to support withdraw cache

refactor financialrecords to support withdraw cache and remove deposit fee

* btc bridge

* rename num/hash relationship data (NumberForHash/HashsForNumber)
* let HashsForNumber map to a vec to get all forked block
* add blocknumber in BlockHeaderFor

* tokenbalances

refactor tokenbalances to support issue token in genesis

* reject issue chainx token and provide u32, usize as for tokenbalance

* Perfect deposit  (#83)

* Add deposit cache

* Perfect deposit

* Perfect withdraw (#84)

* Perfect withdraw

* add network check in btc bridge

* when meet testnet, jump header bit check
* check the bit change block in genesis

* Fix test build

* Feature/refactor match (#86)

*  matchorder and pendingorders

* Fix op_return account id parse

* tokenbalances: provide reserved type for reservedtoken

* Fix merge error

* update genesis_config

* Update genesis_config

* x-btc

* provide  codec for btreemap

due to orphan for mod, use local struct named `CodecBTreeMap`

* Update latest bitcoin-rust dependeces

* Implement initial vote weight via coin age (#87)

* Use struct instead of map as much as possible

* Unchecked initial version

* All intentions except these validators are candidates

* Add harsh test

* Put candidates into stats

* Rename unstake to deactive

* Revert StakeWeight

* Remove useless code

* Remove MAX_INTENTIONS

* Refactor with btreemap (#88)

* Refactor NominationRecordsOf to NominationRecords using BTreeMap

* Remove candidate_count

* Rename deactive to deactivate

* optimization match (#89)

* remove ensureaccountliquid in tokenbalances and support

for ensureaccountliquied has changed in staking module

* Hotfix/fix stakeweight type (#90)

* Revert StakeWeight type

* Change Balance to u64

* Fix total_minted and remove valid_cands_weight

* Fix insert registration information failure (#91)

* Change receive_address type

* Update exterbn

* update secp256k1 dependency (#94)

* Fix receive_address bug

* Support new substrate in cxrml

* update rust-secp256k1 dependeces

* Runtime build ok

* Build ok

* New runtime interface

* Update all runtime module

* Runtime build ok

* All build ok

* Add node runtime to support chainx runtime

* Update new runtime
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants