# Collator Staking Guidance
## how to participant as candidate/collator
https://docs.moonbeam.network/node-operators/networks/collator/
### apply as candidate
extrinsic

event

### run collator node & map sessionKey
```
/home/bifrost/ronyang/parachain/bifrost/target/release/bifrost --ws-port=18850 --port=38850 --collator --base-path ./data --chain=asgard-local --unsafe-ws-external --unsafe-rpc-external --rpc-cors=all --rpc-methods=Unsafe --rpc-port=28850 --wasm-execution=compiled --execution=wasm -- --chain=/home/bifrost/ronyang/parachain/polkadot-launch/rococo-local-raw.json --wasm-execution=compiled --execution=wasm --no-beefy
```


### bond more by self
extrinsic

event

after 2 rounds the new collator begin produce blocks and receive Rewards

## Participate as Nominator/Delegator
https://docs.moonbeam.network/tokens/staking/stake/
### delegate to some candidate
extrinsic

event

### delegate more
we can delegate more any time

### delegate less
to delegator less require schedule request first

then any one can execute the request after 36 rounds

### revoke delegate
to revoke means unbond from specific collator

then any one can execute the request after 36 rounds

### leave delegator
to leave means unbound from all collators and require schedule first

then execute the request after 36 rounds

## Staking Reward
Rewards for collators and their delegators are calculated at the start of every round for their work prior to the reward payout delay(2 rounds).
https://docs.moonbeam.network/learn/features/staking/

# Some Revamp
mainly reference moonbeam implementation while decouple `nimbus` from staking, implement traits to integrate with `Session` module
## Decomple with Nimbus
https://github.com/bifrost-finance/moonbeam/commit/2e3f7dddad6294b661e08d17b45f42e853b4ecff
## Benifit of Nimbus
https://docs.moonbeam.network/cn/learn/features/consensus/
actually we've prepared another branch with nimbus integration and we may try it later if required
https://github.com/bifrost-finance/bifrost/tree/collator-staking
## api docs
https://purestake.github.io/moonbeam/parachain_staking/
## runtime storage
### candidate state

### delegate state

unbounding/revoke request also in delegate state
### candidate pool & topN selected

after each round will choose candidate from selected pool as potential block producer
### MinDelegation
there is a const value defines the min value to participant the staking

but not all delegators for the collator will receive reward, only the top `T::MaxDelegatorsPerCollator)`(100 by default) will, so actually the `MinDelegation` will be dynamically calculated on fly