Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Block explorer command #276

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ url = https://github.com/matter-labs/era-system-contracts.git
[submodule "contracts"]
path = contracts
url = https://github.com/matter-labs/era-contracts.git
[submodule "block-explorer"]
path = block-explorer
url = [email protected]:matter-labs/block-explorer.git
11 changes: 11 additions & 0 deletions infrastructure/zk/src/explorer.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { Command } from 'commander';
import * as utils from './utils';

export const explorerCommand = new Command('explorer')
.description('start block explorer')
.action(async (cmd: Command) => {
await utils.spawn('npm install --prefix block-explorer/');
await utils.spawn('npm run hyperchain:configure --prefix block-explorer/');
await utils.spawn('npm run db:create --prefix block-explorer/');
await utils.spawn('npm run dev --prefix block-explorer/');
});
2 changes: 2 additions & 0 deletions infrastructure/zk/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import { command as clean } from './clean';
import { command as db } from './database';
import { command as verifyUpgrade } from './verify-upgrade';
import * as env from './env';
import { explorerCommand as explorer } from './explorer';

const COMMANDS = [
server,
Expand All @@ -43,6 +44,7 @@ const COMMANDS = [
clean,
compiler,
verifyUpgrade,
explorer,
env.command,
completion(program as Command)
];
Expand Down
1 change: 1 addition & 0 deletions infrastructure/zk/src/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ export async function announced(fn: string, promise: Promise<void> | void) {
export async function submoduleUpdate() {
await utils.exec('git submodule init');
await utils.exec('git submodule update');
await utils.exec('git submodule update --init --recursive');
}

async function checkEnv() {
Expand Down
Loading
Loading