ethermintd->laconicd

This commit is contained in:
0xmuralik
2022-10-13 11:23:17 +05:30
parent 995405d204
commit 051ef3fd2a
21 changed files with 56 additions and 56 deletions
@@ -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
];
})
@@ -1,7 +1,7 @@
{
dotenv: '../../../scripts/.env',
'ethermint_9000-1': {
cmd: 'ethermintd',
cmd: 'laconicd',
'start-flags': '--trace',
config: {
consensus: {
@@ -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;
};
+1 -1
View File
@@ -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:
+1 -1
View File
@@ -2,7 +2,7 @@
pkgs.mkShell {
buildInputs = [
pkgs.jq
(pkgs.callPackage ../../. { }) # ethermintd
(pkgs.callPackage ../../. { }) # laconicd
pkgs.start-scripts
pkgs.go-ethereum
pkgs.cosmovisor
+3 -3
View File
@@ -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)))
+3 -3
View File
@@ -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()
+1 -1
View File
@@ -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
+2 -2
View File
@@ -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
+6 -6
View File
@@ -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 <cosmos-sdk tx>`
- `laconicd query tx <cosmos-sdk tx>`
- `curl localhost:8545 -H "Content-Type:application/json" -X POST --data '{"jsonrpc":"2.0","method":"eth_getTransactionByHash","params":["<ethereum tx>"],"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
[
+8 -8
View File
@@ -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]);
}