Skip to content

Commit

Permalink
🗞️ Update dotenv to access .env mnemonic, example rpcs (#352)
Browse files Browse the repository at this point in the history
  • Loading branch information
TRileySchwarz authored Feb 7, 2024
1 parent cb1aa4c commit 9996f00
Show file tree
Hide file tree
Showing 6 changed files with 82 additions and 7 deletions.
7 changes: 7 additions & 0 deletions .changeset/mighty-chicken-give.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"create-lz-oapp": patch
"@layerzerolabs/oapp-example": patch
"@layerzerolabs/oft-example": patch
---

Updated Readmes and the example rpcs used in createLZOApp
35 changes: 34 additions & 1 deletion examples/oapp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

<p align="center">Template project for getting started with LayerZero's <code>OApp</code> contract development.</p>

### Getting Started
## 1) Developing Contracts

#### Installing dependencies

Expand Down Expand Up @@ -73,3 +73,36 @@ Or adjust the `package.json` to for example remove `hardhat` tests:
- "test:hardhat": "$npm_execpath hardhat test"
+ "test": "forge test"
```

## 2) Deploying Contracts

Set up deployer wallet/account:

- Rename `.env.example` -> `.env`
- Choose your preferred means of setting up your deployer wallet/account:

```
MNEMONIC="test test test test test test test test test test test junk"
or...
PRIVATE_KEY="0xabc...def"
```

To deploy your contracts to your desired blockchains, run the following command in your project's folder:

```bash
npx hardhat lz:deploy
```

More information about available CLI arguments can be found using the `--help` flag:

```bash
npx hardhat lz:deploy --help
```

By following these steps, you can focus more on creating innovative omnichain solutions and less on the complexities of cross-chain communication.

<br></br>

<p align="center">
Join our community on <a href="https://discord-layerzero.netlify.app/discord" style="color: #a77dff">Discord</a> | Follow us on <a href="https://twitter.com/LayerZero_Labs" style="color: #a77dff">Twitter</a>
</p>
4 changes: 2 additions & 2 deletions examples/oapp/hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ const config: HardhatUserConfig = {
},
fuji: {
eid: EndpointId.AVALANCHE_V2_TESTNET,
url: 'https://api.avax-test.network/',
url: 'https://rpc.ankr.com/avalanche_fuji',
accounts,
},
mumbai: {
eid: EndpointId.POLYGON_V2_TESTNET,
url: 'https://rpc-mumbai.matic.today',
url: 'https://rpc.ankr.com/polygon_mumbai',
accounts,
},
},
Expand Down
37 changes: 36 additions & 1 deletion examples/oft/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

<p align="center">Template project for getting started with LayerZero's <code>OFT</code> contract development.</p>

### Getting Started
## 1) Developing Contracts

#### Installing dependencies

Expand Down Expand Up @@ -73,3 +73,38 @@ Or adjust the `package.json` to for example remove `hardhat` tests:
- "test:hardhat": "$npm_execpath hardhat test"
+ "test": "forge test"
```

## 2) Deploying Contracts

Set up deployer wallet/account:

- Rename `.env.example` -> `.env`
- Choose your preferred means of setting up your deployer wallet/account:

```
MNEMONIC="test test test test test test test test test test test junk"
or...
PRIVATE_KEY="0xabc...def"
```

- Fund this address with the corresponding chain's native tokens you want to deploy to.

To deploy your contracts to your desired blockchains, run the following command in your project's folder:

```bash
npx hardhat lz:deploy
```

More information about available CLI arguments can be found using the `--help` flag:

```bash
npx hardhat lz:deploy --help
```

By following these steps, you can focus more on creating innovative omnichain solutions and less on the complexities of cross-chain communication.

<br></br>

<p align="center">
Join our community on <a href="https://discord-layerzero.netlify.app/discord" style="color: #a77dff">Discord</a> | Follow us on <a href="https://twitter.com/LayerZero_Labs" style="color: #a77dff">Twitter</a>
</p>
4 changes: 2 additions & 2 deletions examples/oft/hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ const config: HardhatUserConfig = {
},
fuji: {
eid: EndpointId.AVALANCHE_V2_TESTNET,
url: 'https://api.avax-test.network/',
url: 'https://rpc.ankr.com/avalanche_fuji',
accounts,
},
mumbai: {
eid: EndpointId.POLYGON_V2_TESTNET,
url: 'https://rpc-mumbai.matic.today',
url: 'https://rpc.ankr.com/polygon_mumbai',
accounts,
},
},
Expand Down
2 changes: 1 addition & 1 deletion packages/create-lz-oapp/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export const PACKAGE_MANAGERS: PackageManager[] = [
id: 'pnpm',
executable: 'pnpm',
args: ['install'],
label: 'pnpm',
label: 'pnpm (recommended)',
},
{
id: 'bun',
Expand Down

0 comments on commit 9996f00

Please sign in to comment.