From 051ef3fd2ab401d31190548b8a6b5c8822cfc2f5 Mon Sep 17 00:00:00 2001 From: 0xmuralik Date: Thu, 13 Oct 2022 11:23:17 +0530 Subject: [PATCH] ethermintd->laconicd --- app/app.go | 4 ++-- contrib/scripts/test_localnet_liveness.sh | 2 +- default.nix | 6 ++--- init.bat | 22 +++++++++---------- networks/local/Makefile | 2 +- networks/local/ethermintnode/Dockerfile | 4 ++-- nix/scripts.nix | 2 +- starport.yml | 4 ++-- .../configs/broken-ethermintd.nix | 6 ++--- .../integration_tests/configs/default.jsonnet | 2 +- .../configs/upgrade-test-package.nix | 4 ++-- tests/integration_tests/network.py | 2 +- tests/integration_tests/shell.nix | 2 +- tests/integration_tests/test_rollback.py | 6 ++--- tests/integration_tests/test_upgrade.py | 6 ++--- tests/rpc/rpc_pending_test.go | 2 +- tests/rpc/rpc_test.go | 4 ++-- tests/solidity/README.md | 12 +++++----- tests/solidity/test-helper.js | 16 +++++++------- x/bond/README.md | 2 +- x/nameservice/README.md | 2 +- 21 files changed, 56 insertions(+), 56 deletions(-) diff --git a/app/app.go b/app/app.go index 6035db86..14957358 100644 --- a/app/app.go +++ b/app/app.go @@ -132,10 +132,10 @@ func init() { panic(err) } - DefaultNodeHome = filepath.Join(userHomeDir, ".ethermintd") + DefaultNodeHome = filepath.Join(userHomeDir, ".laconicd") } -const appName = "ethermintd" +const appName = "laconicd" var ( // DefaultNodeHome default home directories for the application daemon diff --git a/contrib/scripts/test_localnet_liveness.sh b/contrib/scripts/test_localnet_liveness.sh index 13541a8a..236984f4 100755 --- a/contrib/scripts/test_localnet_liveness.sh +++ b/contrib/scripts/test_localnet_liveness.sh @@ -30,7 +30,7 @@ if [ -z "$4" ]; then exit 1 fi -docker_containers=($(docker ps -q -f name=ethermintd --format='{{.Names}}')) +docker_containers=($(docker ps -q -f name=laconicd --format='{{.Names}}')) while [ ${CNT} -lt $ITER ]; do curr_block=$(curl -s $NODEADDR:26657/status | jq -r '.result.sync_info.latest_block_height') diff --git a/default.nix b/default.nix index c319aeaf..5c28b324 100644 --- a/default.nix +++ b/default.nix @@ -4,7 +4,7 @@ }: let version = "v0.17.1"; - pname = "ethermintd"; + pname = "laconicd"; tags = [ "netgo" ]; ldflags = lib.concatStringsSep "\n" ([ "-X github.com/cosmos/cosmos-sdk/version.Name=ethermint" @@ -23,13 +23,13 @@ buildGoApplication rec { modules = ./gomod2nix.toml; doCheck = false; pwd = src; # needed to support replace - subPackages = [ "cmd/ethermintd" ]; + subPackages = [ "cmd/laconicd" ]; CGO_ENABLED = "1"; meta = with lib; { description = "Ethermint is a scalable and interoperable Ethereum library, built on Proof-of-Stake with fast-finality using the Cosmos SDK which runs on top of Tendermint Core consensus engine."; homepage = "https://github.com/evmos/ethermint"; license = licenses.asl20; - mainProgram = "ethermintd"; + mainProgram = "laconicd"; }; } diff --git a/init.bat b/init.bat index 54244d0e..002405a5 100644 --- a/init.bat +++ b/init.bat @@ -17,26 +17,26 @@ set LOGLEVEL="info" rem to trace evm rem TRACE="--trace" set TRACE="" -set HOME=%USERPROFILE%\.ethermintd +set HOME=%USERPROFILE%\.laconicd echo %HOME% set ETHCONFIG=%HOME%\config\config.toml set GENESIS=%HOME%\config\genesis.json set TMPGENESIS=%HOME%\config\tmp_genesis.json @echo build binary -go build .\cmd\ethermintd +go build .\cmd\laconicd @echo clear home folder del /s /q %HOME% -ethermintd config keyring-backend %KEYRING% -ethermintd config chain-id %CHAINID% +laconicd config keyring-backend %KEYRING% +laconicd config chain-id %CHAINID% -ethermintd keys add %KEY% --keyring-backend %KEYRING% --algo %KEYALGO% +laconicd keys add %KEY% --keyring-backend %KEYRING% --algo %KEYALGO% rem Set moniker and chain-id for Ethermint (Moniker can be anything, chain-id must be an integer) -ethermintd init %MONIKER% --chain-id %CHAINID% +laconicd init %MONIKER% --chain-id %CHAINID% rem Change parameter token denominations to aphoton cat %GENESIS% | jq ".app_state[\"staking\"][\"params\"][\"bond_denom\"]=\"aphoton\"" > %TMPGENESIS% && move %TMPGENESIS% %GENESIS% @@ -54,18 +54,18 @@ rem setup sed -i "s/create_empty_blocks = true/create_empty_blocks = false/g" %ETHCONFIG% rem Allocate genesis accounts (cosmos formatted addresses) -ethermintd add-genesis-account %KEY% 100000000000000000000000000aphoton --keyring-backend %KEYRING% +laconicd add-genesis-account %KEY% 100000000000000000000000000aphoton --keyring-backend %KEYRING% rem Sign genesis transaction -ethermintd gentx %KEY% 1000000000000000000000aphoton --keyring-backend %KEYRING% --chain-id %CHAINID% +laconicd gentx %KEY% 1000000000000000000000aphoton --keyring-backend %KEYRING% --chain-id %CHAINID% rem Collect genesis tx -ethermintd collect-gentxs +laconicd collect-gentxs rem Run this to ensure everything worked and that the genesis file is setup correctly -ethermintd validate-genesis +laconicd validate-genesis rem Start the node (remove the --pruning=nothing flag if historical queries are not needed) -ethermintd start --pruning=nothing %TRACE% --log_level %LOGLEVEL% --minimum-gas-prices=0.0001aphoton \ No newline at end of file +laconicd start --pruning=nothing %TRACE% --log_level %LOGLEVEL% --minimum-gas-prices=0.0001aphoton \ No newline at end of file diff --git a/networks/local/Makefile b/networks/local/Makefile index 1ddf1fdc..be20fd9e 100644 --- a/networks/local/Makefile +++ b/networks/local/Makefile @@ -1,4 +1,4 @@ all: - docker build --no-cache --tag ethermintd/node ../.. -f ethermintnode/Dockerfile + docker build --no-cache --tag laconicd/node ../.. -f ethermintnode/Dockerfile .PHONY: all diff --git a/networks/local/ethermintnode/Dockerfile b/networks/local/ethermintnode/Dockerfile index a275b751..b1756f29 100644 --- a/networks/local/ethermintnode/Dockerfile +++ b/networks/local/ethermintnode/Dockerfile @@ -22,10 +22,10 @@ WORKDIR / RUN apt-get update # Copy over binaries from the build-env -COPY --from=build-env /go/src/github.com/evmos/ethermint/build/ethermintd / +COPY --from=build-env /go/src/github.com/evmos/ethermint/build/laconicd / COPY --from=build-env /go/src/github.com/evmos/ethermint/scripts/start-docker.sh / EXPOSE 26656 26657 1317 8545 8546 -# Run ethermintd by default, omit entrypoint to ease using container with ethermintd +# Run laconicd by default, omit entrypoint to ease using container with laconicd ENTRYPOINT ["/bin/bash", "-c"] \ No newline at end of file diff --git a/nix/scripts.nix b/nix/scripts.nix index 131f8d31..3ec6cf22 100644 --- a/nix/scripts.nix +++ b/nix/scripts.nix @@ -3,7 +3,7 @@ , ethermint ? (import ../. { inherit pkgs; }) }: rec { start-ethermint = pkgs.writeShellScriptBin "start-ethermint" '' - # rely on environment to provide ethermintd + # rely on environment to provide laconicd export PATH=${pkgs.test-env}/bin:$PATH ${../scripts/start-ethermint.sh} ${config.ethermint-config} ${config.dotenv} $@ ''; diff --git a/starport.yml b/starport.yml index 4d3cd1b0..90580ce8 100644 --- a/starport.yml +++ b/starport.yml @@ -14,9 +14,9 @@ faucet: coins: ["1000000000000000000000000000aphoton"] coins_max: ["100000000aphoton"] build: - binary: "ethermintd" + binary: "laconicd" init: - home: "$HOME/.ethermintd" + home: "$HOME/.laconicd" app: api: enable: true diff --git a/tests/integration_tests/configs/broken-ethermintd.nix b/tests/integration_tests/configs/broken-ethermintd.nix index f789646a..1fe26951 100644 --- a/tests/integration_tests/configs/broken-ethermintd.nix +++ b/tests/integration_tests/configs/broken-ethermintd.nix @@ -1,8 +1,8 @@ { pkgs ? import ../../../nix { } }: -let ethermintd = (pkgs.callPackage ../../../. { }); +let laconicd = (pkgs.callPackage ../../../. { }); in -ethermintd.overrideAttrs (oldAttrs: { +laconicd.overrideAttrs (oldAttrs: { patches = oldAttrs.patches or [ ] ++ [ - ./broken-ethermintd.patch + ./broken-laconicd.patch ]; }) diff --git a/tests/integration_tests/configs/default.jsonnet b/tests/integration_tests/configs/default.jsonnet index deffe43c..890ef2ef 100644 --- a/tests/integration_tests/configs/default.jsonnet +++ b/tests/integration_tests/configs/default.jsonnet @@ -1,7 +1,7 @@ { dotenv: '../../../scripts/.env', 'ethermint_9000-1': { - cmd: 'ethermintd', + cmd: 'laconicd', 'start-flags': '--trace', config: { consensus: { diff --git a/tests/integration_tests/configs/upgrade-test-package.nix b/tests/integration_tests/configs/upgrade-test-package.nix index a703086f..8bbac69e 100644 --- a/tests/integration_tests/configs/upgrade-test-package.nix +++ b/tests/integration_tests/configs/upgrade-test-package.nix @@ -2,10 +2,10 @@ let pkgs = import ../../../nix { }; fetchEthermint = rev: builtins.fetchTarball "https://github.com/evmos/ethermint/archive/${rev}.tar.gz"; released = pkgs.buildGo118Module rec { - name = "ethermintd"; + name = "laconicd"; # the commit before https://github.com/evmos/ethermint/pull/943 src = fetchEthermint "f21592ebfe74da7590eb42ed926dae970b2a9a3f"; - subPackages = [ "cmd/ethermintd" ]; + subPackages = [ "cmd/laconicd" ]; vendorSha256 = "sha256-ABm5t6R/u2S6pThGrgdsqe8n3fH5tIWw7a57kxJPbYw="; doCheck = false; }; diff --git a/tests/integration_tests/network.py b/tests/integration_tests/network.py index 31341515..28dcbb81 100644 --- a/tests/integration_tests/network.py +++ b/tests/integration_tests/network.py @@ -11,7 +11,7 @@ from web3.middleware import geth_poa_middleware from .cosmoscli import CosmosCLI from .utils import wait_for_port -DEFAULT_CHAIN_BINARY = "ethermintd" +DEFAULT_CHAIN_BINARY = "laconicd" class Ethermint: diff --git a/tests/integration_tests/shell.nix b/tests/integration_tests/shell.nix index 73003c17..1ffdce1d 100644 --- a/tests/integration_tests/shell.nix +++ b/tests/integration_tests/shell.nix @@ -2,7 +2,7 @@ pkgs.mkShell { buildInputs = [ pkgs.jq - (pkgs.callPackage ../../. { }) # ethermintd + (pkgs.callPackage ../../. { }) # laconicd pkgs.start-scripts pkgs.go-ethereum pkgs.cosmovisor diff --git a/tests/integration_tests/test_rollback.py b/tests/integration_tests/test_rollback.py index 1fbe3163..15f5249e 100644 --- a/tests/integration_tests/test_rollback.py +++ b/tests/integration_tests/test_rollback.py @@ -41,11 +41,11 @@ def custom_ethermint(tmp_path_factory): cmd = [ "nix-build", "--no-out-link", - Path(__file__).parent / "configs/broken-ethermintd.nix", + Path(__file__).parent / "configs/broken-laconicd.nix", ] print(*cmd) broken_binary = ( - Path(subprocess.check_output(cmd).strip().decode()) / "bin/ethermintd" + Path(subprocess.check_output(cmd).strip().decode()) / "bin/laconicd" ) print(broken_binary) @@ -89,7 +89,7 @@ def test_rollback(custom_ethermint): cli2.rollback() print("switch to normal binary") - update_node2_cmd(custom_ethermint.base_dir, "ethermintd", 2) + update_node2_cmd(custom_ethermint.base_dir, "laconicd", 2) supervisorctl(custom_ethermint.base_dir / "../tasks.ini", "update") wait_for_port(ports.rpc_port(custom_ethermint.base_port(2))) diff --git a/tests/integration_tests/test_upgrade.py b/tests/integration_tests/test_upgrade.py index ce830e41..8e63ef72 100644 --- a/tests/integration_tests/test_upgrade.py +++ b/tests/integration_tests/test_upgrade.py @@ -55,7 +55,7 @@ def post_init(path, base_port, config): { "command": f"cosmovisor start --home %(here)s/node{i}", "environment": ( - f"DAEMON_NAME=ethermintd,DAEMON_HOME=%(here)s/node{i}" + f"DAEMON_NAME=laconicd,DAEMON_HOME=%(here)s/node{i}" ), } ) @@ -80,7 +80,7 @@ def custom_ethermint(tmp_path_factory): 26100, Path(__file__).parent / "configs/cosmovisor.jsonnet", post_init=post_init, - chain_binary=str(path / "upgrades/genesis/bin/ethermintd"), + chain_binary=str(path / "upgrades/genesis/bin/laconicd"), ) @@ -136,7 +136,7 @@ def test_cosmovisor_upgrade(custom_ethermint: Ethermint): # update cli chain binary custom_ethermint.chain_binary = ( Path(custom_ethermint.chain_binary).parent.parent.parent - / f"{plan_name}/bin/ethermintd" + / f"{plan_name}/bin/laconicd" ) cli = custom_ethermint.cosmos_cli() diff --git a/tests/rpc/rpc_pending_test.go b/tests/rpc/rpc_pending_test.go index cb72faab..22b3e638 100644 --- a/tests/rpc/rpc_pending_test.go +++ b/tests/rpc/rpc_pending_test.go @@ -1,5 +1,5 @@ // This is a test utility for Ethermint's Web3 JSON-RPC services. -// To run these tests please first ensure you have the ethermintd running +// To run these tests please first ensure you have the laconicd running // You can configure the desired HOST and MODE as well in integration-test-all.sh package rpc diff --git a/tests/rpc/rpc_test.go b/tests/rpc/rpc_test.go index 752d38e4..83d9fd73 100644 --- a/tests/rpc/rpc_test.go +++ b/tests/rpc/rpc_test.go @@ -1,7 +1,7 @@ // This is a test utility for Ethermint's Web3 JSON-RPC services. // -// To run these tests please first ensure you have the ethermintd running -// and have started the RPC service with `ethermintd rest-server`. +// To run these tests please first ensure you have the laconicd running +// and have started the RPC service with `laconicd rest-server`. // // You can configure the desired HOST and MODE as well package rpc diff --git a/tests/solidity/README.md b/tests/solidity/README.md index 8d7da0dc..2ec49ac9 100644 --- a/tests/solidity/README.md +++ b/tests/solidity/README.md @@ -10,17 +10,17 @@ Increasingly difficult tests are provided: ### Quick start -**Prerequisite**: in the repo's root, run `make install` to install the `ethermintd` and `ethermintd` binaries. When done, come back to this directory. +**Prerequisite**: in the repo's root, run `make install` to install the `laconicd` and `laconicd` binaries. When done, come back to this directory. **Prerequisite**: install the individual solidity packages. They're set up as individual reops in a yarn monorepo workspace. Install them all via `yarn install`. -To run the tests, you can use the `test-helper.js` utility to test all suites under `ganache` or `ethermint` network. The `test-helper.js` will help you spawn an `ethermintd` process before running the tests. +To run the tests, you can use the `test-helper.js` utility to test all suites under `ganache` or `ethermint` network. The `test-helper.js` will help you spawn an `laconicd` process before running the tests. You can simply run `yarn test --network ethermint` to run all tests with ethermint network, or you can run `yarn test --network ganache` to use ganache shipped with truffle. In most cases, there two networks should produce identical test results. If you only want to run a few test cases, append the name of tests following by the command line. For example, use `yarn test --network ethermint basic` to run the `basic` test under `ethermint` network. -If you need to take more control, you can also run `ethermintd` using: +If you need to take more control, you can also run `laconicd` using: ```sh ./init-test-node.sh @@ -32,9 +32,9 @@ You will now have three ethereum accounts unlocked in the test node: - `0xddd64b4712f7c8f1ace3c145c950339eddaf221d` (User 1) - `0x0f54f47bf9b8e317b214ccd6a7c3e38b893cd7f0` (user 2) -Keep the terminal window open, go into any of the tests and run `yarn test-ethermint`. You should see `ethermintd` accepting transactions and producing blocks. You should be able to query for any transaction via: +Keep the terminal window open, go into any of the tests and run `yarn test-ethermint`. You should see `laconicd` accepting transactions and producing blocks. You should be able to query for any transaction via: -- `ethermintd query tx ` +- `laconicd query tx ` - `curl localhost:8545 -H "Content-Type:application/json" -X POST --data '{"jsonrpc":"2.0","method":"eth_getTransactionByHash","params":[""],"id":1}'` From here, in your other available terminal, @@ -55,7 +55,7 @@ The [`init-test-node.sh`](./init-test-node.sh) script sets up ethermint with the Each with roughly 100 ETH available (1e18 photon). -Running `ethermintd keys list --keyring-backend=test` should output: +Running `laconicd keys list --keyring-backend=test` should output: ```json [ diff --git a/tests/solidity/test-helper.js b/tests/solidity/test-helper.js index dee961a6..71f6aa64 100644 --- a/tests/solidity/test-helper.js +++ b/tests/solidity/test-helper.js @@ -26,7 +26,7 @@ function checkTestEnv() { .describe('network', 'set which network to use: ganache|ethermint') .describe('batch', 'set the test batch in parallelized testing. Format: %d-%d') .describe('allowTests', 'only run specified tests. Separated by comma.') - .boolean('verbose-log').describe('verbose-log', 'print ethermintd output, default false') + .boolean('verbose-log').describe('verbose-log', 'print laconicd output, default false') .argv; if (!fs.existsSync(path.join(__dirname, './node_modules'))) { @@ -176,29 +176,29 @@ function setupNetwork({ runConfig, timeout }) { // Spawn the ethermint process const spawnPromise = new Promise((resolve, reject) => { - const ethermintdProc = spawn('./init-test-node.sh', { + const laconicdProc = spawn('./init-test-node.sh', { cwd: __dirname, stdio: ['ignore', runConfig.verboseLog ? 'pipe' : 'ignore', 'pipe'], }); - logger.info(`Starting Ethermintd process... timeout: ${timeout}ms`); + logger.info(`Starting laconicd process... timeout: ${timeout}ms`); if (runConfig.verboseLog) { - ethermintdProc.stdout.pipe(process.stdout); + laconicdProc.stdout.pipe(process.stdout); } - ethermintdProc.stderr.on('data', d => { + laconicdProc.stderr.on('data', d => { const oLine = d.toString(); if (runConfig.verboseLog) { process.stdout.write(oLine); } if (oLine.indexOf('Starting JSON-RPC server') !== -1) { - logger.info('Ethermintd started'); - resolve(ethermintdProc); + logger.info('laconicd started'); + resolve(laconicdProc); } }); }); const timeoutPromise = new Promise((resolve, reject) => { - setTimeout(() => reject(new Error('Start ethermintd timeout!')), timeout); + setTimeout(() => reject(new Error('Start laconicd timeout!')), timeout); }); return Promise.race([spawnPromise, timeoutPromise]); } diff --git a/x/bond/README.md b/x/bond/README.md index 0e6e2558..c774451c 100644 --- a/x/bond/README.md +++ b/x/bond/README.md @@ -1,7 +1,7 @@ # Build chain ```bash -# it will create binary in build folder with `ethermintd` +# it will create binary in build folder with `laconicd` $ make build ``` diff --git a/x/nameservice/README.md b/x/nameservice/README.md index 4e02adc5..032e5a7b 100644 --- a/x/nameservice/README.md +++ b/x/nameservice/README.md @@ -1,7 +1,7 @@ # Build chain ```bash -# it will create binary in build folder with `ethermintd` +# it will create binary in build folder with `laconicd` $ make build ```