diff --git a/.cicd/defaults.json b/.cicd/defaults.json index 258ba4e..ea2c077 100644 --- a/.cicd/defaults.json +++ b/.cicd/defaults.json @@ -14,5 +14,8 @@ "eos-evm-contract":{ "target":"main", "prerelease":false + }, + "eos-evm-miner":{ + "target":"main" } } diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index 4233aec..ea9f89c 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -48,6 +48,9 @@ on: - default - true - false + override-eos-evm-miner: + description: 'Override eos-evm-miner target' + type: string defaults: run: @@ -158,6 +161,7 @@ jobs: cdt-prerelease: ${{steps.versions.outputs.cdt-prerelease}} eos-evm-contract-target: ${{steps.versions.outputs.eos-evm-contract-target}} eos-evm-contract-prerelease: ${{steps.versions.outputs.eos-evm-contract-prerelease}} + eos-evm-miner-target: ${{steps.versions.outputs.eos-evm-miner-target}} steps: - name: Setup versions from input or defaults id: versions @@ -173,6 +177,7 @@ jobs: echo cdt-prerelease=$(echo "$DEFAULTS_JSON" | jq -r '."cdt".prerelease') >> $GITHUB_OUTPUT echo eos-evm-contract-target=$(echo "$DEFAULTS_JSON" | jq -r '."eos-evm-contract".target') >> $GITHUB_OUTPUT echo eos-evm-contract-prerelease=$(echo "$DEFAULTS_JSON" | jq -r '."eos-evm-contract".prerelease') >> $GITHUB_OUTPUT + echo eos-evm-miner-target=$(echo "$DEFAULTS_JSON" | jq -r '."eos-evm-miner".target') >> $GITHUB_OUTPUT if [[ "${{inputs.override-leap-dev}}" != "" ]]; then echo leap-dev-target=${{inputs.override-leap-dev}} >> $GITHUB_OUTPUT @@ -198,6 +203,9 @@ jobs: if [[ "${{inputs.override-eos-evm-contract-prerelease}}" == +(true|false) ]]; then echo eos-evm-contract-prerelease=${{inputs.override-eos-evm-contract-prerelease}} >> $GITHUB_OUTPUT fi + if [[ "${{inputs.override-eos-evm-miner}}" != "" ]]; then + echo eos-evm-miner-target=${{inputs.override-eos-evm-miner}} >> $GITHUB_OUTPUT + fi integration-test: name: EOS EVM Integration Tests @@ -291,6 +299,13 @@ jobs: app_id: ${{ secrets.TRUSTEVM_CI_APP_ID }} private_key: ${{ secrets.TRUSTEVM_CI_APP_KEY }} + - name: Checkout eos-evm-miner + uses: actions/checkout@v3 + with: + repository: eosnetworkfoundation/eos-evm-miner + path: eos-evm-miner + ref: '${{needs.versions.outputs.eos-evm-miner-target}}' + - name: Download EOS EVM Node builddir uses: actions/download-artifact@v3 with: @@ -316,15 +331,21 @@ jobs: cp -r node-v18.17.0-linux-x64/{bin,include,lib,share} /usr/ node --version npm --version - pushd ${{ steps.evm-node-build.outputs.EVM_NODE_BUILD }}/peripherals/tx_wrapper + + - name: Build eos-evm-miner + id: eos-evm-miner-build + run: | + pushd eos-evm-miner + echo "EVM_MINER_ROOT=$(pwd)" >> "$GITHUB_OUTPUT" npm install + npm run build popd - name: Test Leap Integration run: | mkdir test_run_root cd test_run_root - ${{ steps.evm-node-build.outputs.EVM_NODE_BUILD }}/tests/nodeos_eos_evm_test.py -v --eos-evm-contract-root ${{ steps.evm-contract.outputs.EVM_CONTRACT }} --eos-evm-build-root ${{ steps.evm-node-build.outputs.EVM_NODE_BUILD }} --use-tx-wrapper ${{ steps.evm-node-build.outputs.EVM_NODE_BUILD }}/peripherals/tx_wrapper + ${{ steps.evm-node-build.outputs.EVM_NODE_BUILD }}/tests/nodeos_eos_evm_test.py -v --eos-evm-contract-root ${{ steps.evm-contract.outputs.EVM_CONTRACT }} --eos-evm-build-root ${{ steps.evm-node-build.outputs.EVM_NODE_BUILD }} --use-miner ${{ steps.eos-evm-miner-build.outputs.EVM_MINER_ROOT }} - name: Prepare Logs if: failure() diff --git a/.gitignore b/.gitignore index 85064e4..4b85c44 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,6 @@ build tests/nodeos_eos_evm_server/artifacts tests/nodeos_eos_evm_server/cache tests/nodeos_eos_evm_server/node_modules + +*.pyc +*.pyo \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 640a82e..98cf870 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,5 +32,4 @@ endif() add_subdirectory(external) add_subdirectory(version) add_subdirectory(src) -add_subdirectory(peripherals) add_subdirectory(tests) diff --git a/README.md b/README.md index a993a69..63d4b5b 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ Clients can also push Ethereum compatible transactions (aka EVM transactions) to ``` | | WRITE +-----------------+ - | +------------------------->| TX-Wrapper | + | +------------------------->| EOS EVM MINER | | | +-------v---------+ | | | Leap node | ---> connect to the other nodes in the blockchain network client | | +-------+---------+ diff --git a/peripherals/CMakeLists.txt b/peripherals/CMakeLists.txt deleted file mode 100644 index f5e2e2f..0000000 --- a/peripherals/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_subdirectory( tx_wrapper ) diff --git a/peripherals/tx_wrapper/.gitignore b/peripherals/tx_wrapper/.gitignore deleted file mode 100644 index 6704566..0000000 --- a/peripherals/tx_wrapper/.gitignore +++ /dev/null @@ -1,104 +0,0 @@ -# Logs -logs -*.log -npm-debug.log* -yarn-debug.log* -yarn-error.log* -lerna-debug.log* - -# Diagnostic reports (https://nodejs.org/api/report.html) -report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json - -# Runtime data -pids -*.pid -*.seed -*.pid.lock - -# Directory for instrumented libs generated by jscoverage/JSCover -lib-cov - -# Coverage directory used by tools like istanbul -coverage -*.lcov - -# nyc test coverage -.nyc_output - -# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) -.grunt - -# Bower dependency directory (https://bower.io/) -bower_components - -# node-waf configuration -.lock-wscript - -# Compiled binary addons (https://nodejs.org/api/addons.html) -build/Release - -# Dependency directories -node_modules/ -jspm_packages/ - -# TypeScript v1 declaration files -typings/ - -# TypeScript cache -*.tsbuildinfo - -# Optional npm cache directory -.npm - -# Optional eslint cache -.eslintcache - -# Microbundle cache -.rpt2_cache/ -.rts2_cache_cjs/ -.rts2_cache_es/ -.rts2_cache_umd/ - -# Optional REPL history -.node_repl_history - -# Output of 'npm pack' -*.tgz - -# Yarn Integrity file -.yarn-integrity - -# dotenv environment variables file -.env -.env.test - -# parcel-bundler cache (https://parceljs.org/) -.cache - -# Next.js build output -.next - -# Nuxt.js build / generate output -.nuxt -dist - -# Gatsby files -.cache/ -# Comment in the public line in if your project uses Gatsby and *not* Next.js -# https://nextjs.org/blog/next-9-1#public-directory-support -# public - -# vuepress build output -.vuepress/dist - -# Serverless directories -.serverless/ - -# FuseBox cache -.fusebox/ - -# DynamoDB Local files -.dynamodb/ - -# TernJS port file -.tern-port diff --git a/peripherals/tx_wrapper/CMakeLists.txt b/peripherals/tx_wrapper/CMakeLists.txt deleted file mode 100644 index 76b1597..0000000 --- a/peripherals/tx_wrapper/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -configure_file( index.js . COPYONLY ) -configure_file( package-lock.json . COPYONLY ) -configure_file( package.json . COPYONLY ) -configure_file( yarn.lock . COPYONLY ) diff --git a/peripherals/tx_wrapper/README.md b/peripherals/tx_wrapper/README.md deleted file mode 100644 index 5ba7609..0000000 --- a/peripherals/tx_wrapper/README.md +++ /dev/null @@ -1,26 +0,0 @@ -# evm_poc_tx_wrapper - -## Build -``` -yarn -``` - -## Run -Create a .env file: -``` -# This is sample keys. Do NOT Commit .env! - -# one or more EOS_RPC endpoints, separated by '|' -EOS_RPC="http://127.0.0.1:8888|http://192.168.1.1:8888" -EOS_KEY="5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3" - -# the listening IP & port of this service -HOST="127.0.0.1" -PORT="3335" -EOS_PERMISSION="active" -EXPIRE_SEC=60 -``` -Then -``` -node index.js -``` diff --git a/peripherals/tx_wrapper/index.js b/peripherals/tx_wrapper/index.js deleted file mode 100644 index e628a58..0000000 --- a/peripherals/tx_wrapper/index.js +++ /dev/null @@ -1,206 +0,0 @@ -import { config } from 'dotenv'; -config() - -import { Api, JsonRpc, RpcError } from "eosjs"; -import { JsSignatureProvider } from "eosjs/dist/eosjs-jssig.js"; // development only -const fetch = (...args) => import('node-fetch').then(({default: fetch}) => fetch(...args)); -import { TextEncoder, TextDecoder } from "util"; // node only; native TextEncoder/Decoder - -import RpcServer from "http-jsonrpc-server"; -import isValidHostname from 'is-valid-hostname'; - -import { keccak256 } from 'ethereumjs-util'; - -// Local helpers -function validateNum(input, min, max) { - var num = +input; - return num >= min && num <= max && input === num.toString(); -} - -if (!process.env.EOS_KEY) { - console.log("Missing EOS_KEY in .env file!"); - process.exit(); -} - -if (!process.env.EOS_SENDER) { - console.log("Missing EOS_SENDER in .env file!"); - process.exit(); -} - -if (!process.env.EOS_PERMISSION) { - console.log("Missing EOS_PERMISSION in .env file!"); - process.exit(); -} - -if (!process.env.EOS_RPC) { - console.log("Missing EOS_RPC in .env file!"); - process.exit(); -} - -if (!process.env.EOS_EVM_ACCOUNT) { - console.log("Missing EOS_EVM_ACCOUNT in .env file!"); - process.exit(); -} - -// Note: the check is based on RFC-1123, some strange name such as 127.0.0.1abc can actually pass the test. -if (!process.env.HOST || !isValidHostname(process.env.HOST)) { - console.log("Missing or invalid HOST in .env file!"); - process.exit(); -} - -if (!process.env.PORT || !validateNum(process.env.PORT, 1, 65535)) { - console.log("Missing or invalid PORT in .env file!"); - process.exit(); -} - -let expire_sec = 300; -if (!process.env.EXPIRE_SEC) { - console.log("Missing EXPIRE_SEC, default to " + expire_sec); -} else { - expire_sec = +process.env.EXPIRE_SEC; -} - -// Setting up EOS -let rpc_list = process.env.EOS_RPC.split("|"); -console.log("number of RPC endpoints = " + rpc_list.length + ", using " + rpc_list[0]); -let rpc_index = 0; - -let rpc = new JsonRpc(rpc_list[rpc_index], { fetch }); -const defaultPrivateKey = process.env.EOS_KEY; -const signatureProvider = new JsSignatureProvider([defaultPrivateKey]); - -let api = new Api({ - rpc, - signatureProvider, - textDecoder: new TextDecoder(), - textEncoder: new TextEncoder(), -}); - -function next_rpc_endpoint() { - rpc_index = (rpc_index + 1) % rpc_list.length; - console.log("changing RPC endpoint to " + rpc_list[rpc_index]); - rpc = new JsonRpc(rpc_list[rpc_index], { fetch }); - api = new Api({ - rpc, - signatureProvider, - textDecoder: new TextDecoder(), - textEncoder: new TextEncoder(), - }); -} - -// EOS Helpers -var pushcount=0; -async function push_tx(strRlptx) { - id=pushcount; - pushcount = pushcount + 1; - console.log("----rlptx(" + id + ")-----"); - console.log(strRlptx); - t0 = Date.now(); - const result = await api.transact( - { - actions: [ - { - account: process.env.EOS_EVM_ACCOUNT, - name: "pushtx", - authorization: [{ - actor : process.env.EOS_SENDER, - permission : process.env.EOS_PERMISSION, - } - ], - data: { - miner : process.env.EOS_SENDER, - rlptx : strRlptx - }, - }, - ], - }, - { - blocksBehind: 3, - expireSeconds: +expire_sec, - } - ); - const latency = Date.now() - t0; - console.log("----response(" + id + ", " + latency + "ms) ----"); - console.log(result); - return result; -} - -// RPC Handlers -async function eth_sendRawTransaction(params) { - const rlptx = params[0].substr(2); - await push_tx(rlptx); - return '0x'+keccak256(Buffer.from(rlptx, "hex")).toString("hex"); -} - -var lastGetTableCallTime = 0 -var gasPrice = "0x1"; -async function eth_gasPrice(params) { - if ( (new Date() - lastGetTableCallTime) >= 1000 ) { - try { - const result = await rpc.get_table_rows({ - json: true, // Get the response as json - code: process.env.EOS_EVM_ACCOUNT, // Contract that we target - scope: process.env.EOS_EVM_ACCOUNT, // Account that owns the data - table: 'config', // Table name - limit: 1, // Maximum number of rows that we want to get - reverse: false, // Optional: Get reversed data - show_payer: false // Optional: Show ram payer - }); - console.log("result:", result.rows[0].gas_price); - gasPrice = "0x" + parseInt(result.rows[0].gas_price).toString(16); - lastGetTableCallTime = new Date(); - } catch(e) { - console.log("Error getting gas price from nodeos: " + e); - next_rpc_endpoint(); - } - } - return gasPrice; -} - -function zero_pad(hexstr) { - if(!hexstr) return ""; - const res = hexstr.substr(2); - return res.length % 2 ? '0'+res : res; -} - -// Setting up the RPC server -const rpcServer = new RpcServer({ - path: "/", - methods: { - eth_sendRawTransaction, - }, - onRequest: (request) => { - console.debug(JSON.stringify(request)); - }, - onRequestError: (err, id) => { - console.error("request " + id + " threw an error: " + err); - }, - onServerError: (err) => { - console.error("the server threw an error: " + err); - }, -}); - -rpcServer.setMethod("eth_sendRawTransaction", eth_sendRawTransaction); -rpcServer.setMethod("eth_gasPrice", eth_gasPrice); - -process.on('SIGTERM', function onSigterm () { - console.info('Got SIGTERM. Graceful shutdown start', new Date().toISOString()) - shutdown(); -}) - -function shutdown() { - rpcServer.close(function onServerClosed (err) { - if (err) { - console.error(err) - } - process.exit() - }) -} - -// Main loop -rpcServer.listen(+process.env.PORT, process.env.HOST).then(() => { - console.log( - "server is listening at " + process.env.HOST + ":" + process.env.PORT - ); -}); - diff --git a/peripherals/tx_wrapper/package-lock.json b/peripherals/tx_wrapper/package-lock.json deleted file mode 100644 index de027e1..0000000 --- a/peripherals/tx_wrapper/package-lock.json +++ /dev/null @@ -1,493 +0,0 @@ -{ - "name": "evm_poc_tx_wrapper", - "version": "1.0.0", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "name": "evm_poc_tx_wrapper", - "version": "1.0.0", - "license": "MIT", - "dependencies": { - "dotenv": "^16.0.0", - "eosjs": "^22.1.0", - "ethereumjs-util": "^7.1.4", - "http-jsonrpc-server": "^1.1.0", - "is-valid-hostname": "^1.0.2", - "node-fetch": "^2.6.6" - } - }, - "node_modules/@types/bn.js": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-5.1.1.tgz", - "integrity": "sha512-qNrYbZqMx0uJAfKnKclPh+dTwK33KfLHYqtyODwd5HnXOjnkhc4qgn3BrK6RWyGZm5+sIFE7Q7Vz6QQtJB7w7g==", - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/@types/node": { - "version": "20.4.6", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.4.6.tgz", - "integrity": "sha512-q0RkvNgMweWWIvSMDiXhflGUKMdIxBo2M2tYM/0kEGDueQByFzK4KZAgu5YHGFNxziTlppNpTIBcqHQAxlfHdA==" - }, - "node_modules/@types/pbkdf2": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@types/pbkdf2/-/pbkdf2-3.1.0.tgz", - "integrity": "sha512-Cf63Rv7jCQ0LaL8tNXmEyqTHuIJxRdlS5vMh1mj5voN4+QFhVZnlZruezqpWYDiJ8UTzhP0VmeLXCmBk66YrMQ==", - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/@types/secp256k1": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/@types/secp256k1/-/secp256k1-4.0.3.tgz", - "integrity": "sha512-Da66lEIFeIz9ltsdMZcpQvmrmmoqrfju8pm1BH8WbYjZSwUgCwXLb9C+9XYogwBITnbsSaMdVPb2ekf7TV+03w==", - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/base-x": { - "version": "3.0.9", - "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.9.tgz", - "integrity": "sha512-H7JU6iBHTal1gp56aKoaa//YUxEaAOUiydvrV/pILqIHXTtqxSkATOnDA2u+jZ/61sD+L/412+7kzXRtWukhpQ==", - "dependencies": { - "safe-buffer": "^5.0.1" - } - }, - "node_modules/blakejs": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/blakejs/-/blakejs-1.2.1.tgz", - "integrity": "sha512-QXUSXI3QVc/gJME0dBpXrag1kbzOqCjCX8/b54ntNyW6sjtoqxqRk3LTmXzaJoh71zMsDCjM+47jS7XiwN/+fQ==" - }, - "node_modules/bn.js": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz", - "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==" - }, - "node_modules/brorand": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", - "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=" - }, - "node_modules/browserify-aes": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", - "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", - "dependencies": { - "buffer-xor": "^1.0.3", - "cipher-base": "^1.0.0", - "create-hash": "^1.1.0", - "evp_bytestokey": "^1.0.3", - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "node_modules/bs58": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", - "integrity": "sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw==", - "dependencies": { - "base-x": "^3.0.2" - } - }, - "node_modules/bs58check": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/bs58check/-/bs58check-2.1.2.tgz", - "integrity": "sha512-0TS1jicxdU09dwJMNZtVAfzPi6Q6QeN0pM1Fkzrjn+XYHvzMKPU3pHVpva+769iNVSfIYWf7LJ6WR+BuuMf8cA==", - "dependencies": { - "bs58": "^4.0.0", - "create-hash": "^1.1.0", - "safe-buffer": "^5.1.2" - } - }, - "node_modules/buffer-xor": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", - "integrity": "sha512-571s0T7nZWK6vB67HI5dyUF7wXiNcfaPPPTl6zYCNApANjIvYJTg7hlud/+cJpdAhS7dVzqMLmfhfHR3rAcOjQ==" - }, - "node_modules/cipher-base": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", - "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", - "dependencies": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "node_modules/create-hash": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", - "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", - "dependencies": { - "cipher-base": "^1.0.1", - "inherits": "^2.0.1", - "md5.js": "^1.3.4", - "ripemd160": "^2.0.1", - "sha.js": "^2.4.0" - } - }, - "node_modules/create-hmac": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", - "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", - "dependencies": { - "cipher-base": "^1.0.3", - "create-hash": "^1.1.0", - "inherits": "^2.0.1", - "ripemd160": "^2.0.0", - "safe-buffer": "^5.0.1", - "sha.js": "^2.4.8" - } - }, - "node_modules/dotenv": { - "version": "16.0.0", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.0.0.tgz", - "integrity": "sha512-qD9WU0MPM4SWLPJy/r2Be+2WgQj8plChsyrCNQzW/0WjvcJQiKQJ9mH3ZgB3fxbUUxgc/11ZJ0Fi5KiimWGz2Q==", - "engines": { - "node": ">=12" - } - }, - "node_modules/elliptic": { - "version": "6.5.4", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", - "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", - "dependencies": { - "bn.js": "^4.11.9", - "brorand": "^1.1.0", - "hash.js": "^1.0.0", - "hmac-drbg": "^1.0.1", - "inherits": "^2.0.4", - "minimalistic-assert": "^1.0.1", - "minimalistic-crypto-utils": "^1.0.1" - } - }, - "node_modules/elliptic/node_modules/bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" - }, - "node_modules/eosjs": { - "version": "22.1.0", - "resolved": "https://registry.npmjs.org/eosjs/-/eosjs-22.1.0.tgz", - "integrity": "sha512-Ka8KO7akC3RxNdSg/3dkGWuUWUQESTzSUzQljBdVP16UG548vmQoBqSGnZdnjlZyfcab8VOu2iEt+JjyfYc5+A==", - "dependencies": { - "bn.js": "5.2.0", - "elliptic": "6.5.4", - "hash.js": "1.1.7", - "pako": "2.0.3" - } - }, - "node_modules/ethereum-cryptography": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz", - "integrity": "sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==", - "dependencies": { - "@types/pbkdf2": "^3.0.0", - "@types/secp256k1": "^4.0.1", - "blakejs": "^1.1.0", - "browserify-aes": "^1.2.0", - "bs58check": "^2.1.2", - "create-hash": "^1.2.0", - "create-hmac": "^1.1.7", - "hash.js": "^1.1.7", - "keccak": "^3.0.0", - "pbkdf2": "^3.0.17", - "randombytes": "^2.1.0", - "safe-buffer": "^5.1.2", - "scrypt-js": "^3.0.0", - "secp256k1": "^4.0.1", - "setimmediate": "^1.0.5" - } - }, - "node_modules/ethereumjs-util": { - "version": "7.1.5", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-7.1.5.tgz", - "integrity": "sha512-SDl5kKrQAudFBUe5OJM9Ac6WmMyYmXX/6sTmLZ3ffG2eY6ZIGBes3pEDxNN6V72WyOw4CPD5RomKdsa8DAAwLg==", - "dependencies": { - "@types/bn.js": "^5.1.0", - "bn.js": "^5.1.2", - "create-hash": "^1.1.2", - "ethereum-cryptography": "^0.1.3", - "rlp": "^2.2.4" - }, - "engines": { - "node": ">=10.0.0" - } - }, - "node_modules/evp_bytestokey": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", - "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", - "dependencies": { - "md5.js": "^1.3.4", - "safe-buffer": "^5.1.1" - } - }, - "node_modules/hash-base": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", - "integrity": "sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==", - "dependencies": { - "inherits": "^2.0.4", - "readable-stream": "^3.6.0", - "safe-buffer": "^5.2.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/hash.js": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", - "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", - "dependencies": { - "inherits": "^2.0.3", - "minimalistic-assert": "^1.0.1" - } - }, - "node_modules/hmac-drbg": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", - "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", - "dependencies": { - "hash.js": "^1.0.3", - "minimalistic-assert": "^1.0.0", - "minimalistic-crypto-utils": "^1.0.1" - } - }, - "node_modules/http-jsonrpc-server": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/http-jsonrpc-server/-/http-jsonrpc-server-1.1.0.tgz", - "integrity": "sha512-qtiJEG59Q0w1lCmUXWrTb+MPv7xcS7YsanT7OeVmqyxuMGe/wyr2j1euikeBDHgDB6Pbcu99F2l6XhHlRYNuow==", - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" - }, - "node_modules/is-valid-hostname": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-valid-hostname/-/is-valid-hostname-1.0.2.tgz", - "integrity": "sha512-X/kiF3Xndj6WI7l/yLyzR7V1IbQd6L4S4cewSL0fRciemPmHbaXIKR2qtf+zseH+lbMG0vFp4HvCUe7amGZVhw==" - }, - "node_modules/keccak": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/keccak/-/keccak-3.0.3.tgz", - "integrity": "sha512-JZrLIAJWuZxKbCilMpNz5Vj7Vtb4scDG3dMXLOsbzBmQGyjwE61BbW7bJkfKKCShXiQZt3T6sBgALRtmd+nZaQ==", - "hasInstallScript": true, - "dependencies": { - "node-addon-api": "^2.0.0", - "node-gyp-build": "^4.2.0", - "readable-stream": "^3.6.0" - }, - "engines": { - "node": ">=10.0.0" - } - }, - "node_modules/md5.js": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", - "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", - "dependencies": { - "hash-base": "^3.0.0", - "inherits": "^2.0.1", - "safe-buffer": "^5.1.2" - } - }, - "node_modules/minimalistic-assert": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", - "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==" - }, - "node_modules/minimalistic-crypto-utils": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", - "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=" - }, - "node_modules/node-addon-api": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-2.0.2.tgz", - "integrity": "sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA==" - }, - "node_modules/node-fetch": { - "version": "2.6.7", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", - "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", - "dependencies": { - "whatwg-url": "^5.0.0" - }, - "engines": { - "node": "4.x || >=6.0.0" - }, - "peerDependencies": { - "encoding": "^0.1.0" - }, - "peerDependenciesMeta": { - "encoding": { - "optional": true - } - } - }, - "node_modules/node-gyp-build": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.6.0.tgz", - "integrity": "sha512-NTZVKn9IylLwUzaKjkas1e4u2DLNcV4rdYagA4PWdPwW87Bi7z+BznyKSRwS/761tV/lzCGXplWsiaMjLqP2zQ==", - "bin": { - "node-gyp-build": "bin.js", - "node-gyp-build-optional": "optional.js", - "node-gyp-build-test": "build-test.js" - } - }, - "node_modules/pako": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/pako/-/pako-2.0.3.tgz", - "integrity": "sha512-WjR1hOeg+kki3ZIOjaf4b5WVcay1jaliKSYiEaB1XzwhMQZJxRdQRv0V31EKBYlxb4T7SK3hjfc/jxyU64BoSw==" - }, - "node_modules/pbkdf2": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.2.tgz", - "integrity": "sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA==", - "dependencies": { - "create-hash": "^1.1.2", - "create-hmac": "^1.1.4", - "ripemd160": "^2.0.1", - "safe-buffer": "^5.0.1", - "sha.js": "^2.4.8" - }, - "engines": { - "node": ">=0.12" - } - }, - "node_modules/randombytes": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", - "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", - "dependencies": { - "safe-buffer": "^5.1.0" - } - }, - "node_modules/readable-stream": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", - "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/ripemd160": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", - "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", - "dependencies": { - "hash-base": "^3.0.0", - "inherits": "^2.0.1" - } - }, - "node_modules/rlp": { - "version": "2.2.7", - "resolved": "https://registry.npmjs.org/rlp/-/rlp-2.2.7.tgz", - "integrity": "sha512-d5gdPmgQ0Z+AklL2NVXr/IoSjNZFfTVvQWzL/AM2AOcSzYP2xjlb0AC8YyCLc41MSNf6P6QVtjgPdmVtzb+4lQ==", - "dependencies": { - "bn.js": "^5.2.0" - }, - "bin": { - "rlp": "bin/rlp" - } - }, - "node_modules/safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/scrypt-js": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-3.0.1.tgz", - "integrity": "sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA==" - }, - "node_modules/secp256k1": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-4.0.3.tgz", - "integrity": "sha512-NLZVf+ROMxwtEj3Xa562qgv2BK5e2WNmXPiOdVIPLgs6lyTzMvBq0aWTYMI5XCP9jZMVKOcqZLw/Wc4vDkuxhA==", - "hasInstallScript": true, - "dependencies": { - "elliptic": "^6.5.4", - "node-addon-api": "^2.0.0", - "node-gyp-build": "^4.2.0" - }, - "engines": { - "node": ">=10.0.0" - } - }, - "node_modules/setimmediate": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", - "integrity": "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==" - }, - "node_modules/sha.js": { - "version": "2.4.11", - "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", - "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", - "dependencies": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - }, - "bin": { - "sha.js": "bin.js" - } - }, - "node_modules/string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dependencies": { - "safe-buffer": "~5.2.0" - } - }, - "node_modules/tr46": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=" - }, - "node_modules/util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" - }, - "node_modules/webidl-conversions": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=" - }, - "node_modules/whatwg-url": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=", - "dependencies": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" - } - } - } -} diff --git a/peripherals/tx_wrapper/package.json b/peripherals/tx_wrapper/package.json deleted file mode 100644 index 3ff8804..0000000 --- a/peripherals/tx_wrapper/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "name": "evm_poc_tx_wrapper", - "type": "module", - "version": "1.0.0", - "main": "index.js", - "repository": "https://github.com/yarkinwho/evm_poc_tx_wrapper", - "author": "yarkin", - "license": "MIT", - "dependencies": { - "dotenv": "^16.0.0", - "eosjs": "^22.1.0", - "ethereumjs-util": "^7.1.4", - "http-jsonrpc-server": "^1.1.0", - "is-valid-hostname": "^1.0.2", - "node-fetch": "^2.6.6" - } -} diff --git a/peripherals/tx_wrapper/yarn.lock b/peripherals/tx_wrapper/yarn.lock deleted file mode 100644 index 95b281a..0000000 --- a/peripherals/tx_wrapper/yarn.lock +++ /dev/null @@ -1,383 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@types/bn.js@^5.1.0": - version "5.1.1" - resolved "https://registry.npmjs.org/@types/bn.js/-/bn.js-5.1.1.tgz" - integrity sha512-qNrYbZqMx0uJAfKnKclPh+dTwK33KfLHYqtyODwd5HnXOjnkhc4qgn3BrK6RWyGZm5+sIFE7Q7Vz6QQtJB7w7g== - dependencies: - "@types/node" "*" - -"@types/node@*": - version "20.4.6" - resolved "https://registry.npmjs.org/@types/node/-/node-20.4.6.tgz" - integrity sha512-q0RkvNgMweWWIvSMDiXhflGUKMdIxBo2M2tYM/0kEGDueQByFzK4KZAgu5YHGFNxziTlppNpTIBcqHQAxlfHdA== - -"@types/pbkdf2@^3.0.0": - version "3.1.0" - resolved "https://registry.npmjs.org/@types/pbkdf2/-/pbkdf2-3.1.0.tgz" - integrity sha512-Cf63Rv7jCQ0LaL8tNXmEyqTHuIJxRdlS5vMh1mj5voN4+QFhVZnlZruezqpWYDiJ8UTzhP0VmeLXCmBk66YrMQ== - dependencies: - "@types/node" "*" - -"@types/secp256k1@^4.0.1": - version "4.0.3" - resolved "https://registry.npmjs.org/@types/secp256k1/-/secp256k1-4.0.3.tgz" - integrity sha512-Da66lEIFeIz9ltsdMZcpQvmrmmoqrfju8pm1BH8WbYjZSwUgCwXLb9C+9XYogwBITnbsSaMdVPb2ekf7TV+03w== - dependencies: - "@types/node" "*" - -base-x@^3.0.2: - version "3.0.9" - resolved "https://registry.npmjs.org/base-x/-/base-x-3.0.9.tgz" - integrity sha512-H7JU6iBHTal1gp56aKoaa//YUxEaAOUiydvrV/pILqIHXTtqxSkATOnDA2u+jZ/61sD+L/412+7kzXRtWukhpQ== - dependencies: - safe-buffer "^5.0.1" - -blakejs@^1.1.0: - version "1.2.1" - resolved "https://registry.npmjs.org/blakejs/-/blakejs-1.2.1.tgz" - integrity sha512-QXUSXI3QVc/gJME0dBpXrag1kbzOqCjCX8/b54ntNyW6sjtoqxqRk3LTmXzaJoh71zMsDCjM+47jS7XiwN/+fQ== - -bn.js@^4.11.9: - version "4.12.0" - resolved "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz" - integrity sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA== - -bn.js@^5.1.2, bn.js@^5.2.0, bn.js@5.2.0: - version "5.2.0" - resolved "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz" - integrity sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw== - -brorand@^1.1.0: - version "1.1.0" - resolved "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz" - integrity sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8= - -browserify-aes@^1.2.0: - version "1.2.0" - resolved "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz" - integrity sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA== - dependencies: - buffer-xor "^1.0.3" - cipher-base "^1.0.0" - create-hash "^1.1.0" - evp_bytestokey "^1.0.3" - inherits "^2.0.1" - safe-buffer "^5.0.1" - -bs58@^4.0.0: - version "4.0.1" - resolved "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz" - integrity sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw== - dependencies: - base-x "^3.0.2" - -bs58check@^2.1.2: - version "2.1.2" - resolved "https://registry.npmjs.org/bs58check/-/bs58check-2.1.2.tgz" - integrity sha512-0TS1jicxdU09dwJMNZtVAfzPi6Q6QeN0pM1Fkzrjn+XYHvzMKPU3pHVpva+769iNVSfIYWf7LJ6WR+BuuMf8cA== - dependencies: - bs58 "^4.0.0" - create-hash "^1.1.0" - safe-buffer "^5.1.2" - -buffer-xor@^1.0.3: - version "1.0.3" - resolved "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz" - integrity sha512-571s0T7nZWK6vB67HI5dyUF7wXiNcfaPPPTl6zYCNApANjIvYJTg7hlud/+cJpdAhS7dVzqMLmfhfHR3rAcOjQ== - -cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: - version "1.0.4" - resolved "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz" - integrity sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q== - dependencies: - inherits "^2.0.1" - safe-buffer "^5.0.1" - -create-hash@^1.1.0, create-hash@^1.1.2, create-hash@^1.2.0: - version "1.2.0" - resolved "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz" - integrity sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg== - dependencies: - cipher-base "^1.0.1" - inherits "^2.0.1" - md5.js "^1.3.4" - ripemd160 "^2.0.1" - sha.js "^2.4.0" - -create-hmac@^1.1.4, create-hmac@^1.1.7: - version "1.1.7" - resolved "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz" - integrity sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg== - dependencies: - cipher-base "^1.0.3" - create-hash "^1.1.0" - inherits "^2.0.1" - ripemd160 "^2.0.0" - safe-buffer "^5.0.1" - sha.js "^2.4.8" - -dotenv@^16.0.0: - version "16.0.0" - resolved "https://registry.npmjs.org/dotenv/-/dotenv-16.0.0.tgz" - integrity sha512-qD9WU0MPM4SWLPJy/r2Be+2WgQj8plChsyrCNQzW/0WjvcJQiKQJ9mH3ZgB3fxbUUxgc/11ZJ0Fi5KiimWGz2Q== - -elliptic@^6.5.4, elliptic@6.5.4: - version "6.5.4" - resolved "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz" - integrity sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ== - dependencies: - bn.js "^4.11.9" - brorand "^1.1.0" - hash.js "^1.0.0" - hmac-drbg "^1.0.1" - inherits "^2.0.4" - minimalistic-assert "^1.0.1" - minimalistic-crypto-utils "^1.0.1" - -eosjs@^22.1.0: - version "22.1.0" - resolved "https://registry.npmjs.org/eosjs/-/eosjs-22.1.0.tgz" - integrity sha512-Ka8KO7akC3RxNdSg/3dkGWuUWUQESTzSUzQljBdVP16UG548vmQoBqSGnZdnjlZyfcab8VOu2iEt+JjyfYc5+A== - dependencies: - bn.js "5.2.0" - elliptic "6.5.4" - hash.js "1.1.7" - pako "2.0.3" - -ethereum-cryptography@^0.1.3: - version "0.1.3" - resolved "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz" - integrity sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ== - dependencies: - "@types/pbkdf2" "^3.0.0" - "@types/secp256k1" "^4.0.1" - blakejs "^1.1.0" - browserify-aes "^1.2.0" - bs58check "^2.1.2" - create-hash "^1.2.0" - create-hmac "^1.1.7" - hash.js "^1.1.7" - keccak "^3.0.0" - pbkdf2 "^3.0.17" - randombytes "^2.1.0" - safe-buffer "^5.1.2" - scrypt-js "^3.0.0" - secp256k1 "^4.0.1" - setimmediate "^1.0.5" - -ethereumjs-util@^7.1.4: - version "7.1.5" - resolved "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-7.1.5.tgz" - integrity sha512-SDl5kKrQAudFBUe5OJM9Ac6WmMyYmXX/6sTmLZ3ffG2eY6ZIGBes3pEDxNN6V72WyOw4CPD5RomKdsa8DAAwLg== - dependencies: - "@types/bn.js" "^5.1.0" - bn.js "^5.1.2" - create-hash "^1.1.2" - ethereum-cryptography "^0.1.3" - rlp "^2.2.4" - -evp_bytestokey@^1.0.3: - version "1.0.3" - resolved "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz" - integrity sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA== - dependencies: - md5.js "^1.3.4" - safe-buffer "^5.1.1" - -hash-base@^3.0.0: - version "3.1.0" - resolved "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz" - integrity sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA== - dependencies: - inherits "^2.0.4" - readable-stream "^3.6.0" - safe-buffer "^5.2.0" - -hash.js@^1.0.0, hash.js@^1.0.3, hash.js@^1.1.7, hash.js@1.1.7: - version "1.1.7" - resolved "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz" - integrity sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA== - dependencies: - inherits "^2.0.3" - minimalistic-assert "^1.0.1" - -hmac-drbg@^1.0.1: - version "1.0.1" - resolved "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz" - integrity sha1-0nRXAQJabHdabFRXk+1QL8DGSaE= - dependencies: - hash.js "^1.0.3" - minimalistic-assert "^1.0.0" - minimalistic-crypto-utils "^1.0.1" - -http-jsonrpc-server@^1.1.0: - version "1.1.0" - resolved "https://registry.npmjs.org/http-jsonrpc-server/-/http-jsonrpc-server-1.1.0.tgz" - integrity sha512-qtiJEG59Q0w1lCmUXWrTb+MPv7xcS7YsanT7OeVmqyxuMGe/wyr2j1euikeBDHgDB6Pbcu99F2l6XhHlRYNuow== - -inherits@^2.0.1, inherits@^2.0.3, inherits@^2.0.4: - version "2.0.4" - resolved "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz" - integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== - -is-valid-hostname@^1.0.2: - version "1.0.2" - resolved "https://registry.npmjs.org/is-valid-hostname/-/is-valid-hostname-1.0.2.tgz" - integrity sha512-X/kiF3Xndj6WI7l/yLyzR7V1IbQd6L4S4cewSL0fRciemPmHbaXIKR2qtf+zseH+lbMG0vFp4HvCUe7amGZVhw== - -keccak@^3.0.0: - version "3.0.3" - resolved "https://registry.npmjs.org/keccak/-/keccak-3.0.3.tgz" - integrity sha512-JZrLIAJWuZxKbCilMpNz5Vj7Vtb4scDG3dMXLOsbzBmQGyjwE61BbW7bJkfKKCShXiQZt3T6sBgALRtmd+nZaQ== - dependencies: - node-addon-api "^2.0.0" - node-gyp-build "^4.2.0" - readable-stream "^3.6.0" - -md5.js@^1.3.4: - version "1.3.5" - resolved "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz" - integrity sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg== - dependencies: - hash-base "^3.0.0" - inherits "^2.0.1" - safe-buffer "^5.1.2" - -minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1: - version "1.0.1" - resolved "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz" - integrity sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A== - -minimalistic-crypto-utils@^1.0.1: - version "1.0.1" - resolved "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz" - integrity sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo= - -node-addon-api@^2.0.0: - version "2.0.2" - resolved "https://registry.npmjs.org/node-addon-api/-/node-addon-api-2.0.2.tgz" - integrity sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA== - -node-fetch@^2.6.6: - version "2.6.7" - resolved "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz" - integrity sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ== - dependencies: - whatwg-url "^5.0.0" - -node-gyp-build@^4.2.0: - version "4.6.0" - resolved "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.6.0.tgz" - integrity sha512-NTZVKn9IylLwUzaKjkas1e4u2DLNcV4rdYagA4PWdPwW87Bi7z+BznyKSRwS/761tV/lzCGXplWsiaMjLqP2zQ== - -pako@2.0.3: - version "2.0.3" - resolved "https://registry.npmjs.org/pako/-/pako-2.0.3.tgz" - integrity sha512-WjR1hOeg+kki3ZIOjaf4b5WVcay1jaliKSYiEaB1XzwhMQZJxRdQRv0V31EKBYlxb4T7SK3hjfc/jxyU64BoSw== - -pbkdf2@^3.0.17: - version "3.1.2" - resolved "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.2.tgz" - integrity sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA== - dependencies: - create-hash "^1.1.2" - create-hmac "^1.1.4" - ripemd160 "^2.0.1" - safe-buffer "^5.0.1" - sha.js "^2.4.8" - -randombytes@^2.1.0: - version "2.1.0" - resolved "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz" - integrity sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ== - dependencies: - safe-buffer "^5.1.0" - -readable-stream@^3.6.0: - version "3.6.2" - resolved "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz" - integrity sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA== - dependencies: - inherits "^2.0.3" - string_decoder "^1.1.1" - util-deprecate "^1.0.1" - -ripemd160@^2.0.0, ripemd160@^2.0.1: - version "2.0.2" - resolved "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz" - integrity sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA== - dependencies: - hash-base "^3.0.0" - inherits "^2.0.1" - -rlp@^2.2.4: - version "2.2.7" - resolved "https://registry.npmjs.org/rlp/-/rlp-2.2.7.tgz" - integrity sha512-d5gdPmgQ0Z+AklL2NVXr/IoSjNZFfTVvQWzL/AM2AOcSzYP2xjlb0AC8YyCLc41MSNf6P6QVtjgPdmVtzb+4lQ== - dependencies: - bn.js "^5.2.0" - -safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@^5.2.0, safe-buffer@~5.2.0: - version "5.2.1" - resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz" - integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== - -scrypt-js@^3.0.0: - version "3.0.1" - resolved "https://registry.npmjs.org/scrypt-js/-/scrypt-js-3.0.1.tgz" - integrity sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA== - -secp256k1@^4.0.1: - version "4.0.3" - resolved "https://registry.npmjs.org/secp256k1/-/secp256k1-4.0.3.tgz" - integrity sha512-NLZVf+ROMxwtEj3Xa562qgv2BK5e2WNmXPiOdVIPLgs6lyTzMvBq0aWTYMI5XCP9jZMVKOcqZLw/Wc4vDkuxhA== - dependencies: - elliptic "^6.5.4" - node-addon-api "^2.0.0" - node-gyp-build "^4.2.0" - -setimmediate@^1.0.5: - version "1.0.5" - resolved "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz" - integrity sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA== - -sha.js@^2.4.0, sha.js@^2.4.8: - version "2.4.11" - resolved "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz" - integrity sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ== - dependencies: - inherits "^2.0.1" - safe-buffer "^5.0.1" - -string_decoder@^1.1.1: - version "1.3.0" - resolved "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz" - integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== - dependencies: - safe-buffer "~5.2.0" - -tr46@~0.0.3: - version "0.0.3" - resolved "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz" - integrity sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o= - -util-deprecate@^1.0.1: - version "1.0.2" - resolved "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz" - integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw== - -webidl-conversions@^3.0.0: - version "3.0.1" - resolved "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz" - integrity sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE= - -whatwg-url@^5.0.0: - version "5.0.0" - resolved "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz" - integrity sha1-lmRU6HZUYuN2RNNib2dCzotwll0= - dependencies: - tr46 "~0.0.3" - webidl-conversions "^3.0.0" diff --git a/tests/nodeos_eos_evm_test.py b/tests/nodeos_eos_evm_test.py index fc099f8..123e4c9 100755 --- a/tests/nodeos_eos_evm_test.py +++ b/tests/nodeos_eos_evm_test.py @@ -3,10 +3,12 @@ import random import os import json -import time -import sys -import signal import shutil +import shlex +import signal +import subprocess +import sys +import time import calendar from datetime import datetime from ctypes import c_uint8 @@ -40,27 +42,17 @@ # Need to install: # web3 - pip install web3 # -# --use-tx-wrapper path_to_tx_wrapper -# if specified then uses tx_wrapper to get gas price. -# Requires tx_wrapper dependencies installed: nodejs, eosjs, ethereumjs-util -# sudo apt install nodejs -# sudo apt install npm -# npm install eosjs -# npm install ethereumjs-util -# npm install node-fetch -# npm install http-jsonrpc-server -# npm install dotenv -# npm install is-valid-hostname +# --use-miner path to eos-evm-miner. if specified then uses eos-evm-miner to get gas price. # --eos-evm-build-root should point to the root of EOS EVM build dir # --eos-evm-contract-root should point to root of EOS EVM contract build dir # # Example (Running with leap src build): # cd ~/leap/build -# ~/eos-evm-node/build/tests/nodeos_eos_evm_test.py --eos-evm-contract-root ~/eos-evm/build --eos-evm-build-root ~/eos-evm-node/build --use-tx-wrapper ~/eos-evm-node/build/peripherals/tx_wrapper --leave-running +# ~/eos-evm-node/build/tests/nodeos_eos_evm_test.py --eos-evm-contract-root ~/eos-evm/build --eos-evm-build-root ~/eos-evm-node/build --use-miner ~/eos-evm-miner --leave-running # # Example (Running with leap dev-install): # ln -s /usr/share/leap_testing/tests/TestHarness /usr/lib/python3/dist-packages/TestHarness -# ~/eos-evm-node/build/tests/nodeos_eos_evm_test.py --eos-evm-contract-root ~/eos-evm/build --eos-evm-build-root ~/eos-evm-node/build --use-tx-wrapper ~/eos-evm-node/build/peripherals/tx_wrapper --leave-running +# ~/eos-evm-node/build/tests/nodeos_eos_evm_test.py --eos-evm-contract-root ~/eos-evm/build --eos-evm-build-root ~/eos-evm-node/build --use-miner ~/eos-evm-miner --leave-running # # Launches wallet at port: 9899 # Example: bin/cleos --wallet-url http://127.0.0.1:9899 ... @@ -74,7 +66,7 @@ appArgs.add(flag="--eos-evm-contract-root", type=str, help="EOS EVM contract build dir", default=None) appArgs.add(flag="--eos-evm-build-root", type=str, help="EOS EVM build dir", default=None) appArgs.add(flag="--genesis-json", type=str, help="File to save generated genesis json", default="eos-evm-genesis.json") -appArgs.add(flag="--use-tx-wrapper", type=str, help="tx_wrapper to use to send trx to nodeos", default=None) +appArgs.add(flag="--use-miner", type=str, help="EOS EVM miner to use to send trx to nodeos", default=None) args=TestHelper.parse_args({"--keep-logs","--dump-error-details","-v","--leave-running","--clean-run" }, applicationSpecificArgs=appArgs) debug=args.v @@ -85,7 +77,7 @@ eosEvmContractRoot=args.eos_evm_contract_root eosEvmBuildRoot=args.eos_evm_build_root genesisJson=args.genesis_json -useTrxWrapper=args.use_tx_wrapper +useMiner=args.use_miner assert eosEvmContractRoot is not None, "--eos-evm-contract-root is required" assert eosEvmBuildRoot is not None, "--eos-evm-build-root is required" @@ -103,6 +95,7 @@ total_nodes=pnodes + 2 evmNodePOpen = None evmRPCPOpen = None +eosEvmMinerPOpen = None def interact_with_storage_contract(dest, nonce): for i in range(1, 5): # execute a few @@ -130,19 +123,23 @@ def interact_with_storage_contract(dest, nonce): return nonce -def writeTxWrapperEnv(): - with open(".env", 'w') as envFile: - env = \ -f''' -EOS_RPC="http://127.0.0.1:8888" -EOS_KEY="{txWrapAcc.activePrivateKey}" -HOST="127.0.0.1" -PORT="18888" -EOS_EVM_ACCOUNT="evmevmevmevm" -EOS_SENDER="{txWrapAcc.name}" -EOS_PERMISSION="active" -''' - envFile.write(env) +def setEosEvmMinerEnv(): + os.environ["PRIVATE_KEY"]=f"{minerAcc.activePrivateKey}" + os.environ["MINER_ACCOUNT"]=f"{minerAcc.name}" + os.environ["RPC_ENDPOINTS"]="http://127.0.0.1:8888" + os.environ["PORT"]="18888" + os.environ["LOCK_GAS_PRICE"]="true" + os.environ["MINER_PERMISSION"]="active" + os.environ["EXPIRE_SEC"]="60" + + Utils.Print(f"Set up configuration of eos-evm-miner via environment variables.") + Utils.Print(f"PRIVATE_KEY: {os.environ.get('PRIVATE_KEY')}") + Utils.Print(f"MINER_ACCOUNT: {os.environ.get('MINER_ACCOUNT')}") + Utils.Print(f"RPC_ENDPOINTS: {os.environ.get('RPC_ENDPOINTS')}") + Utils.Print(f"PORT: {os.environ.get('PORT')}") + Utils.Print(f"LOCK_GAS_PRICE: {os.environ.get('LOCK_GAS_PRICE')}") + Utils.Print(f"MINER_PERMISSION: {os.environ.get('MINER_PERMISSION')}") + Utils.Print(f"EXPIRE_SEC: {os.environ.get('EXPIRE_SEC')}") def processUrllibRequest(endpoint, payload={}, silentErrors=False, exitOnError=False, exitMsg=None, returnType=ReturnType.json): cmd = f"{endpoint}" @@ -204,7 +201,7 @@ def processUrllibRequest(endpoint, payload={}, silentErrors=False, exitOnError=F return rtn def getGasPrice(): - if useTrxWrapper is None: + if useMiner is None: return 1 else: result = processUrllibRequest("http://127.0.0.1:18888", payload={"method":"eth_gasPrice","params":[],"id":1,"jsonrpc":"2.0"}) @@ -278,10 +275,9 @@ def makeReservedEvmAddress(account): Utils.errorExit("FAILURE - create keys") evmAcc = accounts[0] - evmAcc.name = "evmevmevmevm" + evmAcc.name = "eosio.evm" testAcc = accounts[1] - txWrapAcc = accounts[2] - minerAcc = txWrapAcc + minerAcc = accounts[2] testWalletName="test" @@ -315,10 +311,10 @@ def makeReservedEvmAddress(account): prodNode.publishContract(evmAcc, contractDir, wasmFile, abiFile, waitForTransBlock=True) # add eosio.code permission - cmd="set account permission evmevmevmevm active --add-code -p evmevmevmevm@active" + cmd="set account permission eosio.evm active --add-code -p eosio.evm@active" prodNode.processCleosCmd(cmd, cmd, silentErrors=True, returnType=ReturnType.raw) - trans = prodNode.pushMessage(evmAcc.name, "init", '{{"chainid":15555, "fee_params": {{"gas_price": "10000000000", "miner_cut": 100000, "ingress_bridge_fee": "0.0000 {0}"}}}}'.format(CORE_SYMBOL), '-p evmevmevmevm') + trans = prodNode.pushMessage(evmAcc.name, "init", '{{"chainid":15555, "fee_params": {{"gas_price": "10000000000", "miner_cut": 100000, "ingress_bridge_fee": "0.0000 {0}"}}}}'.format(CORE_SYMBOL), '-p eosio.evm') prodNode.waitForTransBlockIfNeeded(trans[1], True) transId=prodNode.getTransId(trans[1]) blockNum = prodNode.getBlockNumByTransId(transId) @@ -359,21 +355,22 @@ def makeReservedEvmAddress(account): trans=prodNode.pushMessage(evmAcc.name, "open", '[{0}]'.format(minerAcc.name), '-p {0}'.format(minerAcc.name)) # - # Setup tx_wrapper + # Setup eos-evm-miner # - txWrapPOpen = None - if useTrxWrapper is not None: - writeTxWrapperEnv() - dataDir = Utils.DataDir + "tx_wrap" - outDir = dataDir + "/tx_wrapper.stdout" - errDir = dataDir + "/tx_wrapper.stderr" + if useMiner is not None: + setEosEvmMinerEnv() + dataDir = Utils.DataDir + "eos-evm-miner" + outDir = dataDir + "/eos-evm-miner.stdout" + errDir = dataDir + "/eos-evm-miner.stderr" shutil.rmtree(dataDir, ignore_errors=True) os.makedirs(dataDir) outFile = open(outDir, "w") errFile = open(errDir, "w") - cmd = "node %s/index.js" % (useTrxWrapper) + cmd = "node dist/index.js" Utils.Print("Launching: %s" % cmd) - txWrapPOpen=Utils.delayedCheckOutput(cmd, stdout=outFile, stderr=errFile) + cmdArr=shlex.split(cmd) + eosEvmMinerPOpen=subprocess.Popen(cmdArr, stdout=outFile, stderr=errFile, cwd=useMiner) + time.sleep(10) # let miner start up Utils.Print("Transfer initial balances") @@ -495,7 +492,7 @@ def makeReservedEvmAddress(account): Utils.Print("Generated EVM json genesis file in: %s" % genesisJson) Utils.Print("") Utils.Print("You can now run:") - Utils.Print(" eos-evm-node --plugin=blockchain_plugin --ship-endpoint=127.0.0.1:8999 --genesis-json=%s --chain-data=/tmp/data --verbosity=5" % genesisJson) + Utils.Print(" eos-evm-node --plugin=blockchain_plugin --ship-core-account=eosio.evm --ship-endpoint=127.0.0.1:8999 --genesis-json=%s --chain-data=/tmp/data --verbosity=5" % genesisJson) Utils.Print(" eos-evm-rpc --eos-evm-node=127.0.0.1:8080 --http-port=0.0.0.0:8881 --chaindata=/tmp/data --api-spec=eth,debug,net,trace") Utils.Print("") @@ -662,9 +659,10 @@ def makeReservedEvmAddress(account): os.makedirs(dataDir) outFile = open(nodeStdOutDir, "w") errFile = open(nodeStdErrDir, "w") - cmd = f"{eosEvmBuildRoot}/bin/eos-evm-node --plugin=blockchain_plugin --ship-endpoint=127.0.0.1:8999 --genesis-json={genesisJson} --verbosity=5 --nocolor=1 --chain-data={dataDir}" + cmd = f"{eosEvmBuildRoot}/bin/eos-evm-node --plugin=blockchain_plugin --ship-core-account=eosio.evm --ship-endpoint=127.0.0.1:8999 --genesis-json={genesisJson} --verbosity=5 --nocolor=1 --chain-data={dataDir}" Utils.Print(f"Launching: {cmd}") - evmNodePOpen=Utils.delayedCheckOutput(cmd, stdout=outFile, stderr=errFile) + cmdArr=shlex.split(cmd) + evmNodePOpen=Utils.delayedCheckOutput(cmdArr, stdout=outFile, stderr=errFile) time.sleep(10) # allow time to sync trxs @@ -675,13 +673,14 @@ def makeReservedEvmAddress(account): errFile = open(rpcStdErrDir, "w") cmd = f"{eosEvmBuildRoot}/bin/eos-evm-rpc --eos-evm-node=127.0.0.1:8080 --http-port=0.0.0.0:8881 --chaindata={dataDir} --api-spec=eth,debug,net,trace" Utils.Print(f"Launching: {cmd}") - evmRPCPOpen=Utils.delayedCheckOutput(cmd, stdout=outFile, stderr=errFile) + cmdArr=shlex.split(cmd) + evmRPCPOpen=Utils.delayedCheckOutput(cmdArr, stdout=outFile, stderr=errFile) # Validate all balances are the same on both sides rows=prodNode.getTable(evmAcc.name, evmAcc.name, "account") for row in rows['rows']: Utils.Print("Checking 0x{0} balance".format(row['eth_address'])) - r = 0 + r = -1 try: r = w3.eth.get_balance(Web3.to_checksum_address('0x'+row['eth_address'])) except: @@ -712,8 +711,8 @@ def makeReservedEvmAddress(account): evmNodePOpen.kill() if evmRPCPOpen is not None: evmRPCPOpen.kill() - if txWrapPOpen is not None: - txWrapPOpen.kill() + if eosEvmMinerPOpen is not None: + eosEvmMinerPOpen.kill() exitCode = 0 if testSuccessful else 1 exit(exitCode)