Skip to content

Commit

Permalink
Merge branch 'main' into ziga/gateway_metamask_connect_button
Browse files Browse the repository at this point in the history
  • Loading branch information
zkokelj authored Oct 16, 2023
2 parents 40d43bc + ee83c92 commit 7f5de17
Show file tree
Hide file tree
Showing 67 changed files with 1,626 additions and 1,339 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/manual-deploy-obscuro-gateway-database.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
type: choice
options:
- 'dev-testnet'
- 'testnet'
- 'uat-testnet'
- 'sepolia-testnet'

jobs:
Expand All @@ -28,17 +28,17 @@ jobs:
echo "Branch Name: ${GITHUB_REF_NAME}"
echo "BRANCH_NAME=${GITHUB_REF_NAME}" >> $GITHUB_ENV
- name: 'Set Obscuro Gateway variables for testnet'
if: ${{ github.event.inputs.testnet_type == 'testnet' }}
- name: 'Set Obscuro Gateway variables for UAT testnet'
if: ${{ github.event.inputs.testnet_type == 'uat-testnet' }}
run: |
echo "OBSCURO_GATEWAY_DB_BUILD_TAG=testnetobscuronet.azurecr.io/obscuronet/obscuro_gateway_mariadb_testnet:latest" >> $GITHUB_ENV
echo "OBSCURO_GATEWAY_DB_BUILD_TAG=testnetobscuronet.azurecr.io/obscuronet/obscuro_gateway_mariadb_uat_testnet:latest" >> $GITHUB_ENV
echo "RESOURCE_STARTING_NAME=testnet" >> $GITHUB_ENV
echo "RESOURCE_TAG_NAME=obscurogatewaydbtestnetlatest" >> $GITHUB_ENV
- name: 'Set Obscuro Gateway variables for dev-testnet'
if: ${{ github.event.inputs.testnet_type == 'dev-testnet' }}
run: |
echo "OBSCURO_GATEWAY_DB_BUILD_TAG=testnetobscuronet.azurecr.io/obscuronet/dev_obscuro_gateway_mariadb_testnet:latest" >> $GITHUB_ENV
echo "OBSCURO_GATEWAY_DB_BUILD_TAG=testnetobscuronet.azurecr.io/obscuronet/obscuro_gateway_mariadb_dev_testnet:latest" >> $GITHUB_ENV
echo "RESOURCE_STARTING_NAME=dev-testnet" >> $GITHUB_ENV
echo "RESOURCE_TAG_NAME=obscurogatewaydbdevtestnetlatest" >> $GITHUB_ENV
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/manual-deploy-obscuro-gateway.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
type: choice
options:
- 'dev-testnet'
- 'testnet'
- 'uat-testnet'
- 'sepolia-testnet'

jobs:
Expand All @@ -32,17 +32,17 @@ jobs:
uses: docker/setup-buildx-action@v1

- name: 'Set Obscuro Gateway variables for testnet'
if: ${{ github.event.inputs.testnet_type == 'testnet' }}
if: ${{ github.event.inputs.testnet_type == 'uat-testnet' }}
run: |
echo "OBSCURO_GATEWAY_BUILD_TAG=testnetobscuronet.azurecr.io/obscuronet/obscuro_gateway_testnet:latest" >> $GITHUB_ENV
echo "OBSCURO_GATEWAY_NODE_HOST=erpc.testnet.obscu.ro" >> $GITHUB_ENV
echo "RESOURCE_STARTING_NAME=testnet" >> $GITHUB_ENV
echo "RESOURCE_TAG_NAME=obscurogatewaytestnetlatest" >> $GITHUB_ENV
echo "OBSCURO_GATEWAY_BUILD_TAG=testnetobscuronet.azurecr.io/obscuronet/obscuro_gateway_uat_testnet:latest" >> $GITHUB_ENV
echo "OBSCURO_GATEWAY_NODE_HOST=erpc.uat-testnet.obscu.ro" >> $GITHUB_ENV
echo "RESOURCE_STARTING_NAME=uat-testnet" >> $GITHUB_ENV
echo "RESOURCE_TAG_NAME=obscurogatewayuattestnetlatest" >> $GITHUB_ENV
- name: 'Set Obscuro Gateway variables for dev-testnet'
if: ${{ github.event.inputs.testnet_type == 'dev-testnet' }}
run: |
echo "OBSCURO_GATEWAY_BUILD_TAG=testnetobscuronet.azurecr.io/obscuronet/dev_obscuro_gateway_testnet:latest" >> $GITHUB_ENV
echo "OBSCURO_GATEWAY_BUILD_TAG=testnetobscuronet.azurecr.io/obscuronet/obscuro_gateway_dev_testnet:latest" >> $GITHUB_ENV
echo "OBSCURO_GATEWAY_NODE_HOST=erpc.dev-testnet.obscu.ro" >> $GITHUB_ENV
echo "RESOURCE_STARTING_NAME=dev-testnet" >> $GITHUB_ENV
echo "RESOURCE_TAG_NAME=obscurogatewaydevtestnetlatest" >> $GITHUB_ENV
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/manual-deploy-obscuro-scan-2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
type: choice
options:
- 'dev-testnet'
- 'testnet'
- 'uat-testnet'

jobs:
build-and-deploy:
Expand All @@ -25,17 +25,17 @@ jobs:
uses: docker/setup-buildx-action@v1

- name: 'Set Obscuro Scan variables for testnet'
if: ${{ github.event.inputs.testnet_type == 'testnet' }}
if: ${{ github.event.inputs.testnet_type == 'uat-testnet' }}
run: |
echo "OBSCURO_SCAN_FE_BUILD_TAG=testnetobscuronet.azurecr.io/obscuronet/fe_obscuro_scan_testnet:latest" >> $GITHUB_ENV
echo "OBSCURO_SCAN_API_BUILD_TAG=testnetobscuronet.azurecr.io/obscuronet/api_obscuro_scan_testnet:latest" >> $GITHUB_ENV
echo "OBSCURO_SCAN_NODE_HOST=erpc.testnet.obscu.ro" >> $GITHUB_ENV
echo "OBSCURO_SCAN_FE_BUILD_TAG=testnetobscuronet.azurecr.io/obscuronet/fe_obscuro_scan_uat_testnet:latest" >> $GITHUB_ENV
echo "OBSCURO_SCAN_API_BUILD_TAG=testnetobscuronet.azurecr.io/obscuronet/api_obscuro_scan_uat_testnet:latest" >> $GITHUB_ENV
echo "OBSCURO_SCAN_NODE_HOST=erpc.uat-testnet.obscu.ro" >> $GITHUB_ENV
- name: 'Set Obscuro Scan variables for dev-testnet'
if: ${{ github.event.inputs.testnet_type == 'dev-testnet' }}
run: |
echo "OBSCURO_SCAN_FE_BUILD_TAG=testnetobscuronet.azurecr.io/obscuronet/dev_fe_obscuro_scan_testnet:latest" >> $GITHUB_ENV
echo "OBSCURO_SCAN_API_BUILD_TAG=testnetobscuronet.azurecr.io/obscuronet/dev_api_obscuro_scan_testnet:latest" >> $GITHUB_ENV
echo "OBSCURO_SCAN_FE_BUILD_TAG=testnetobscuronet.azurecr.io/obscuronet/fe_obscuro_scan_dev_testnet:latest" >> $GITHUB_ENV
echo "OBSCURO_SCAN_API_BUILD_TAG=testnetobscuronet.azurecr.io/obscuronet/api_obscuro_scan_dev_testnet:latest" >> $GITHUB_ENV
echo "OBSCURO_SCAN_NODE_HOST=erpc.dev-testnet.obscu.ro" >> $GITHUB_ENV
- name: 'Login to Azure docker registry'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/manual-deploy-obscuroscan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ jobs:
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Docker Build & Push to ACR
run: |
DOCKER_BUILDKIT=1 docker build -t testnetobscuronet.azurecr.io/obscuronet/obscuro_testnet_obscuroscan:latest -f tools/obscuroscan/Dockerfile .
docker push testnetobscuronet.azurecr.io/obscuronet/obscuro_testnet_obscuroscan:latest
DOCKER_BUILDKIT=1 docker build -t testnetobscuronet.azurecr.io/obscuronet/obscuro_uat_testnet_obscuroscan:latest -f tools/obscuroscan/Dockerfile .
docker push testnetobscuronet.azurecr.io/obscuronet/obscuro_uat_testnet_obscuroscan:latest
- name: 'Deploy to Azure Web App for Container'
uses: azure/webapps-deploy@v2
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/manual-deploy-testnet-faucet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ on:
type: choice
options:
- 'dev-testnet'
- 'testnet'
- 'uat-testnet'
- 'sepolia-testnet'

workflow_call:
Expand All @@ -42,23 +42,23 @@ jobs:
uses: docker/setup-buildx-action@v1

- name: 'Sets env vars for testnet'
if: ${{ inputs.testnet_type == 'testnet' }}
if: ${{ inputs.testnet_type == 'uat-testnet' }}
run: |
echo "FAUCET_BUILD_TAG=testnetobscuronet.azurecr.io/obscuronet/faucet_testnet:latest" >> $GITHUB_ENV
echo "TESTNET_ADDR=erpc.testnet.obscu.ro" >> $GITHUB_ENV
echo "FAUCET_BUILD_TAG=testnetobscuronet.azurecr.io/obscuronet/faucet_uat_testnet:latest" >> $GITHUB_ENV
echo "TESTNET_ADDR=erpc.uat-testnet.obscu.ro" >> $GITHUB_ENV
echo "DEFAULT_FAUCET_AMOUNT=100" >> $GITHUB_ENV
- name: 'Sets env vars for dev-testnet'
if: ${{ inputs.testnet_type == 'dev-testnet' }}
run: |
echo "FAUCET_BUILD_TAG=testnetobscuronet.azurecr.io/obscuronet/dev_faucet_testnet:latest" >> $GITHUB_ENV
echo "FAUCET_BUILD_TAG=testnetobscuronet.azurecr.io/obscuronet/faucet_dev_testnet:latest" >> $GITHUB_ENV
echo "TESTNET_ADDR=erpc.dev-testnet.obscu.ro" >> $GITHUB_ENV
echo "DEFAULT_FAUCET_AMOUNT=100" >> $GITHUB_ENV
- name: 'Sets env vars for sepolia-testnet'
if: ${{ inputs.testnet_type == 'sepolia-testnet' }}
run: |
echo "FAUCET_BUILD_TAG=testnetobscuronet.azurecr.io/obscuronet/sepolia_faucet_testnet:latest" >> $GITHUB_ENV
echo "FAUCET_BUILD_TAG=testnetobscuronet.azurecr.io/obscuronet/faucet_sepolia_testnet:latest" >> $GITHUB_ENV
echo "TESTNET_ADDR=erpc.sepolia-testnet.obscu.ro" >> $GITHUB_ENV
echo "DEFAULT_FAUCET_AMOUNT=0.5" >> $GITHUB_ENV
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/manual-deploy-testnet-l1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ jobs:
echo "L1_CONTAINER_NAME=testnet-eth2network" >> $GITHUB_ENV
echo "RESOURCE_TAG_NAME=l1testnetlatest" >> $GITHUB_ENV
echo "RESOURCE_NAME=testnet-eth2network" >> $GITHUB_ENV
echo "TEST_BRIDGE_ADDRESS=0xE09a37ABc1A63441404007019E5BC7517bE2c43f" >> $GITHUB_ENV
- name: 'Sets env vars for dev-testnet'
if: ${{ github.event.inputs.testnet_type == 'dev-testnet' }}
Expand All @@ -56,6 +57,7 @@ jobs:
echo "L1_CONTAINER_NAME=dev-testnet-eth2network" >> $GITHUB_ENV
echo "RESOURCE_TAG_NAME=devl1testnetlatest" >> $GITHUB_ENV
echo "RESOURCE_NAME=dev-testnet-eth2network" >> $GITHUB_ENV
echo "TEST_BRIDGE_ADDRESS=0xE09a37ABc1A63441404007019E5BC7517bE2c43f" >> $GITHUB_ENV
- name: 'Login via Azure CLI'
Expand Down Expand Up @@ -147,6 +149,6 @@ jobs:
--blockTimeSecs=15 --slotsPerEpoch=2 --slotsPerSecond=15 \
--numNodes=1 --gethHTTPStartPort=8025 --gethWSStartPort=9000 \
--logToFile=false \
--prefundedAddrs="${{ vars.WORKER_ADDR }},${{ vars.NODE_WALLET_ADDR_0 }},${{ vars.NODE_WALLET_ADDR_1 }}"'
--prefundedAddrs="${{ vars.WORKER_ADDR }},${{ vars.NODE_WALLET_ADDR_0 }},${{ vars.NODE_WALLET_ADDR_1 }},${{ env.TEST_BRIDGE_ADDRESS }}"'
26 changes: 12 additions & 14 deletions .github/workflows/manual-deploy-testnet-l2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ jobs:
echo "WORKER_ADDR=${{vars.WORKER_ADDR}}"
echo "BATCH_INTERVAL=${{vars.BATCH_INTERVAL}}"
echo "L2_MAX_BATCH_INTERVAL=${{vars.L2_MAX_BATCH_INTERVAL}}"
echo "ROLLUP_INTERVAL=${{vars.ROLLUP_INTERVAL}}"
echo "FAUCET_FUNDS=${{vars.FAUCET_FUNDS}}"
Expand Down Expand Up @@ -107,8 +108,7 @@ jobs:
echo "L1_START_HASH=$L1START" >> $GITHUB_ENV
echo "L1_START_HASH=$L1START" >> $GITHUB_OUTPUT
- name: 'Save container logs on failure'
if: failure()
- name: 'Save L1 deployer container logs'
# Wait to make sure the logs are available in the container
run: |
sleep 60
Expand All @@ -128,14 +128,13 @@ jobs:
inlineScript: |
$(az resource list --tag ${{vars.RESOURCE_TAG_NAME}}=true --query '[]."id"' -o tsv | xargs -n1 az resource delete --verbose -g Testnet --ids) || true
- name: 'Upload container logs on failure'
- name: 'Upload L1 deployer container logs'
uses: actions/upload-artifact@v3
if: failure()
with:
name: deploy-l1-artifacts
path: |
deploy-l1-contracts.out
retention-days: 2
retention-days: 1

deploy:
needs: build
Expand Down Expand Up @@ -197,9 +196,9 @@ jobs:
--admin-username obscurouser --admin-password "${{ secrets.OBSCURO_NODE_VM_PWD }}" \
--public-ip-address-dns-name "obscuronode-${{ matrix.host_id }}-${{vars.RESOURCE_TESTNET_NAME}}-${{ GITHUB.RUN_NUMBER }}" \
--tags deploygroup=ObscuroNode-${{vars.RESOURCE_TESTNET_NAME}}-${{ GITHUB.RUN_NUMBER }} ${{vars.RESOURCE_TAG_NAME}}=true \
--vnet-name ObscuroHost-${{vars.RESOURCE_TESTNET_NAME}}-01VNET --subnet ObscuroHost-${{vars.RESOURCE_TESTNET_NAME}}-01Subnet \
--size Standard_DC4s_v2 --image ObscuroConfUbuntu \
--public-ip-sku Basic --authentication-type password
--vnet-name ${{vars.RESOURCE_TESTNET_NAME}}-virtual-network --subnet ${{vars.RESOURCE_TESTNET_NAME}}-sub-network \
--size Standard_DC8_v2 --storage-sku StandardSSD_LRS --image ObscuroConfUbuntu \
--public-ip-sku Standard --authentication-type password
- name: 'Open Obscuro node-${{ matrix.host_id }} ports on Azure'
uses: azure/CLI@v1
Expand Down Expand Up @@ -253,6 +252,7 @@ jobs:
-is_debug_namespace_enabled=true \
-log_level=${{ github.event.inputs.log_level }} \
-batch_interval=${{vars.BATCH_INTERVAL}} \
-max_batch_interval=${{vars.L2_MAX_BATCH_INTERVAL}} \
-rollup_interval=${{vars.ROLLUP_INTERVAL}} \
-l1_chain_id=${{vars.L1_CHAIN_ID}} \
start'
Expand Down Expand Up @@ -281,7 +281,7 @@ jobs:
with:
inlineScript: |
az network nic ip-config address-pool add \
--address-pool Backend-Pool-Obscuro-${{vars.RESOURCE_TESTNET_NAME}} \
--address-pool ${{vars.RESOURCE_TESTNET_NAME}}-backend-pool \
--ip-config-name ipconfig${{vars.RESOURCE_STARTING_NAME}}-1-${{ GITHUB.RUN_NUMBER }} \
--nic-name ${{vars.RESOURCE_STARTING_NAME}}-1-${{ GITHUB.RUN_NUMBER }}VMNic \
--resource-group Testnet \
Expand Down Expand Up @@ -329,19 +329,17 @@ jobs:
-docker_image=${{vars.L2_HARDHATDEPLOYER_DOCKER_BUILD_TAG}} \
-faucet_funds=${{vars.FAUCET_FUNDS}}
- name: 'Save container logs on failure'
if: failure()
- name: 'Save L2 deployer container logs'
run: |
docker logs `docker ps -aqf "name=hh-l2-deployer"` > deploy-l2-contracts.out 2>&1
- name: 'Upload container logs on failure'
- name: 'Upload L2 deployer container logs'
uses: actions/upload-artifact@v3
if: failure()
with:
name: deploy-l2-artifacts
path: |
deploy-l2-contracts.out
retention-days: 2
retention-days: 1

deploy-faucet:
name: 'Trigger Faucet deployment for dev- / testnet on a new deployment'
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/manual-upgrade-testnet-l2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ jobs:
echo "WORKER_ADDR=${{vars.WORKER_ADDR}}"
echo "BATCH_INTERVAL=${{vars.BATCH_INTERVAL}}"
echo "L2_MAX_BATCH_INTERVAL=${{vars.L2_MAX_BATCH_INTERVAL}}"
echo "ROLLUP_INTERVAL=${{vars.ROLLUP_INTERVAL}}"
- name: 'Login via Azure CLI'
Expand Down Expand Up @@ -177,6 +178,7 @@ jobs:
-host_docker_image=${{vars.L2_HOST_DOCKER_BUILD_TAG}} \
-log_level=${{ github.event.inputs.log_level }} \
-batch_interval=${{vars.BATCH_INTERVAL}} \
-max_batch_interval=${{vars.L2_MAX_BATCH_INTERVAL}} \
-rollup_interval=${{vars.ROLLUP_INTERVAL}} \
-l1_chain_id=${{vars.L1_CHAIN_ID}} \
upgrade'
Expand Down
16 changes: 11 additions & 5 deletions .github/workflows/runner-scripts/testnet-clear-loadbalancer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,18 @@
#
#

if [[ $1 == "testnet" ]]; then
lb=testnet-loadbalancer
pool=Backend-Pool-Obscuro-testnet
if [[ $1 == "uat-testnet" ]]; then
lb=uat-testnet-loadbalancer
pool=uat-testnet-backend-pool
elif [[ $1 == "dev-testnet" ]]; then
lb=dev-testnet-loadbalancer
pool=dev-testnet-backend-pool
elif [[ $1 == "sepolia-testnet" ]]; then
lb=sepolia-testnet-loadbalancer
pool=sepolia-testnet-backend-pool
else
lb=devtestnet-loadbalancer
pool=Backend-Pool-Obscuro-devtestnet
echo "Invalid argument. Use 'uat-testnet', 'dev-testnet', or 'sepolia-testnet'"
exit 1
fi

nic_id=$(az network lb address-pool show \
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/runner-scripts/wait-node-healthy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ help_and_exit() {
echo ""
echo "Usage: "
echo " ex: "
echo " - $(basename "${0}") --host=erpc.testnet.obscu.ro --port=80"
echo " - $(basename "${0}") --host=erpc.uat-testnet.obscu.ro --port=80"
echo ""
echo " node *Required* Set the host address"
echo ""
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -348,14 +348,14 @@ Once started Obscuroscan is available on `http://0.0.0.0:8098`.


### Building and running a local faucet
Deploying and interacting with contracts on Obscuro requires OBX to be allocated to an account via the faucet.
Deploying and interacting with contracts on Obscuro requires ETH to be allocated to an account on the L2 via the faucet (or bridged across from the L1).
The faucet image should be pulled (or optionally built from scratch), and the container built and started to allow requests to be made to it.
To pull the testnet faucet and run use;

```
cd tools/faucet
docker pull testnetobscuronet.azurecr.io/obscuronet/faucet_testnet:latest
./container_run.sh -image testnetobscuronet.azurecr.io/obscuronet/faucet_testnet:latest
docker pull testnetobscuronet.azurecr.io/obscuronet/faucet_sepolia_testnet:latest
./container_run.sh -image testnetobscuronet.azurecr.io/obscuronet/faucet_sepolia_testnet:latest
```

The faucet runs a web server within the container, with a port mapping of 8080 set to allow POST requests to be made to
Expand Down Expand Up @@ -388,7 +388,7 @@ Remix (see[docs/testnet/deploying-a-smart-contract.md](docs/testnet/deploying-a-
e.g. using web3.py(see [docs/testnet/deploying-a-smart-contract-programmatically.md](docs/testnet/deploying-a-smart-contract-programmatically.md)).

Note that in order to interact with the main cloud hosted testnet, all that needs to be changed is to start the wallet
extension using the default parameters, where the `nodeHost` will default to the testnet host URL `erpc.testnet.obscu.ro` i.e.
extension using the default parameters, where the `nodeHost` will default to the testnet host URL `erpc.sepolia-testnet.obscu.ro` i.e.

```
cd ./tools/walletextension/main/
Expand Down
1 change: 0 additions & 1 deletion docs/CNAME

This file was deleted.

Loading

0 comments on commit 7f5de17

Please sign in to comment.