Skip to content

Commit

Permalink
[OR-1474] add core utiils in tokamak directory
Browse files Browse the repository at this point in the history
  • Loading branch information
steven94kr committed Mar 21, 2024
1 parent 91c6b20 commit 1ae5212
Show file tree
Hide file tree
Showing 56 changed files with 2,896 additions and 128 deletions.
20 changes: 0 additions & 20 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -119,18 +119,9 @@ devnet-up: pre-devnet
PYTHONPATH=./bedrock-devnet $(PYTHON) ./bedrock-devnet/main.py --monorepo-dir=.
.PHONY: devnet-up

devnet-legacy-up: pre-devnet
./ops/scripts/newer-file.sh .devnet/allocs-l1.json ./packages/contracts-bedrock \
|| make devnet-legacy-allocs
PYTHONPATH=./bedrock-devnet $(PYTHON) ./bedrock-devnet/main.py --monorepo-dir=. --legacy
.PHONY: devnet-legacy-up

# alias for devnet-up
devnet-up-deploy: devnet-up

# alias for devnet-legacy-up
devnet-legacy-up-deploy: devnet-legacy-up

devnet-test: pre-devnet
PYTHONPATH=./bedrock-devnet $(PYTHON) ./bedrock-devnet/main.py --monorepo-dir=. --test
.PHONY: devnet-test
Expand All @@ -147,20 +138,9 @@ devnet-clean:
docker volume ls --filter name=ops-bedrock --format='{{.Name}}' | xargs -r docker volume rm
.PHONY: devnet-clean

devnet-legacy-clean:
rm -rf ./packages/contracts-bedrock/deployments/devnetL1
rm -rf ./.devnet
cd ./ops-bedrock && docker compose down
docker image ls 'ops-bedrock*' --format='{{.Repository}}' | xargs -r docker rmi
docker volume ls --filter name=ops-bedrock --format='{{.Name}}' | xargs -r docker volume rm
.PHONY: devnet-legacy-clean

devnet-allocs: pre-devnet
PYTHONPATH=./bedrock-devnet $(PYTHON) ./bedrock-devnet/main.py --monorepo-dir=. --allocs

devnet-legacy-allocs: pre-devnet
PYTHONPATH=./bedrock-devnet $(PYTHON) ./bedrock-devnet/main.py --monorepo-dir=. --allocs --legacy

devnet-logs:
@(cd ./ops-bedrock && docker compose logs -f)
.PHONY: devnet-logs
Expand Down
5 changes: 2 additions & 3 deletions bedrock-devnet/devnet/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
parser.add_argument('--monorepo-dir', help='Directory of the monorepo', default=os.getcwd())
parser.add_argument('--allocs', help='Only create the allocs and exit', type=bool, action=argparse.BooleanOptionalAction)
parser.add_argument('--test', help='Tests the deployment, must already be deployed', type=bool, action=argparse.BooleanOptionalAction)
parser.add_argument('--legacy', help='Legacy(using eth) or not(apply native token)', type=bool, action=argparse.BooleanOptionalAction)
parser.add_argument('--admin-key', help='The admin private key for upgrade contracts', type=str, default=os.environ.get('DEVNET_ADMIN_PRIVATE_KEY'))

log = logging.getLogger()
Expand Down Expand Up @@ -58,15 +57,15 @@ def main():

monorepo_dir = os.path.abspath(args.monorepo_dir)
devnet_dir = pjoin(monorepo_dir, '.devnet')
contracts_bedrock_dir = pjoin(monorepo_dir, 'packages', 'tokamak', 'contracts-bedrock') if not args.legacy else pjoin(monorepo_dir, 'packages', 'contracts-bedrock')
contracts_bedrock_dir = pjoin(monorepo_dir, 'packages', 'tokamak', 'contracts-bedrock')
deployment_dir = pjoin(contracts_bedrock_dir, 'deployments', 'devnetL1')
op_node_dir = pjoin(args.monorepo_dir, 'op-node')
ops_bedrock_dir = pjoin(monorepo_dir, 'ops-bedrock')
deploy_config_dir = pjoin(contracts_bedrock_dir, 'deploy-config')
devnet_config_path = pjoin(deploy_config_dir, 'devnetL1.json')
devnet_config_template_path = pjoin(deploy_config_dir, 'devnetL1-template.json')
ops_chain_ops = pjoin(monorepo_dir, 'op-chain-ops')
sdk_dir = pjoin(monorepo_dir, 'packages', 'tokamak', 'sdk') if not args.legacy else pjoin(monorepo_dir, 'packages', 'sdk')
sdk_dir = pjoin(monorepo_dir, 'packages', 'tokamak', 'sdk')
bedrock_devnet_dir = pjoin(monorepo_dir, 'bedrock-devnet')

paths = Bunch(
Expand Down
13 changes: 13 additions & 0 deletions packages/tokamak/core-utils/.depcheckrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
ignores: [
"@babel/eslint-parser",
"@typescript-eslint/parser",
"eslint-plugin-import",
"eslint-plugin-unicorn",
"eslint-plugin-jsdoc",
"eslint-plugin-prefer-arrow",
"eslint-plugin-react",
"@typescript-eslint/eslint-plugin",
"eslint-config-prettier",
"eslint-plugin-prettier",
"chai"
]
3 changes: 3 additions & 0 deletions packages/tokamak/core-utils/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
extends: '../../../.eslintrc.js',
}
2 changes: 2 additions & 0 deletions packages/tokamak/core-utils/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules/
build/
2 changes: 2 additions & 0 deletions packages/tokamak/core-utils/.lintstagedrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
"*.{ts,js}":
- eslint
3 changes: 3 additions & 0 deletions packages/tokamak/core-utils/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
...require('../../../.prettierrc.js'),
};
Loading

0 comments on commit 1ae5212

Please sign in to comment.