Compare commits

...
31 Commits
Author SHA1 Message Date
dboreham 6396e43c68 Update for demo
Former-commit-id: 5fed0cdacace4eb7c490dd9df9a53ffc166ff4ad
2023-04-10 14:52:23 -06:00
dboreham 6cb7bbf1d0 Remove test file
Former-commit-id: 0b6578a182
2023-04-10 11:46:52 -06:00
dboreham acbadc83fc Workaround for ref being different in production
Former-commit-id: f5c2e28065
2023-04-10 11:43:04 -06:00
dboreham 728bf653cc Merge branch 'main' into publish-test
Former-commit-id: 9a657e05a1
2023-04-10 11:29:29 -06:00
dboreham 607b85f447 Fix weird whitespace
Former-commit-id: 23d5d563e1
2023-04-10 11:26:53 -06:00
dboreham a5b5054af5 Merge branch 'main' into publish-test
Former-commit-id: b2070dfaa9
2023-04-10 11:20:33 -06:00
dboreham ce6ef81fe5 Publish drafts on the test branch
Former-commit-id: 49f14f3191
2023-04-10 11:20:15 -06:00
dboreham 3cdad5b2d6 Merge main
Former-commit-id: 4d1f339188
2023-04-10 09:20:26 -06:00
dboreham 7bcad7b936 Fix publish workflow
Former-commit-id: e5cf52f188
2023-04-10 09:18:39 -06:00
dboreham d72dcb6c74 Add test code
Former-commit-id: c934ffe18e
2023-04-10 07:48:22 -06:00
dboreham 1559330fd7 Add test code
Former-commit-id: a225d5034b
2023-04-10 07:44:14 -06:00
dboreham bb33cdffec Force build
Former-commit-id: df37e03287
2023-04-10 07:41:02 -06:00
dboreham 79891b9128 Merge master
Former-commit-id: 00b7ddf1f0
2023-04-10 07:40:13 -06:00
dboreham 75958adf82 Go back to all branches
Former-commit-id: 862cc4d448
2023-04-10 07:37:48 -06:00
dboreham 1abde44a31 Try quotes
Former-commit-id: 008f42ad38
2023-04-10 07:35:55 -06:00
dboreham 19eb67ed08 Force build
Former-commit-id: 32198aba12
2023-04-10 07:29:34 -06:00
dboreham c69ce45190 Merge branch 'main' into publish-test
Former-commit-id: 9a5fa577f2
2023-04-10 07:28:18 -06:00
dboreham b3732bc7a6 Publish only on push to test branch
Former-commit-id: 5201138d6d
2023-04-10 07:27:31 -06:00
dboreham 9cd3ac2567 Force build
Former-commit-id: 77d5c8e9ea
2023-04-10 07:20:51 -06:00
dboreham 0c1170e51c Merge branch 'publish-test' of github.com:cerc-io/stack-orchestrator into publish-test
Former-commit-id: c5a42b7ddf
2023-04-10 07:10:36 -06:00
dboreham 3b9fe60e59 Add file to force a job
Former-commit-id: d01b2215c4
2023-04-10 07:09:56 -06:00
dboreham 6bd84e5b2f Add test code
Former-commit-id: 355c3e179e
2023-04-10 07:02:05 -06:00
dboreham 317608140f Trigger publish on PR and merge to main (#306)
Former-commit-id: c359188b3d
2023-04-10 06:59:08 -06:00
dboreham 21d7a1ba61 Add v prefix
Former-commit-id: 1389559bc6
2023-04-10 06:55:25 -06:00
dboreham 17d5e37368 Remove comment
Former-commit-id: a26ec970bc
2023-04-10 06:54:30 -06:00
dboreham f90000d9cc New build version scheme (#305)
* Use separate build tag file

* Implement new versioning scheme

* Update workflow file

Former-commit-id: 80bbbafeb6
2023-04-10 06:43:23 -06:00
dboreham bf85c61711 Update for new tagging scheme
Former-commit-id: dbb959f648
2023-04-10 06:24:00 -06:00
dboreham 59afaf66ae Make version manually updated
Former-commit-id: f92a2fb3fc
2023-04-10 06:17:12 -06:00
nabarun 18279fcef3 Add env variable to enable/disable sending txs to L2 from watcher peer (#293)
* Add flag to enable/disable watcher peer L2 txs

* Update watcher-ts version in readme

Former-commit-id: d3715d1952
2023-04-10 10:42:56 +05:30
dboreham a8815924c6 Fix typo
Former-commit-id: 93a2e1c864
2023-04-09 22:44:15 -06:00
dboreham fe77955845 Enable publishing with fixed version
Former-commit-id: 751ed2e157
2023-04-09 22:41:01 -06:00
13 changed files with 67 additions and 53 deletions
+27 -26
View File
@@ -1,24 +1,23 @@
name: Publish name: Publish
on: on:
pull_request:
branches: '*'
push: push:
branches: '*' branches:
- main
# Enable debug logging - publish-test
env:
ACTIONS_STEP_DEBUG: true
RUNNER_DEBUG: true
ACTIONS_RUNNER_DEBUG: true
jobs: jobs:
test: publish:
name: "Build" name: "Build and publish"
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: "Clone project repository" - name: "Clone project repository"
uses: actions/checkout@v3 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" - name: "Install Python"
uses: cerc-io/setup-python@v4 uses: cerc-io/setup-python@v4
with: with:
@@ -27,20 +26,22 @@ jobs:
run: python3 --version run: python3 --version
- name: "Install shiv" - name: "Install shiv"
run: pip 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" - name: "Build local shiv package"
# Build has to be done after deciding on the version because id: build
# we bundle the version into the build run: |
run: ./scripts/build_shiv_package.sh ./scripts/build_shiv_package.sh
- name: "Upload release artifact" result_code=$?
uses: cerc-io/action-gh-release@v1 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: with:
tag_name: "v1.2.4" tag_name: ${{ steps.build-info.outputs.build-tag }}
files: requirements.txt # 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 # Set the RPC URL
jq --arg rpcUrl "$L2_GETH_RPC" '.rpcUrl = $rpcUrl' secrets.json > secrets_updated.json && mv secrets_updated.json secrets.json 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}" export RPC_URL="${L2_GETH_RPC}"
# Check if DEPLOYED_CONTRACT environment variable set to skip contract deployment # Check if DEPLOYED_CONTRACT environment variable set to skip contract deployment
@@ -3,6 +3,12 @@ WATCHER_HOST="mobymask-watcher-server"
WATCHER_PORT=3001 WATCHER_PORT=3001
APP_WATCHER_URL="http://localhost: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 # Set deployed MobyMask contract address to avoid deploying contract in stack
# mobymask-app will use this contract address in config if run separately # mobymask-app will use this contract address in config if run separately
DEPLOYED_CONTRACT= DEPLOYED_CONTRACT=
@@ -1,5 +1,5 @@
{ {
"rpcUrl": "", "rpcUrl": "",
"privateKey": "", "privateKey": "",
"baseURI": "http://127.0.0.1:3002/#" "baseURI": ""
} }
@@ -22,20 +22,17 @@ else
echo "Using PRIVATE_KEY_PEER from env" echo "Using PRIVATE_KEY_PEER from env"
fi 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 # Read in the config template TOML file and modify it
echo "$NEW_CONTENT" > environments/local.toml 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 # Write the modified content to a new file
else echo "$WATCHER_CONFIG" > environments/local.toml
# Copy template config to watcher config without setting params for peer L2 txs
cp environments/watcher-config-template.toml environments/local.toml
fi
echo 'yarn server' echo 'yarn server'
yarn server yarn server
@@ -35,6 +35,11 @@
pubSubTopic = 'mobymask' pubSubTopic = 'mobymask'
peerIdFile = './peer-id.json' peerIdFile = './peer-id.json'
enableDebugInfo = true 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] [metrics]
host = "0.0.0.0" host = "0.0.0.0"
+1 -1
View File
@@ -21,7 +21,7 @@ Checkout to the required versions and branches in repos
```bash ```bash
# watcher-ts # watcher-ts
cd ~/cerc/watcher-ts cd ~/cerc/watcher-ts
git checkout v0.2.34 git checkout v0.2.35
# react-peer # react-peer
cd ~/cerc/react-peer cd ~/cerc/react-peer
+3 -2
View File
@@ -17,7 +17,7 @@ Checkout to the required versions and branches in repos:
```bash ```bash
# watcher-ts # watcher-ts
cd ~/cerc/watcher-ts cd ~/cerc/watcher-ts
git checkout v0.2.34 git checkout v0.2.35
# MobyMask # MobyMask
cd ~/cerc/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 * 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 * 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 * 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: * NOTE:
* Stack Orchestrator needs to be run in [`dev`](/docs/CONTRIBUTING.md#install-developer-mode) mode to be able to edit the env file * 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 * If Optimism is running on the host machine, use `host.docker.internal` as the hostname to access the host port
+2 -2
View File
@@ -1,2 +1,2 @@
# This file should be re-generated running: scripts/update-version-file.sh script # Manually updated product release version
v1.0.36-2515878 1.1.0
+1 -1
View File
@@ -23,7 +23,7 @@ def command(ctx):
# See: https://stackoverflow.com/a/20885799/1701505 # See: https://stackoverflow.com/a/20885799/1701505
from . import data 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 # TODO: code better version that skips comment lines
version_string = version_file.read().splitlines()[1] version_string = version_file.read().splitlines()[1]
+1 -1
View File
@@ -1,4 +1,4 @@
# Builds the shiv "package" for distribution # Builds the shiv "package" for distribution
mkdir -p ./package 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} . shiv -c laconic-so -o package/laconic-so-${version_string} .
+8
View File
@@ -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}
-7
View File
@@ -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}