# Substrate Infrastructure and Operations
<!-- Put the link to this slide here so people can follow -->
slides: https://hackmd.io/@nlWRE-3fQzmUnPRDIXb2Ag/ryKn1irtv#/
----
----
## Outline
- Acount Key Management
- Node Protection
- Monitoring & Metrics
- Disaster Recovery
----
## Key Management
----
## Kinds of Keys

----
### Account Keys
- Main Keys
- Controller Keys
- Proxy Keys
----
### Main Keys
- SR25519 or ED25519
- Multisig
----
### Controller Keys
- Used soley for Staking Operations
- Can be separate from stash or not
- May be deprecated in the future and have proxy keys everywhere
----
### Proxy Keys

----
### Proxy Keys
- Non-Transfer
- Governance
- Staking
- IdentityJudgement
----
### Anonymous Proxies
- "Pure Proxies"
- Account with a private key
- Anonymous proxy become the `Proxied` account and the creating account becomes the `Proxy` account
----
### Time Delay Proxies

----
### Time Delay Proxies
- Can announce and cancel transactions with a buffer of _x_ amount of blocks
----
### Time Delay Proxies

----
## Node Protection
----
### Kinds of Nodes
- Bootnodes
- RPC Nodes
- Validator Nodes
- Collator Nodes
- Full Nodes
- Sentry Nodes (r.i.p)
----
### RPC Protection
- Firewalling
- Restricting access to certain calls
----
### Granular RPC Restriction

----
### General RPC Restriction

----
## DoS Protection
----
### Sentry Nodes

----
### Polkadot Sentry Nodes

----
### Without Sentry Nodes
- Validators can't be in private networks
- Set up L4 TCP Proxy
- Remote Signing
----
### Remote Signing

----
## Monitoring & Observability
----
### Key Metrics
- Consensus
- Babe
- Grandpa
- Client
- Peers & Connectivity
- CPU & Memory usage
- Enough File Space
----
## Babe
- Slot Authorship Allocations & Missed Slots
----
## Babe
Epoch Opportunities:
```
curl -H "Content-Type: application/json" -d '{"id":1, "jsonrpc":"2.0", "method": "babe_epochAuthorship", "params":[]}' http://localhost:9933
```
- SlotIndex = UNIX_TIMESTAMP / slot_duration
- In sync with block times unless slots are missed
----
## Babe
- Authorship Types
- Primary
- Secondary
- Secondary VRF
----
## Babe


----
## Grandpa
- Logs
- Telemetry
- Client Prometheus Metrics
- Grandpa State Dump
----
## Grandpa
Telemetry:

----
## Grandpa
Client:

----
## Grandpa
State Dump:

----
## Disaster Recovery
- Chain Bricks
- Finality Halted
- Validator Stalls
----
## Other Things
---
{"metaMigratedAt":"2023-06-15T15:27:49.301Z","metaMigratedFrom":"YAML","title":"Substrate Operations Workshop","breaks":true,"description":"View the slide with \"Slide Mode\".","contributors":"[{\"id\":\"9e559113-eddf-4339-949c-f4432176f602\",\"add\":3657,\"del\":2903}]"}