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

feat: task to stop localnet #34

Merged
merged 20 commits into from
Sep 12, 2024
Merged

feat: task to stop localnet #34

merged 20 commits into from
Sep 12, 2024

Conversation

fadeev
Copy link
Member

@fadeev fadeev commented Sep 11, 2024

A bunch of quality of life improvements.

  • added a task to stop localnet. This could be used for integration testing: start localnet, run some command, if they succeed kill localnet.
  • prompt user to kill a process running on the same port as anvil
  • clean up if localnet init fails
  • format addresses into tables
EVM Contract Addresses
=======================
┌─────────────────┬──────────────────────────────────────────────┐
│ (index)         │ Values                                       │
├─────────────────┼──────────────────────────────────────────────┤
│ Gateway EVM     │ '0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0' │
│ ERC-20 Custody  │ '0xDc64a140Aa3E981100a9becA4E685f962f0cF6C9' │
│ TSS             │ '0x70997970C51812dc3A010C7d01b50e0d17dc79C8' │
│ ZETA            │ '0x5FbDB2315678afecb367f032d93F642f64180aa3' │
│ ERC-20 USDC.ETH │ '0x0DCd1Bf9A1b36cE34237eEaFef220932846BCD82' │
└─────────────────┴──────────────────────────────────────────────┘

ZetaChain Contract Addresses
=============================
┌───────────────────┬──────────────────────────────────────────────┐
│ (index)           │ Values                                       │
├───────────────────┼──────────────────────────────────────────────┤
│ Gateway ZetaChain │ '0xA51c1fc2f0D1a1b8494Ed1FE312d7C3a78Ed91C0' │
│ ZETA              │ '0xa513E6E4b8f2a923D98304ec87F64353C4D5C853' │
│ Fungible Module   │ '0x735b14BB79463307AAcBED86DAf3322B1e6226aB' │
│ System Contract   │ '0x610178dA211FEF7D417bC0e6FeD39F05609AD788' │
│ ZRC-20 USDC.ETH   │ '0x9fd96203f7b22bCF72d9DCb40ff98302376cE09c' │
│ ZRC-20 ETH.ETH    │ '0x91d18e54DAf4F677cB28167158d6dd21F6aB3921' │
└───────────────────┴──────────────────────────────────────────────┘
  • fixed when using custom block time yarn hardhat localnet --anvil "--block-time 2"
  • added a workflow to check that localnet runs fine

@fadeev fadeev marked this pull request as ready for review September 11, 2024 06:39
console.log(ansis.green(`Successfully stopped localnet (PID: ${pid})`));

// Unlink PID file only if it exists
if (fs.existsSync(LOCALNET_PID_FILE)) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At this point we're sure the file exists, right? As we are reading from it before the try-catch.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right 👍 136f373

@fadeev fadeev requested a review from fbac September 11, 2024 14:21
@fadeev fadeev merged commit 95f0945 into main Sep 12, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants