fix: rollback to tendermint v0.34.21 #38
@ -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
|
||||
|
@ -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')
|
||||
|
@ -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";
|
||||
};
|
||||
}
|
||||
|
22
init.bat
22
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
|
||||
laconicd start --pruning=nothing %TRACE% --log_level %LOGLEVEL% --minimum-gas-prices=0.0001aphoton
|
@ -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
|
||||
|
@ -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"]
|
@ -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} $@
|
||||
'';
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
};
|
||||
|
@ -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:
|
||||
|
@ -2,7 +2,7 @@
|
||||
pkgs.mkShell {
|
||||
buildInputs = [
|
||||
pkgs.jq
|
||||
(pkgs.callPackage ../../. { }) # ethermintd
|
||||
(pkgs.callPackage ../../. { }) # laconicd
|
||||
pkgs.start-scripts
|
||||
pkgs.go-ethereum
|
||||
pkgs.cosmovisor
|
||||
|
@ -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)))
|
||||
|
||||
|
@ -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,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
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
[
|
||||
|
@ -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]);
|
||||
}
|
||||
|
@ -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
|
||||
```
|
||||
|
||||
|
@ -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
|
||||
```
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user