Deploy Beacon Node
The Beacon Chain is the coordination mechanism of the new network, responsible for creating new blocks, making sure those new blocks are valid, and rewarding validators with ETH for keeping the network secure. Source​

Deploy Beacon Node

beacon.yaml
1
apiVersion: ethereum2.kotal.io/v1alpha1
2
kind: BeaconNode
3
metadata:
4
name: teku-beacon-node
5
spec:
6
network: pyrmont
7
client: teku
8
rest: true
9
restPort: 8888
10
eth1Endpoints:
11
- http://goerli-besu-node:8545
Copied!
In this beacon node, we're using ConsenSys Teku Ethereum 2.0 client client: teku, and syncing the pyrmont network beacon chain network: pyrmont. We also enable REST API server rest: true at port 8888 restPort: 8888. We're connecting to Ethereum 1 endpoint eth1Endpoints: .... Check Ethereum tutorial on how to deploy an Ethereum node.
Let's deploy the beacon node:
1
kubectl apply -f beacon.yaml
Copied!
Kotal operator will notice your teku-beacon-node and will create all the necessary pods, persistent volumes, services, configmaps, and secrets.
You can fetch the deployed Ethereum 2.0 BeaconNode using:
1
kubectl get beaconnodes
Copied!
It will return an output similar to the following:
1
NAME CLIENT Network AGE
2
teku-beacon-node teku pyrmont 1m
Copied!

Fetch Beacon Node Logs

Get the pods created for the beacon node:
1
kubectl get pods
Copied!
It will return an output similar to the following:
1
NAME READY STATUS RESTARTS AGE
2
teku-beacon-node-0 1/1 Running 0 1m
Copied!
Get the logs of the running beacon node:
1
kubectl logs -f teku-beacon-node-0
Copied!

Call /eth/v1/beacon/genesis REST API

Get the service created for the beacon node:
1
kubectl get services
Copied!
It will return an output similar to the following:
1
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
2
teku-beacon-node ClusterIP 10.96.197.218 <none> 9000/UDP,9000/TCP,8888/TCP 7s
Copied!
Forward the localhost:8888 calls to the beacon node
1
kubectl port-forward teku-beacon-node-0 8888
Copied!
In another terminal window, send REST API call to get chain genesis details:
1
curl localhost:8888/eth/v1/beacon/genesis
Copied!
You'll get a result similar to the following:
1
{
2
"data": {
3
"genesis_time": "1606824023",
4
"genesis_validators_root": "0x4b363db94e286120d76eb905340fdd4e54bfe9f06bf33ff6cf5ad27f511bfe95",
5
"genesis_fork_version": "0x00000000"
6
}
7
}
Copied!
Finally delete the beacon node:
1
kubectl delete beaconnode teku-beacon-node
Copied!
Kubernetes garbage collector will delete all the resources that has been created by Kotal Ethereum 2.0 BeaconNode controller.
Last modified 10d ago