devnet: add algorand sandnet
As far as I can tell, both primary and node are happy. We can't use
https://github.com/algorand/sandbox since it makes too many
assumptions about its environment (docker-compose, interactive
development vs. reproducible CI usage).
Instead, use the official mainnet Docker images and ship our own config.
Caveat: "goal network create" is not reproducible and each Docker
build will generate a new set of root keys. We can presumably avoid
this by hardcoding the output of "goal network create"
(using --noimportkeys to avoid having to vendor a SQLite DB.. we'd
just re-import them to kmd at runtime, which is what goal is doing
internally: f51d2d7d5a/netdeploy/networkTemplate.go (L131)
)
Change-Id: I8c99c6150c9c244c9f12b68a58184c2d5697cee8
This commit is contained in:
parent
982956fcb4
commit
e4802d42d7
10
DEVELOP.md
10
DEVELOP.md
|
@ -178,3 +178,13 @@ Run the bridge UI in devnet by supplying the `--bridge_ui` flag:
|
|||
|
||||
tilt up -- --bridge_ui
|
||||
|
||||
### Algorand
|
||||
|
||||
Node logs:
|
||||
|
||||
kubectl exec -c algod algorand-0 -- tail -f /network/Node/node.log
|
||||
kubectl exec -c algod algorand-0 -- tail -f /network/Primary/node.log
|
||||
|
||||
Account list:
|
||||
|
||||
kubectl exec -c goal-kmd algorand-0 -- ./goal account list
|
||||
|
|
18
Tiltfile
18
Tiltfile
|
@ -286,6 +286,24 @@ if bridge_ui:
|
|||
trigger_mode = trigger_mode,
|
||||
)
|
||||
|
||||
# algorand
|
||||
k8s_yaml_with_ns("devnet/algorand.yaml")
|
||||
|
||||
docker_build(
|
||||
ref = "algorand",
|
||||
context = "third_party/algorand",
|
||||
dockerfile = "third_party/algorand/Dockerfile",
|
||||
)
|
||||
|
||||
k8s_resource(
|
||||
"algorand",
|
||||
port_forwards = [
|
||||
port_forward(4001, name = "Algorand RPC [:4001]", host = webHost),
|
||||
port_forward(4002, name = "Algorand KMD [:4002]", host = webHost),
|
||||
],
|
||||
trigger_mode = trigger_mode,
|
||||
)
|
||||
|
||||
# bigtable
|
||||
|
||||
def build_cloud_function(container_name, go_func_name, path, builder):
|
||||
|
|
|
@ -0,0 +1,62 @@
|
|||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: algorand
|
||||
labels:
|
||||
app: algorand
|
||||
spec:
|
||||
clusterIP: None
|
||||
selector:
|
||||
app: algorand
|
||||
ports:
|
||||
- name: algod
|
||||
port: 4001
|
||||
targetPort: algod
|
||||
- name: kmd
|
||||
port: 4002
|
||||
targetPort: kmd
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: StatefulSet
|
||||
metadata:
|
||||
name: algorand
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app: algorand
|
||||
serviceName: algorand
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: algorand
|
||||
spec:
|
||||
restartPolicy: Always
|
||||
terminationGracePeriodSeconds: 0
|
||||
containers:
|
||||
- name: algod
|
||||
image: algorand
|
||||
command:
|
||||
- /bin/sh
|
||||
- -c
|
||||
- ./goal network start -r /network && sleep infinity
|
||||
ports:
|
||||
- containerPort: 4001
|
||||
name: algod
|
||||
protocol: TCP
|
||||
readinessProbe:
|
||||
tcpSocket:
|
||||
port: 4001
|
||||
- name: goal-kmd
|
||||
image: algorand
|
||||
command:
|
||||
- /bin/sh
|
||||
- -c
|
||||
- ./goal kmd start -d /network/Node && ./goal account list && sleep infinity
|
||||
ports:
|
||||
- containerPort: 4002
|
||||
name: kmd
|
||||
protocol: TCP
|
||||
readinessProbe:
|
||||
tcpSocket:
|
||||
port: 4002
|
|
@ -0,0 +1,16 @@
|
|||
# syntax=docker/dockerfile:1.2
|
||||
FROM docker.io/algorand/stable:3.2.1@sha256:0a87978492680fd98e2cc410f59f2bfd7fef979f035eb060685d56a6e916b5bd
|
||||
|
||||
RUN mkdir -p /setup
|
||||
ADD template.json /setup/
|
||||
|
||||
RUN ./goal network create -n sandnet -r /network -t /setup/template.json && echo rawr
|
||||
|
||||
RUN mkdir -p /network/Node/kmd-v0.5
|
||||
|
||||
ADD token /network/Node/algod.token
|
||||
ADD token /network/Node/kmd-v0.5/kmd.token
|
||||
ADD config.json /network/Node/config.json
|
||||
ADD kmd_config.json /network/Node/kmd-v0.5/kmd_config.json
|
||||
|
||||
ENV ALGORAND_DATA=/network/Node
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"Version": 12,
|
||||
"GossipFanout": 1,
|
||||
"EndpointAddress": "0.0.0.0:4001",
|
||||
"DNSBootstrapID": "",
|
||||
"IncomingConnectionsLimit": 0,
|
||||
"Archival": false,
|
||||
"isIndexerActive": false,
|
||||
"EnableDeveloperAPI": true
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"address": "0.0.0.0:4002",
|
||||
"allowed_origins": [
|
||||
"*"
|
||||
]
|
||||
}
|
|
@ -0,0 +1,56 @@
|
|||
{
|
||||
"Genesis": {
|
||||
"NetworkName": "",
|
||||
"Wallets": [
|
||||
{
|
||||
"Name": "Wallet1",
|
||||
"Stake": 10,
|
||||
"Online": true
|
||||
},
|
||||
{
|
||||
"Name": "Wallet2",
|
||||
"Stake": 40,
|
||||
"Online": true
|
||||
},
|
||||
{
|
||||
"Name": "Wallet3",
|
||||
"Stake": 40,
|
||||
"Online": false
|
||||
},
|
||||
{
|
||||
"Name": "Wallet4",
|
||||
"Stake": 10,
|
||||
"Online": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"Nodes": [
|
||||
{
|
||||
"Name": "Primary",
|
||||
"IsRelay": true,
|
||||
"Wallets": [
|
||||
{
|
||||
"Name": "Wallet1",
|
||||
"ParticipationOnly": false
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"Name": "Node",
|
||||
"Wallets": [
|
||||
{
|
||||
"Name": "Wallet2",
|
||||
"ParticipationOnly": false
|
||||
},
|
||||
{
|
||||
"Name": "Wallet3",
|
||||
"ParticipationOnly": false
|
||||
},
|
||||
{
|
||||
"Name": "Wallet4",
|
||||
"ParticipationOnly": false
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
Loading…
Reference in New Issue