diff --git a/build.sbt b/build.sbt deleted file mode 100644 index e8f12f33..00000000 --- a/build.sbt +++ /dev/null @@ -1,83 +0,0 @@ -Global / onChangedBuildSource := ReloadOnSourceChanges - -enablePlugins(UniversalDeployPlugin, GitVersioning) - -git.useGitDescribe := true -git.baseVersion := "1.0.0" -git.uncommittedSignifier := Some("DIRTY") - -scalaVersion := "2.13.15" -organization := "network.units" -organizationName := "Units Network" -name := "consensus-client" -maintainer := "Units Network Team" -resolvers ++= Resolver.sonatypeOssRepos("releases") ++ Resolver.sonatypeOssRepos("snapshots") ++ Seq(Resolver.mavenLocal) -libraryDependencies ++= Seq( - "com.wavesplatform" % "node-testkit" % "1.5.8" % "test", - "com.wavesplatform" % "node" % "1.5.8" % "provided", - "com.softwaremill.sttp.client3" % "core_2.13" % "3.10.1", - "com.softwaremill.sttp.client3" %% "play-json" % "3.10.1", - "com.github.jwt-scala" %% "jwt-play-json" % "10.0.1" -) - -scalacOptions ++= Seq( - "-Xsource:3", - "-feature", - "-deprecation", - "-unchecked", - "-language:higherKinds", - "-language:implicitConversions", - "-language:postfixOps", - "-Ywarn-unused:-implicits", - "-Xlint" -) - -Compile / packageDoc / publishArtifact := false - -def makeJarName( - org: String, - name: String, - revision: String, - artifactName: String, - artifactClassifier: Option[String] -): String = - org + "." + - name + "-" + - Option(artifactName.replace(name, "")).filterNot(_.isEmpty).map(_ + "-").getOrElse("") + - revision + - artifactClassifier.filterNot(_.isEmpty).map("-" + _).getOrElse("") + - ".jar" - -def getJarFullFilename(dep: Attributed[File]): String = { - val filename: Option[String] = for { - module <- dep.metadata.get(AttributeKey[ModuleID]("moduleID")) - artifact <- dep.metadata.get(AttributeKey[Artifact]("artifact")) - } yield makeJarName(module.organization, module.name, module.revision, artifact.name, artifact.classifier) - filename.getOrElse(dep.data.getName) -} - -def universalDepMappings(deps: Seq[Attributed[File]]): Seq[(File, String)] = - for { - dep <- deps - } yield dep.data -> ("lib/" + getJarFullFilename(dep)) - -Universal / mappings += { - val jar = (Compile / packageBin).value - val id = projectID.value - val art = (Compile / packageBin / artifact).value - jar -> ("lib/" + makeJarName(id.organization, id.name, id.revision, art.name, art.classifier)) -} -Universal / mappings ++= universalDepMappings((Runtime / dependencyClasspath).value.filterNot { p => - p.get(AttributeKey[ModuleID]("moduleID")).exists { m => - m.organization == "org.scala-lang" || - m.organization.startsWith("com.fasterxml.jackson") - } -}) - -lazy val buildTarballsForDocker = taskKey[Unit]("Package consensus-client tarball and copy it to docker/target") -buildTarballsForDocker := { - IO.copyFile( - (Universal / packageZipTarball).value, - baseDirectory.value / "docker" / "target" / "consensus-client.tgz" - ) -} diff --git a/project/build.properties b/project/build.properties deleted file mode 100644 index ee4c672c..00000000 --- a/project/build.properties +++ /dev/null @@ -1 +0,0 @@ -sbt.version=1.10.1 diff --git a/project/plugins.sbt b/project/plugins.sbt deleted file mode 100644 index fb7e7d99..00000000 --- a/project/plugins.sbt +++ /dev/null @@ -1,7 +0,0 @@ -resolvers ++= Seq( - Resolver.typesafeRepo("releases"), - Resolver.sbtPluginRepo("releases") -) - -addSbtPlugin("com.github.sbt" % "sbt-native-packager" % "1.10.0") -addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.12") diff --git a/waves-etc/secrets/.gitignore b/waves-etc/secrets/.gitignore deleted file mode 100644 index e69de29b..00000000 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