# WIP: The ~~Missing~~ Collator Guide
Guide on manually setting up a parachain with a collator using custom keys.
### Prerequisites
You should be comfortable with the following tutorial:
- https://docs.substrate.io/tutorials/build-a-blockchain/add-trusted-nodes
## Setup
Clone, checkout, build Polkadot:
```
git clone https://github.com/paritytech/polkadot
cd polkadot
git checkout release-v0.9.37
cargo b -r
```
Clone, checkout, build the parachain template:
```
git clone https://github.com/substrate-developer-hub/substrate-parachain-template
cd substrate-parachain-template
git checkout polkadot-v0.9.37
cargo b -r
```
Use Substrate's key command to generate a random secret phrase and Sr25519 keys (for BABE):
> You will need to clone and compile [Substrate](https://github.com/paritytech/substrate) for this:
```
./target/release/substrate key generate --scheme Sr25519 --password-interactive
```
Use the secret phrase to derive Ed25519 keys:
```
./target/release/substrate key inspect --password-interactive --scheme Ed25519 "pig giraffe ceiling enter weird liar orange decline behind total despair fly"
```
Make sure you have all the keys:
- https://substrate.stackexchange.com/questions/9019/the-given-validation-code-was-rejected-by-the-pvf-pre-checking-vote/9036#9036
## Notes that could be helpful to create this guide:
> The following was taken from a SE and may be useful to get us started with creating this doc:
```
I managed to:
set the aura key,
ext.session.setKeys to set public key
rpc.author.insertKeys to set private key
add it to the Invulnerables list and
let a new session start
I can see that session.queuedKeys storage has all of three collators' keys included but only the first two (already existing ones) are producing blocks.
- https://substrate.stackexchange.com/questions/4671/new-collators-not-producing-blocks
session.queuedKeys -> you have to wait for next session
```
---
```
polkadot
--name=${POD_NAME}
--base-path=/chain-data
--keystore-path=/keystore
--chain=${CHAIN}
--validator
--database=rocksdb
--pruning=1000
--prometheus-external
--prometheus-port 9615
--unsafe-rpc-external
--unsafe-ws-external
--rpc-cors=all
--rpc-methods=unsafe
--node-key $(cat /vault/secrets/nodekey-d-${POD_INDEX})
--log="runtime=debug"
--log="parachain=debug"
--telemetry-url='wss://submit.telemetry.parity-stg.parity.io/submit/ 1'
--execution wasm
--public-addr=/ip4/${EXTERNAL_IP}/tcp/${RELAY_CHAIN_P2P_PORT}
--listen-addr=/ip4/0.0.0.0/tcp/${RELAY_CHAIN_P2P_PORT}
--listen-addr=/ip4/0.0.0.0/tcp/3033
```
```
I'm using the following command to run the parachain:
./target/release/parachain-template-node --collator \
--chain raw-parachain-chainspec.json \
--base-path /tmp/parachain/pubs-demo \
--port 50333 \
--ws-port 8855 \
-- \
--execution wasm \
--chain rococo \
--port 50343 \
--ws-port 9988 \
--sync warp
and in the chain spec I'm using rococo as the relay_chain and Live as the chainType.
```