Skip to content

Commit

Permalink
allow sync + remote
Browse files Browse the repository at this point in the history
  • Loading branch information
wighawag committed Nov 24, 2023
1 parent 84704d0 commit 8cb3d3c
Show file tree
Hide file tree
Showing 10 changed files with 656 additions and 175 deletions.
3 changes: 2 additions & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
BLOCK_TIME=5
BLOCK_TIME=5
ETH_NODE_URI_localhost=http://localhost:8545
4 changes: 2 additions & 2 deletions contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
"set-defaults": "^0.0.2",
"solidity-coverage": "^0.8.5",
"solidity-proxy": "^0.2.4",
"tsx": "^4.2.0",
"tsx": "^4.4.0",
"typescript": "^5.3.2",
"viem": "^1.19.6",
"viem": "^1.19.8",
"viem-chai-matchers": "^0.0.3",
"vitest": "^0.34.6",
"vitest-solidity-coverage": "^0.1.4"
Expand Down
2 changes: 1 addition & 1 deletion indexer/.env
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# this let ldenv know to load the parent foler .env too (the child folder's vars takes precedence though)
ENV_ROOT_FOLDER=..
ENV_ROOT_FOLDER=..
3 changes: 2 additions & 1 deletion indexer/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ node_modules
# data generated
/dist
/ethereum-indexer-data
/src/contracts.ts
/src/contracts.ts
/indexed/
7 changes: 5 additions & 2 deletions indexer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"named-logs": "^0.2.2"
},
"devDependencies": {
"ethereum-indexer-server": "^0.6.16",
"ethereum-indexer-cli": "^0.6.14",
"ethereum-indexer-server": "^0.6.17",
"ldenv": "^0.3.7",
"prettier": "^3.1.0",
"tsup": "^8.0.1",
Expand All @@ -21,7 +22,9 @@
},
"scripts": {
"eis": "eis",
"serve": "ldenv eis run -n @@RPC_URL_:MODE,RPC_URL -p ./dist/index.cjs --disable-cache --deployments ../contracts/deployments/@@MODE @@",
"serve": "ldenv eis run -n @@ETH_NODE_URI_:MODE,ETH_NODE_URI -p ./dist/index.cjs --disable-cache --deployments ../contracts/deployments/@@MODE @@",
"index": "ldenv ei -n @@ETH_NODE_URI_:MODE,ETH_NODE_URI -p ./dist/index.cjs -d src/contracts.ts -f indexed/@@MODE@:.json @@",
"index-to-file": "ei -p ./dist/index.cjs",
"build": "tsup src/index.ts --dts --format esm,cjs",
"dev": "echo 'waiting for src/contracts.ts...'; wait-on src/contracts.ts && tsup src/index.ts --dts --format esm,cjs --watch",
"format:check": "prettier --check .",
Expand Down
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"ldenv": "^0.3.7",
"prettier": "^3.1.0",
"syncpack": "^11.2.1",
"vitepress": "1.0.0-rc.29"
"vitepress": "1.0.0-rc.30"
},
"scripts": {
"preinstall": "npx only-allow pnpm",
Expand All @@ -32,21 +32,23 @@
"web:dev": "pnpm --filter ./web dev",
"indexer:dev": "pnpm --filter ./indexer dev",
"common:dev": "pnpm --filter ./common dev",
"contracts:export": "ldenv -m sepolia pnpm run --filter ./contracts export -n @@MODE --ts ../indexer/src/contracts.ts,../web/src/data/contracts.ts @@",
"contracts:test": "pnpm --filter ./contracts test",
"contracts:execute": "pnpm --filter ./contracts execute",
"contracts:docs": "ldenv -m localhost pnpm run --filter ./contracts docgen @@MODE -o ../docs/contracts",
"indexer:index": "ldenv pnpm run contracts:export @@MODE ~~ pnpm --filter ./indexer index-to-file -n @@ETH_NODE_URI_:MODE,ETH_NODE_URI -d src/contracts.ts -f ../web/static/indexed-state-@@MODE@:.json ~~ @@",
"---------------------- DOCS ----------------------": "",
"docs:dev": "pnpm contracts:docs && vitepress dev docs",
"docs:build": "pnpm contracts:docs && vitepress build docs",
"docs:preview": "vitepress preview docs",
"---------------------- WEB USING EXISTING DEPLOYMENT ----------------------": "",
"zellij-attach": "zellij --layout dev/zellij-attach.kdl a ${npm_package_name}-attach-$MODE || zellij --layout dev/zellij-attach.kdl -s ${npm_package_name}-attach-$MODE",
"attach": "ldenv -m localhost pnpm --filter ./contracts export -n @@MODE --ts ../indexer/src/contracts.ts,../web/src/data/contracts.ts ~~ pnpm run zellij-attach ~~ @@",
"attach": "ldenv -m localhost pnpm run indexer:index @@MODE ~~ pnpm run zellij-attach ~~ @@",
"---------------------- FULL AGAINST AN EXISTING NETWORK ----------------------": "",
"zellij-remote": "zellij --layout dev/zellij-remote.kdl a ${npm_package_name}-remote-$MODE || zellij --layout dev/zellij-remote.kdl -s ${npm_package_name}-remote-$MODE",
"remote": "ldenv pnpm run zellij-remote @@",
"---------------------- DEPLOY ----------------------": "",
"build": "ldenv -m sepolia pnpm run --filter ./contracts export -n @@MODE --ts ../indexer/src/contracts.ts,../web/src/data/contracts.ts ~~ pnpm run --filter ./common build ~~ pnpm run --filter ./indexer build ~~ pnpm run --filter ./web build ~~ @@",
"build": "ldenv -m sepolia pnpm run indexer:index @@MODE ~~ pnpm run --filter ./common build ~~ pnpm run --filter ./indexer build ~~ pnpm run --filter ./web build ~~ @@",
"serve": "pnpm --filter ./web serve",
"contracts:deploy": "ldenv -m localhost pnpm _contracts:deploy @@",
"contracts:deploy:prepare": "ldenv -m localhost ask-env -f contracts/.env.local ETH_NODE_URI_@@MODE MNEMONIC_@@MODE ETHERSCAN_API_KEY:?:ETHERSCAN_API_KEY @@",
Expand Down
Loading

0 comments on commit 8cb3d3c

Please sign in to comment.