2020-08-15 13:14:24 -07:00
|
|
|
# Developing the bridge
|
|
|
|
|
|
|
|
## Local Devnet
|
|
|
|
|
|
|
|
The following dependencies are required for local development:
|
|
|
|
|
|
|
|
- [Go](https://golang.org/dl/) >= 1.14
|
|
|
|
- [Docker](https://docs.docker.com/engine/install/) / moby-engine >= 19.03
|
|
|
|
- [Tilt](http://tilt.dev/) >= 0.17.2
|
|
|
|
|
|
|
|
- Any of the local Kubernetes clusters supported by Tilt
|
2020-09-24 16:33:29 -07:00
|
|
|
(we recommend [minikube](https://kubernetes.io/docs/setup/learning-environment/minikube/) in the default config).
|
2020-08-15 13:14:24 -07:00
|
|
|
|
|
|
|
See the [Tilt docs](https://docs.tilt.dev/install.html) docs on how to set up your local cluster -
|
|
|
|
it won't take more than a few minutes to set up!
|
|
|
|
|
|
|
|
This should work on Linux, MacOS and possibly even Windows.
|
|
|
|
|
2020-08-16 03:30:23 -07:00
|
|
|
After installing all dependencies, just run `tilt up --update-mode=exec`.
|
2020-08-15 13:14:24 -07:00
|
|
|
Whenever you modify a file, the devnet is automatically rebuilt and a rolling update is done.
|
|
|
|
|
2020-08-19 05:23:00 -07:00
|
|
|
Specify number of guardians nodes to run (default is five):
|
|
|
|
|
|
|
|
tilt up --update-mode=exec -- --num=10
|
|
|
|
|
|
|
|
Watch pod status in your cluster:
|
|
|
|
|
|
|
|
kubectl get pod -A -w
|
|
|
|
|
|
|
|
Get logs for single guardian node:
|
|
|
|
|
|
|
|
kubectl logs guardian-0
|
|
|
|
|
2020-08-19 09:01:21 -07:00
|
|
|
Restart a specific pod:
|
|
|
|
|
|
|
|
kubectl delete pod guardian-0
|
|
|
|
|
2020-08-19 05:23:00 -07:00
|
|
|
Generate test ETH lockups once the cluster is up:
|
|
|
|
|
|
|
|
kubectl exec -it -c tests eth-devnet-0 -- npx truffle exec src/send-lockups.js
|
2020-08-15 14:56:33 -07:00
|
|
|
|
2020-08-19 08:38:55 -07:00
|
|
|
Adjust number of nodes in running cluster:
|
|
|
|
|
|
|
|
tilt args -- --num=2
|
2020-08-19 09:01:21 -07:00
|
|
|
|
|
|
|
(this is only useful if you want to test scenarios where the number
|
|
|
|
of nodes diverges from the guardian set - otherwise, `tilt down` and restart the cluster)
|
2020-08-19 08:38:55 -07:00
|
|
|
|
2020-08-15 13:14:24 -07:00
|
|
|
Once you're done, press Ctrl-C. Run `tilt down` to tear down the devnet.
|