/
action.yml
44 lines (40 loc) · 2.22 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
name: 'private-tangle-setup'
description: 'Setup a private tangle'
runs:
using: "composite"
steps:
- name: Setup private tangle
shell: bash
run: |
# TODO: use next lines when a working hornet release is published
# # Download the private_tangle setup from the hornet repo.
# mkdir private_tangle
# cd private_tangle
# # Use the output of https://api.github.com/repos/iotaledger/hornet/releases/latest once there's a 2.0 Hornet release.
# DOWNLOAD_URL=$(curl "https://api.github.com/repos/iotaledger/hornet/releases" | jq -r '.[0].assets[] | select(.name | contains("private_tangle")) | .browser_download_url')
# echo "Downloading private tangle from $DOWNLOAD_URL"
# curl -L -o private_tangle.tar.gz $DOWNLOAD_URL
# tar -xf private_tangle.tar.gz
# TODO: remove next lines when a working hornet release is published
git clone https://github.com/iotaledger/hornet.git
cd hornet/private_tangle
# Set minPoWScore = 1 since the default (0) doesn't work with wasm_miner.rs in iota.rs currently.
jq '.minPoWScore = $val' --argjson val 1 protocol_parameters.json > tmp.json && mv tmp.json protocol_parameters.json
jq --color-output . protocol_parameters.json
# Manipulate and print config
jq '.restAPI.pow.enabled = $newVal' --argjson newVal true config_private_tangle.json > tmp.$$.json && mv tmp.$$.json config_private_tangle.json
jq --color-output . config_private_tangle.json
# Start Tangle
sudo ./cleanup.sh
sudo ./bootstrap.sh
sudo ./run.sh -d
- name: Wait for tangle to start
shell: bash
run: wget -qO- https://raw.githubusercontent.com/eficode/wait-for/$WAIT_FOR_VERSION/wait-for | sh -s -- -t 60 http://localhost:14265/health -- echo "Tangle is up"
env:
WAIT_FOR_VERSION: 4df3f9262d84cab0039c07bf861045fbb3c20ab7 # v2.2.3
- name: Wait for faucet to start
shell: bash
run: wget -qO- https://raw.githubusercontent.com/eficode/wait-for/$WAIT_FOR_VERSION/wait-for | sh -s -- -t 60 http://localhost:8091/api/info -- echo "Faucet is up"
env:
WAIT_FOR_VERSION: 4df3f9262d84cab0039c07bf861045fbb3c20ab7 # v2.2.3