Archived
Compare commits
31
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6396e43c68 | ||
|
|
6cb7bbf1d0 | ||
|
|
acbadc83fc | ||
|
|
728bf653cc | ||
|
|
607b85f447 | ||
|
|
a5b5054af5 | ||
|
|
ce6ef81fe5 | ||
|
|
3cdad5b2d6 | ||
|
|
7bcad7b936 | ||
|
|
d72dcb6c74 | ||
|
|
1559330fd7 | ||
|
|
bb33cdffec | ||
|
|
79891b9128 | ||
|
|
75958adf82 | ||
|
|
1abde44a31 | ||
|
|
19eb67ed08 | ||
|
|
c69ce45190 | ||
|
|
b3732bc7a6 | ||
|
|
9cd3ac2567 | ||
|
|
0c1170e51c | ||
|
|
3b9fe60e59 | ||
|
|
6bd84e5b2f | ||
|
|
317608140f | ||
|
|
21d7a1ba61 | ||
|
|
17d5e37368 | ||
|
|
f90000d9cc | ||
|
|
bf85c61711 | ||
|
|
59afaf66ae | ||
|
|
18279fcef3 | ||
|
|
a8815924c6 | ||
|
|
fe77955845 |
@@ -1,24 +1,23 @@
|
||||
name: Publish
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: '*'
|
||||
push:
|
||||
branches: '*'
|
||||
|
||||
# Enable debug logging
|
||||
env:
|
||||
ACTIONS_STEP_DEBUG: true
|
||||
RUNNER_DEBUG: true
|
||||
ACTIONS_RUNNER_DEBUG: true
|
||||
branches:
|
||||
- main
|
||||
- publish-test
|
||||
|
||||
jobs:
|
||||
test:
|
||||
name: "Build"
|
||||
publish:
|
||||
name: "Build and publish"
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: "Clone project repository"
|
||||
uses: actions/checkout@v3
|
||||
- name: "Get build info"
|
||||
id: build-info
|
||||
run: |
|
||||
build_tag=$(./scripts/create_build_tag_file.sh)
|
||||
echo "build-tag=v${build_tag}" >> $GITHUB_OUTPUT
|
||||
- name: "Install Python"
|
||||
uses: cerc-io/setup-python@v4
|
||||
with:
|
||||
@@ -27,20 +26,22 @@ jobs:
|
||||
run: python3 --version
|
||||
- name: "Install shiv"
|
||||
run: pip install shiv
|
||||
- name: "Create release"
|
||||
uses: cerc-io/action-gh-release@v1
|
||||
# We haven't decided how to trigger this release job.
|
||||
# It might be done on creation of a git tag
|
||||
# Or it might be done on merge to a release branch
|
||||
# Somehow by this point however we need to know the release version
|
||||
with:
|
||||
tag_name: "v1.2.4"
|
||||
- name: "Build local shiv package"
|
||||
# Build has to be done after deciding on the version because
|
||||
# we bundle the version into the build
|
||||
run: ./scripts/build_shiv_package.sh
|
||||
- name: "Upload release artifact"
|
||||
uses: cerc-io/action-gh-release@v1
|
||||
id: build
|
||||
run: |
|
||||
./scripts/build_shiv_package.sh
|
||||
result_code=$?
|
||||
echo "package-file=$(ls ./package/*)" >> $GITHUB_OUTPUT
|
||||
exit $result_code
|
||||
- name: "Stage artifact file"
|
||||
run: |
|
||||
cp ${{ steps.build.outputs.package-file }} ./laconic-so
|
||||
- name: "Create release"
|
||||
uses: cerc-io/action-gh-release@gitea-v1
|
||||
with:
|
||||
tag_name: "v1.2.4"
|
||||
files: requirements.txt
|
||||
tag_name: ${{ steps.build-info.outputs.build-tag }}
|
||||
# On the publish test branch, mark our release as a draft
|
||||
# Hack using endsWith to workaround Gitea sometimes sending "publish-test" vs "refs/heads/publish-test"
|
||||
draft: ${{ endsWith('publish-test', github.ref ) }}
|
||||
files: ./laconic-so
|
||||
|
||||
|
||||
@@ -20,6 +20,9 @@ jq --arg privateKey "$PRIVATE_KEY_DEPLOYER" '.privateKey = $privateKey' secrets-
|
||||
# Set the RPC URL
|
||||
jq --arg rpcUrl "$L2_GETH_RPC" '.rpcUrl = $rpcUrl' secrets.json > secrets_updated.json && mv secrets_updated.json secrets.json
|
||||
|
||||
# Set the MobyMask app base URI
|
||||
jq --arg baseURI "$MOBYMASK_APP_BASE_URI" '.baseURI = $baseURI' secrets.json > secrets_updated.json && mv secrets_updated.json secrets.json
|
||||
|
||||
export RPC_URL="${L2_GETH_RPC}"
|
||||
|
||||
# Check if DEPLOYED_CONTRACT environment variable set to skip contract deployment
|
||||
|
||||
@@ -3,6 +3,12 @@ WATCHER_HOST="mobymask-watcher-server"
|
||||
WATCHER_PORT=3001
|
||||
APP_WATCHER_URL="http://localhost:3001"
|
||||
|
||||
# Base URI for mobymask-app (used for generating invite)
|
||||
MOBYMASK_APP_BASE_URI="http://127.0.0.1:3002/#"
|
||||
|
||||
# Set to false for disabling watcher peer to send txs to L2
|
||||
ENABLE_PEER_L2_TXS=true
|
||||
|
||||
# Set deployed MobyMask contract address to avoid deploying contract in stack
|
||||
# mobymask-app will use this contract address in config if run separately
|
||||
DEPLOYED_CONTRACT=
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"rpcUrl": "",
|
||||
"privateKey": "",
|
||||
"baseURI": "http://127.0.0.1:3002/#"
|
||||
"baseURI": ""
|
||||
}
|
||||
|
||||
@@ -22,20 +22,17 @@ else
|
||||
echo "Using PRIVATE_KEY_PEER from env"
|
||||
fi
|
||||
|
||||
# Set private key and contract address for watcher peer txs to L2 only if PRIVATE_KEY_PEER variable is set
|
||||
if [ -n "$PRIVATE_KEY_PEER" ]; then
|
||||
# Read in config template TOML file and modify it
|
||||
CONTENT=$(cat environments/watcher-config-template.toml)
|
||||
NEW_CONTENT=$(echo "$CONTENT" | sed -E "/\[metrics\]/i \\\n\n [server.p2p.peer.l2TxConfig]\n privateKey = \"${PRIVATE_KEY_PEER}\"\n contractAddress = \"${CONTRACT_ADDRESS}\"\n")
|
||||
|
||||
# Write the modified content to a watcher config file
|
||||
echo "$NEW_CONTENT" > environments/local.toml
|
||||
# Read in the config template TOML file and modify it
|
||||
WATCHER_CONFIG_TEMPLATE=$(cat environments/watcher-config-template.toml)
|
||||
WATCHER_CONFIG=$(echo "$WATCHER_CONFIG_TEMPLATE" | \
|
||||
sed -E "s/REPLACE_WITH_ENABLE_PEER_L2_TXS/${ENABLE_PEER_L2_TXS}/g; \
|
||||
s/REPLACE_WITH_PRIVATE_KEY_PEER/${PRIVATE_KEY_PEER}/g; \
|
||||
s/REPLACE_WITH_CONTRACT_ADDRESS/${CONTRACT_ADDRESS}/g; \
|
||||
s|REPLACE_WITH_L2_GETH_RPC_ENDPOINT|${L2_GETH_RPC}| ")
|
||||
|
||||
sed -i 's|REPLACE_WITH_L2_GETH_RPC_ENDPOINT|'"${L2_GETH_RPC}"'|' environments/local.toml
|
||||
else
|
||||
# Copy template config to watcher config without setting params for peer L2 txs
|
||||
cp environments/watcher-config-template.toml environments/local.toml
|
||||
fi
|
||||
# Write the modified content to a new file
|
||||
echo "$WATCHER_CONFIG" > environments/local.toml
|
||||
|
||||
echo 'yarn server'
|
||||
yarn server
|
||||
|
||||
@@ -35,6 +35,11 @@
|
||||
pubSubTopic = 'mobymask'
|
||||
peerIdFile = './peer-id.json'
|
||||
enableDebugInfo = true
|
||||
enableL2Txs = REPLACE_WITH_ENABLE_PEER_L2_TXS
|
||||
|
||||
[server.p2p.peer.l2TxsConfig]
|
||||
privateKey = 'REPLACE_WITH_PRIVATE_KEY_PEER'
|
||||
contractAddress = 'REPLACE_WITH_CONTRACT_ADDRESS'
|
||||
|
||||
[metrics]
|
||||
host = "0.0.0.0"
|
||||
|
||||
@@ -21,7 +21,7 @@ Checkout to the required versions and branches in repos
|
||||
```bash
|
||||
# watcher-ts
|
||||
cd ~/cerc/watcher-ts
|
||||
git checkout v0.2.34
|
||||
git checkout v0.2.35
|
||||
|
||||
# react-peer
|
||||
cd ~/cerc/react-peer
|
||||
|
||||
@@ -17,7 +17,7 @@ Checkout to the required versions and branches in repos:
|
||||
```bash
|
||||
# watcher-ts
|
||||
cd ~/cerc/watcher-ts
|
||||
git checkout v0.2.34
|
||||
git checkout v0.2.35
|
||||
|
||||
# MobyMask
|
||||
cd ~/cerc/MobyMask
|
||||
@@ -38,8 +38,9 @@ This should create the required docker images in the local image registry
|
||||
|
||||
* In [mobymask-params.env](../../config/watcher-mobymask-v2/mobymask-params.env) file set `DEPLOYED_CONTRACT` to existing deployed mobymask contract address
|
||||
* Setting `DEPLOYED_CONTRACT` will skip contract deployment when running stack
|
||||
* `ENABLE_PEER_L2_TXS` is used to enable/disable sending txs to L2 chain from watcher peer.
|
||||
* Update the [optimism-params.env](../../config/watcher-mobymask-v2/optimism-params.env) file with Optimism endpoints and other params for the Optimism running separately
|
||||
* If `PRIVATE_KEY_PEER` is not set the inline watcher peer will not send txs to L2 on receiving P2P network messages
|
||||
* `PRIVATE_KEY_PEER` is used by watcher peer to send txs to L2 chain
|
||||
* NOTE:
|
||||
* Stack Orchestrator needs to be run in [`dev`](/docs/CONTRIBUTING.md#install-developer-mode) mode to be able to edit the env file
|
||||
* If Optimism is running on the host machine, use `host.docker.internal` as the hostname to access the host port
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
# This file should be re-generated running: scripts/update-version-file.sh script
|
||||
v1.0.36-2515878
|
||||
# Manually updated product release version
|
||||
1.1.0
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@ def command(ctx):
|
||||
|
||||
# See: https://stackoverflow.com/a/20885799/1701505
|
||||
from . import data
|
||||
with importlib.resources.open_text(data, "version.txt") as version_file:
|
||||
with importlib.resources.open_text(data, "build_tag.txt") as version_file:
|
||||
# TODO: code better version that skips comment lines
|
||||
version_string = version_file.read().splitlines()[1]
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Builds the shiv "package" for distribution
|
||||
mkdir -p ./package
|
||||
version_string=$( ./scripts/update_version_file.sh)
|
||||
version_string=$( ./app/data/version.txt )
|
||||
shiv -c laconic-so -o package/laconic-so-${version_string} .
|
||||
|
||||
Executable
+8
@@ -0,0 +1,8 @@
|
||||
build_tag_file_name=./app/data/build_tag.txt
|
||||
echo "# This file should be re-generated running: scripts/create_build_tag_file.sh script" > $build_tag_file_name
|
||||
product_version_string=$( tail -1 ./app/data/version.txt )
|
||||
commit_string=$( git rev-parse --short HEAD )
|
||||
timestamp_string=$(date +'%Y%m%d%H%M')
|
||||
build_tag_string=${product_version_string}-${commit_string}-${timestamp_string}
|
||||
echo ${build_tag_string} >> $build_tag_file_name
|
||||
echo ${build_tag_string}
|
||||
@@ -1,7 +0,0 @@
|
||||
version_file_name=./app/data/version.txt
|
||||
echo "# This file should be re-generated running: scripts/update-version-file.sh script" > $version_file_name
|
||||
tag_string=$( git describe --tags --abbrev=0 )
|
||||
commit_string=$( git rev-parse --short HEAD )
|
||||
version_string=${tag_string}-${commit_string}
|
||||
echo ${version_string} >> $version_file_name
|
||||
echo ${version_string}
|
||||
Reference in New Issue
Block a user