forked from cerc-io/laconicd-deprecated
ethermintd->laconicd
This commit is contained in:
@@ -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]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user