This guide is for deploying your own Avalanche L1 and use USDC as native gas token.
The intention is also for the Avalanche L1 to bridge ERC20 and ERC721 using Avalanche Interchain Token Transfer and Chainlink CCIP Transfer Tokens with EVM compatible chains.
It'd be ideal to run it with one command like yarn subnet
with a config file, but for now, we'll have to do it manually. You'll start a local Avalanche L1 using Ava Labs avalanche-starter-kit. The network runs on your local machine and can be used for testing and development.
General avalanche instructions: avalanche -h
Go to avalanche-starter-kit, open Code, switch to tab Codespaces, then click on +
to start a new codespace:
It'll take some time to load, go take a walk or do something else while it loads
-
avalanche blockchain create punksociety
-
Subnet EVM, "I want to use defaults for a test environment", Chain ID: 615243 Token Symbol: USDC, Enter
-
avalanche blockchain deploy punksociety
-
Local Network, Enter
-
After it boots up the blockchain, for some reason port
9650
doesn't set itself automatically to public, so you gotta clickPorts
to the right ofTerminal
, find port 9650, right click it, Port visibility, Public
NOTE: After 30 minutes (or if you close the tab/browser) your codespaces goes to sleep. To prevent this from happening, run this command:
while true; do echo "Ah ah ah ah, staying alive!"; sleep 900; done &
to ping the codespace every 15 minutes.
NOTE: Remember GitHub will provide users in the free plan (boo!) 120 core hours or 60 hours of run time on a 2 core codespace, plus 15 GB of storage each month. So remember to shut it down when you're not using it.
Add the rpc url on packages/foundry/.env
and on packages/nextjs/.env
variable called PUNKSOCIETY_RPC_URL
and NEXT_PUBLIC_PUNKSOCIETY_RPC_URL
respectively.
Go to packages/nextjs/scaffold.config.ts
and change the targetNetworks
to [punksociety]
.
NOTE: When using codespace on github, load the global URL, NOT the local (127.0.0.1) one
-
Go to the frontend and switch networks to
PunkSociety
, or do it manually if you're inclined to do so. This will prompt you to add Punk Society network to your wallet (only tried on MetaMask so far). -
To have
1000000 USDC as starting balance
(deployer account), scroll up on the Terminal and findMain funded account EWOQ
, then COPY THE PRIVATE KEY (the one NOT starting with 0x). -
Copy the private key into
packages/foundry/.env
variable calledDEPLOYER_PRIVATE_KEY
prefixing a0x
to it (format is0xPRIVATE_KEY
).
Now you'll be able to deploy contracts to PunkSociety!
- Open your metamask and add a new account with that private key.