From 412097c8e301c5e2d467aaf44ff4f3713b0d542c Mon Sep 17 00:00:00 2001 From: aboklag Date: Tue, 8 Oct 2024 15:42:24 +0200 Subject: [PATCH] wip --- docker/logs.sh | 5 -- local-network/clbuild.log | 23 ---------- local-network/deploy/local.egg-info/PKG-INFO | 21 --------- .../deploy/local.egg-info/SOURCES.txt | 12 ----- .../local.egg-info/dependency_links.txt | 1 - .../deploy/local.egg-info/requires.txt | 2 - waves-etc/secrets/generate.sh | 27 ----------- waves-etc/secrets/genesis.json | 46 ------------------- waves-etc/secrets/jwt-secret-1.hex | 1 - waves-etc/secrets/jwt-secret-2.hex | 1 - waves-etc/secrets/jwt-secret-3.hex | 1 - waves-etc/secrets/jwt-secret-4.hex | 1 - waves-etc/secrets/jwt-token-generate.sh | 21 --------- waves-etc/secrets/p2p-key-1.hex | 1 - waves-etc/secrets/p2p-key-2.hex | 1 - waves-etc/secrets/p2p-key-3.hex | 1 - waves-etc/secrets/p2p-key-4.hex | 1 - waves-etc/secrets/p2p-key-bootnode.hex | 1 - waves-etc/secrets/peers.env | 1 - 19 files changed, 168 deletions(-) delete mode 100644 docker/logs.sh delete mode 100644 local-network/clbuild.log delete mode 100644 local-network/deploy/local.egg-info/PKG-INFO delete mode 100644 local-network/deploy/local.egg-info/SOURCES.txt delete mode 100644 local-network/deploy/local.egg-info/dependency_links.txt delete mode 100644 local-network/deploy/local.egg-info/requires.txt delete mode 100755 waves-etc/secrets/generate.sh delete mode 100644 waves-etc/secrets/genesis.json delete mode 100644 waves-etc/secrets/jwt-secret-1.hex delete mode 100644 waves-etc/secrets/jwt-secret-2.hex delete mode 100644 waves-etc/secrets/jwt-secret-3.hex delete mode 100644 waves-etc/secrets/jwt-secret-4.hex delete mode 100755 waves-etc/secrets/jwt-token-generate.sh delete mode 100644 waves-etc/secrets/p2p-key-1.hex delete mode 100644 waves-etc/secrets/p2p-key-2.hex delete mode 100644 waves-etc/secrets/p2p-key-3.hex delete mode 100644 waves-etc/secrets/p2p-key-4.hex delete mode 100644 waves-etc/secrets/p2p-key-bootnode.hex delete mode 100644 waves-etc/secrets/peers.env diff --git a/docker/logs.sh b/docker/logs.sh deleted file mode 100644 index 9e3a12ae..00000000 --- a/docker/logs.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh -mkdir -p logs data/besu data/waves -mkdir -p logs/besu logs/waves -sudo chown 1000 logs data/besu data/waves logs/besu logs/waves -sudo chmod 777 logs/waves diff --git a/local-network/clbuild.log b/local-network/clbuild.log deleted file mode 100644 index 2ad534c8..00000000 --- a/local-network/clbuild.log +++ /dev/null @@ -1,23 +0,0 @@ -[info] welcome to sbt 1.10.1 (Oracle Corporation Java 17.0.11) -[info] loading settings for project node-build from plugins.sbt ... -[info] loading project definition from /home/g/node/project -[info] loading settings for project node from build.sbt ... -[info] set current project to consensus-client (in build file:/home/g/node/) -[success] All package validations passed -Making /tmp/sbt_3c883208/consensus-client-1.0.0-78b2e150676cce84e799d53469c55686241833d6-DIRTY/consensus-client-1.0.0-78b2e150676cce84e799d53469c55686241833d6-DIRTY/lib/network.units.consensus-client-1.0.0-78b2e150676cce84e799d53469c55686241833d6-DIRTY.jar executable -Running with tar -pcvf /tmp/sbt_3c883208/consensus-client-1.0.0-78b2e150676cce84e799d53469c55686241833d6-DIRTY.tar consensus-client-1.0.0-78b2e150676cce84e799d53469c55686241833d6-DIRTY -consensus-client-1.0.0-78b2e150676cce84e799d53469c55686241833d6-DIRTY/ -consensus-client-1.0.0-78b2e150676cce84e799d53469c55686241833d6-DIRTY/lib/ -consensus-client-1.0.0-78b2e150676cce84e799d53469c55686241833d6-DIRTY/lib/com.softwaremill.sttp.client3.play-json_2.13-3.9.8.jar -consensus-client-1.0.0-78b2e150676cce84e799d53469c55686241833d6-DIRTY/lib/com.github.jwt-scala.jwt-play-json_2.13-10.0.1.jar -consensus-client-1.0.0-78b2e150676cce84e799d53469c55686241833d6-DIRTY/lib/org.playframework.play-json_2.13-3.0.3.jar -consensus-client-1.0.0-78b2e150676cce84e799d53469c55686241833d6-DIRTY/lib/com.softwaremill.sttp.shared.core_2.13-1.3.16.jar -consensus-client-1.0.0-78b2e150676cce84e799d53469c55686241833d6-DIRTY/lib/com.softwaremill.sttp.shared.ws_2.13-1.3.16.jar -consensus-client-1.0.0-78b2e150676cce84e799d53469c55686241833d6-DIRTY/lib/network.units.consensus-client-1.0.0-78b2e150676cce84e799d53469c55686241833d6-DIRTY.jar -consensus-client-1.0.0-78b2e150676cce84e799d53469c55686241833d6-DIRTY/lib/com.github.jwt-scala.jwt-core_2.13-10.0.1.jar -consensus-client-1.0.0-78b2e150676cce84e799d53469c55686241833d6-DIRTY/lib/com.softwaremill.sttp.model.core_2.13-1.7.9.jar -consensus-client-1.0.0-78b2e150676cce84e799d53469c55686241833d6-DIRTY/lib/com.github.jwt-scala.jwt-json-common_2.13-10.0.1.jar -consensus-client-1.0.0-78b2e150676cce84e799d53469c55686241833d6-DIRTY/lib/com.softwaremill.sttp.client3.core_2.13-3.9.8.jar -consensus-client-1.0.0-78b2e150676cce84e799d53469c55686241833d6-DIRTY/lib/org.playframework.play-functional_2.13-3.0.3.jar -consensus-client-1.0.0-78b2e150676cce84e799d53469c55686241833d6-DIRTY/lib/com.softwaremill.sttp.client3.json-common_2.13-3.9.8.jar -[success] Total time: 1 s, completed Oct 8, 2024, 10:23:51 AM diff --git a/local-network/deploy/local.egg-info/PKG-INFO b/local-network/deploy/local.egg-info/PKG-INFO deleted file mode 100644 index 61a882cf..00000000 --- a/local-network/deploy/local.egg-info/PKG-INFO +++ /dev/null @@ -1,21 +0,0 @@ -Metadata-Version: 2.1 -Name: local -Version: 0.1 -Summary: Scripts and tests for a locally deployed Unit network -License: MIT License -Project-URL: Homepage, https://github.com/UnitsNetwork/consensus-client/tree/main/local-network -Keywords: units network,blockchain,waves -Requires-Python: >=3.12 -Description-Content-Type: text/markdown -Requires-Dist: solc-select -Requires-Dist: units-network@ git+https://github.com/UnitsNetwork/examples.git - -To re-deploy from a container run the following command from the project's root directory (NOT FROM THIS DIRECTORY): -```bash -./deploy-run.sh -``` - -To run tests on the host machine, from this directory: -1. If you're on macOS with Apple Silicon: install `gcc`. -2. Create the virtual environment and install dependencies: `./dev-setup.sh` -3. Run test, e.g.: `./tests/transfer-c2e.py` diff --git a/local-network/deploy/local.egg-info/SOURCES.txt b/local-network/deploy/local.egg-info/SOURCES.txt deleted file mode 100644 index d4ddddd0..00000000 --- a/local-network/deploy/local.egg-info/SOURCES.txt +++ /dev/null @@ -1,12 +0,0 @@ -README.md -pyproject.toml -local/__init__.py -local/common.py -local/network.py -local.egg-info/PKG-INFO -local.egg-info/SOURCES.txt -local.egg-info/dependency_links.txt -local.egg-info/requires.txt -local.egg-info/top_level.txt -tests/transfer-multiple-c2e.py -tests/transfer-multiple-e2c.py \ No newline at end of file diff --git a/local-network/deploy/local.egg-info/dependency_links.txt b/local-network/deploy/local.egg-info/dependency_links.txt deleted file mode 100644 index 8b137891..00000000 --- a/local-network/deploy/local.egg-info/dependency_links.txt +++ /dev/null @@ -1 +0,0 @@ - diff --git a/local-network/deploy/local.egg-info/requires.txt b/local-network/deploy/local.egg-info/requires.txt deleted file mode 100644 index 46839cba..00000000 --- a/local-network/deploy/local.egg-info/requires.txt +++ /dev/null @@ -1,2 +0,0 @@ -solc-select -units-network@ git+https://github.com/UnitsNetwork/examples.git diff --git a/waves-etc/secrets/generate.sh b/waves-etc/secrets/generate.sh deleted file mode 100755 index d5bf0a0d..00000000 --- a/waves-etc/secrets/generate.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env bash - -DIR="$(cd "$(dirname "$0")" && pwd)" -cd "${DIR}" || exit - -for N in {1..4}; do - p2p_file="p2p-key-${N}.hex" - jwt_file="jwt-secret-${N}.hex" - jwt_token_file="jwt-token-${N}.hex" - - # Generate p2p key without newline - if [ ! -f "$p2p_file" ]; then - openssl rand 32 | xxd -p -c 32 | tr -d '\n' > "$p2p_file" - echo "Created $p2p_file" - fi - - # Generate JWT secret without newline - if [ ! -f "$jwt_file" ]; then - openssl rand 32 | xxd -p -c 32 | tr -d '\n' > "$jwt_file" - echo "Created $jwt_file" - fi - - # Generate JWT token - secret=$(cat "$jwt_file") - ./jwt-token-generate.sh "$secret" > "$jwt_token_file" - echo "Generated JWT token in $jwt_token_file" -done diff --git a/waves-etc/secrets/genesis.json b/waves-etc/secrets/genesis.json deleted file mode 100644 index 6e586158..00000000 --- a/waves-etc/secrets/genesis.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "config": { - "chainID": 1337, - "arrowGlacierBlock": 0, - "berlinBlock": 0, - "byzantiumBlock": 0, - "cancunTime": 0, - "constantinopleBlock": 0, - "daoForkBlock": 0, - "eip150Block": 0, - "eip155Block": 0, - "eip158Block": 0, - "ethash": {}, - "grayGlacierBlock": 0, - "homesteadBlock": 0, - "istanbulBlock": 0, - "londonBlock": 0, - "muirGlacierBlock": 0, - "petersburgBlock": 0, - "shanghaiTime": 0, - "terminalTotalDifficulty": 0, - "terminalTotalDifficultyPassed": true - }, - "nonce": "0x42", - "gasLimit": "0x1000000", - "difficulty": "0x0", - "coinbase": "0x0000000000000000000000000000000000000000", - "alloc": { - "0xfe3b557e8fb62b89f4916b721be55ceb828dbd73": { - "privateKey": "0x8f2a55949038a9610f50fb23b5883af3b4ecb3c3bb792cbcefbd1542c692be63", - "//": "private key and this comment are ignored. In a real chain, the private key should NOT be stored", - "balance": "0xad78ebc5ac6200000" - }, - "0xf17f52151EbEF6C7334FAD080c5704D77216b732": { - "privateKey": "0xae6ae8e5ccbfb04590405997ee2d52d2b330726137b875053c36d94e974d162f", - "//": "private key and this comment are ignored. In a real chain, the private key should NOT be stored", - "balance": "90000000000000000000000" - }, - "0x1000000000000000000000000000000000000000": { - "//1": "Bridge contract. To get new code, run: bridge-compile.sh", - "//2": "To update get storage, see the storage layout and setup primitive fields. Or use 0xweb: https://stackoverflow.com/a/76490163", - "code": "0x60806040526004361061006e575f3560e01c806396f396c31161004c57806396f396c3146100e3578063c4a4326d14610105578063e984df0e1461011d578063fccc281314610131575f80fd5b806339dd5d1b146100725780637157405a146100b957806378338413146100ce575b5f80fd5b34801561007d575f80fd5b506100a161008c36600461059e565b5f6020819052908152604090205461ffff1681565b60405161ffff90911681526020015b60405180910390f35b3480156100c4575f80fd5b506100a161040081565b6100e16100dc3660046105b5565b61015c565b005b3480156100ee575f80fd5b506100f761044e565b6040519081526020016100b0565b348015610110575f80fd5b506100f76402540be40081565b348015610128575f80fd5b506100f7610468565b34801561013c575f80fd5b506101445f81565b6040516001600160a01b0390911681526020016100b0565b61016c6402540be40060016105fc565b34101561017834610478565b61019061018b6402540be40060016105fc565b610478565b6040516020016101a1929190610630565b604051602081830303815290604052906101d75760405162461bcd60e51b81526004016101ce9190610688565b60405180910390fd5b506101ef6402540be400677fffffffffffffff6105fc565b3411156101fb34610478565b61021561018b6402540be400677fffffffffffffff6105fc565b6040516020016102269291906106bd565b604051602081830303815290604052906102535760405162461bcd60e51b81526004016101ce9190610688565b50435f8181526020819052604090205461ffff166104009081119061027790610478565b604051602001610287919061070c565b604051602081830303815290604052906102b45760405162461bcd60e51b81526004016101ce9190610688565b505f818152602081905260408120805461ffff16916102d283610786565b91906101000a81548161ffff021916908361ffff160217905550505f6402540be400346102ff91906107a6565b9050346103116402540be400836105fc565b1461031b34610478565b6103296402540be400610478565b60405160200161033a9291906107c5565b604051602081830303815290604052906103675760405162461bcd60e51b81526004016101ce9190610688565b506040515f90819034908281818185825af1925050503d805f81146103a7576040519150601f19603f3d011682016040523d82523d5f602084013e6103ac565b606091505b50509050806103fd5760405162461bcd60e51b815260206004820152601e60248201527f4661696c656420746f2073656e6420746f206275726e2061646472657373000060448201526064016101ce565b604080516bffffffffffffffffffffffff1986168152600784900b60208201527ffeadaf04de8d7c2594453835b9a93b747e20e7a09a7fdb9280579a6dbaf131a8910160405180910390a150505050565b6104656402540be400677fffffffffffffff6105fc565b81565b6104656402540be40060016105fc565b6060815f0361049e5750506040805180820190915260018152600360fc1b602082015290565b815f5b81156104c757806104b181610814565b91506104c09050600a836107a6565b91506104a1565b5f8167ffffffffffffffff8111156104e1576104e161082c565b6040519080825280601f01601f19166020018201604052801561050b576020820181803683370190505b509050815b851561059557610521600182610840565b90505f61052f600a886107a6565b61053a90600a6105fc565b6105449088610840565b61054f906030610853565b90505f8160f81b90508084848151811061056b5761056b61086c565b60200101906001600160f81b03191690815f1a90535061058c600a896107a6565b97505050610510565b50949350505050565b5f602082840312156105ae575f80fd5b5035919050565b5f602082840312156105c5575f80fd5b81356bffffffffffffffffffffffff19811681146105e1575f80fd5b9392505050565b634e487b7160e01b5f52601160045260245ffd5b8082028115828204841417610613576106136105e8565b92915050565b5f81518060208401855e5f93019283525090919050565b6a029b2b73a103b30b63ab2960ad1b81525f61064f600b830185610619565b7f206d7573742062652067726561746572206f7220657175616c20746f20000000815261067f601d820185610619565b95945050505050565b602081525f82518060208401528060208501604085015e5f604082850101526040601f19601f83011684010191505092915050565b6a029b2b73a103b30b63ab2960ad1b81525f6106dc600b830185610619565b7f206d757374206265206c657373206f7220657175616c20746f20000000000000815261067f601a820185610619565b7f4d6178207472616e7366657273206c696d6974206f662000000000000000000081525f61073d6017830184610619565b7f207265616368656420696e207468697320626c6f636b2e2054727920746f207381527232b732103a3930b739b332b9399030b3b0b4b760691b60208201526033019392505050565b5f61ffff821661ffff810361079d5761079d6105e8565b60010192915050565b5f826107c057634e487b7160e01b5f52601260045260245ffd5b500490565b6a029b2b73a103b30b63ab2960ad1b81525f6107e4600b830185610619565b7f206d7573742062652061206d756c7469706c65206f6620000000000000000000815261067f6017820185610619565b5f60018201610825576108256105e8565b5060010190565b634e487b7160e01b5f52604160045260245ffd5b81810381811115610613576106136105e8565b60ff8181168382160190811115610613576106136105e8565b634e487b7160e01b5f52603260045260245ffdfea2646970667358221220106399f534da089226c14e2f183f8421d059a924c65c97d7e4f3e931c54fe1bb64736f6c634300081a0033", - "balance": "0x0" - } - } -} diff --git a/waves-etc/secrets/jwt-secret-1.hex b/waves-etc/secrets/jwt-secret-1.hex deleted file mode 100644 index 402a3f1e..00000000 --- a/waves-etc/secrets/jwt-secret-1.hex +++ /dev/null @@ -1 +0,0 @@ -ed292c1b8df420f0fed62f9e83e3ca176b88e5723218b83d9e1b36df375e4ac4 \ No newline at end of file diff --git a/waves-etc/secrets/jwt-secret-2.hex b/waves-etc/secrets/jwt-secret-2.hex deleted file mode 100644 index 0a747833..00000000 --- a/waves-etc/secrets/jwt-secret-2.hex +++ /dev/null @@ -1 +0,0 @@ -a59c7150d727e228fceabfc4497c21d6acbdd083e0063dadcb20e2be661cefb2 \ No newline at end of file diff --git a/waves-etc/secrets/jwt-secret-3.hex b/waves-etc/secrets/jwt-secret-3.hex deleted file mode 100644 index baa373af..00000000 --- a/waves-etc/secrets/jwt-secret-3.hex +++ /dev/null @@ -1 +0,0 @@ -2703dcfc67b9a772756c4d354e2943fd7e3d8a2cb95b2129faa497b09662780d \ No newline at end of file diff --git a/waves-etc/secrets/jwt-secret-4.hex b/waves-etc/secrets/jwt-secret-4.hex deleted file mode 100644 index f6799e31..00000000 --- a/waves-etc/secrets/jwt-secret-4.hex +++ /dev/null @@ -1 +0,0 @@ -e6cba16eb245df8f057f5a3690ce57ed29f39b30d04a07e7de34d1b3b01c4d7e diff --git a/waves-etc/secrets/jwt-token-generate.sh b/waves-etc/secrets/jwt-token-generate.sh deleted file mode 100755 index 86cfdd84..00000000 --- a/waves-etc/secrets/jwt-token-generate.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env bash - -if [ -z "$1" ]; then - echo "Usage: $0 " - exit 1 -fi - -hexsecret=$(echo -n "$1" | tr -d '\n') - -base64_url_encode() { - echo -n "$1" | base64 | sed s/\+/-/g | sed 's/\//_/g' | sed -E s/=+$// -} - -jwt_header=$(base64_url_encode '{"alg":"HS256","typ":"JWT"}') - -iat=$(date +%s) # Seconds since 1970-01-01 -payload=$(base64_url_encode "{\"iat\":${iat}}") - -hmac_signature=$(echo -n "${jwt_header}.${payload}" | openssl dgst -sha256 -mac HMAC -macopt hexkey:"${hexsecret}" -binary | base64_url_encode) - -echo -n "${jwt_header}.${payload}.${hmac_signature}" diff --git a/waves-etc/secrets/p2p-key-1.hex b/waves-etc/secrets/p2p-key-1.hex deleted file mode 100644 index 0ba0c55e..00000000 --- a/waves-etc/secrets/p2p-key-1.hex +++ /dev/null @@ -1 +0,0 @@ -c69c6f46a2bf7024c3805bb38b2e96d2bbacd065a4951d1bd2d2d5957838eb65 \ No newline at end of file diff --git a/waves-etc/secrets/p2p-key-2.hex b/waves-etc/secrets/p2p-key-2.hex deleted file mode 100644 index 231d0f0e..00000000 --- a/waves-etc/secrets/p2p-key-2.hex +++ /dev/null @@ -1 +0,0 @@ -93ce9a6ca2750272f118afef441fa0d9943f543118a7a51fe6104e651a88207c \ No newline at end of file diff --git a/waves-etc/secrets/p2p-key-3.hex b/waves-etc/secrets/p2p-key-3.hex deleted file mode 100644 index fbd82756..00000000 --- a/waves-etc/secrets/p2p-key-3.hex +++ /dev/null @@ -1 +0,0 @@ -244bb704084d2a49b4fc2da3b27a1c1c76329d7cac6fbadfd8c1a615730d6f77 \ No newline at end of file diff --git a/waves-etc/secrets/p2p-key-4.hex b/waves-etc/secrets/p2p-key-4.hex deleted file mode 100644 index cd8c6af5..00000000 --- a/waves-etc/secrets/p2p-key-4.hex +++ /dev/null @@ -1 +0,0 @@ -7c2d9d0bb13ac806701462ab2e1bbcc54eb7b5e8f6658610a6e06dcc30e0aa47 \ No newline at end of file diff --git a/waves-etc/secrets/p2p-key-bootnode.hex b/waves-etc/secrets/p2p-key-bootnode.hex deleted file mode 100644 index cf2d9f0e..00000000 --- a/waves-etc/secrets/p2p-key-bootnode.hex +++ /dev/null @@ -1 +0,0 @@ -dc51ae50601364b0d9354bad516acd16261447f89bde416399fa4ae5f2cbe8ab \ No newline at end of file diff --git a/waves-etc/secrets/peers.env b/waves-etc/secrets/peers.env deleted file mode 100644 index 110bdc04..00000000 --- a/waves-etc/secrets/peers.env +++ /dev/null @@ -1 +0,0 @@ -BESU_BOOTNODES=enode://b2ce9caff5e7472eafaf006904e2cb39cdd79801cda1328c510118cafdb0e9574526af6d05a89dae07a376606227c54c724cab1e88edf43190b7544976b275b8@ec-1:30303,enode://4e355eebfd77e5c2c0c20328c2bd5f3fde033c58e06e758c3e0a4ad88e8ced176f0d5eb32e214461b73e014591587f7c6567ee373e9c389b872a6d97d74a913c@ec-2:30303