Déploiement de contrats intelligents Vlayer avec {Solidity 2.0}

3 min read

Installer Git
apt-get install git
Installer Bun
curl -fsSL [https://bun.sh/install](https://bun.sh/install) | bash && source ~/.profile
Installer Foundry
curl -L [https://foundry.paradigm.xyz/](https://foundry.paradigm.xyz/) | bash && source ~/.bashrc foundryup
Installer unzip
apt install unzip
Obtenir Vlayer
curl -SL [https://install.vlayer.xyz/](https://install.vlayer.xyz/) | bash && vlayerup
Vérifier la version de Vlayer
vlayer --version
Vlayer DEVNET (configuration Docker)
sudo apt update sudo apt install apt-transport-https ca-certificates curl software-properties-common -y
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null sudo apt update sudo apt install docker-ce -y
sudo curl -L "https://github.com/docker/compose/releases/download/$(curl -s https://api.github.com/repos/docker/compose/releases/latest | jq -r .tag_name)/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose sudo chmod +x /usr/local/bin/docker-compose
bun run devnet
bun run prove:dev
bun run deploy:dev
bun run deploy:testnet
docker ps
Vlayer TESTNET
sudo apt update && sudo apt install -y git curl wget unzip tar build-essential
curl -L https://foundry.paradigm.xyz | bash source /root/.bashrc foundryup forge --version
curl -SL https://install.vlayer.xyz | bash source /root/.bashrc vlayerup vlayer --version
curl -fsSL https://bun.sh/install | bash source /root/.bashrc
bun add viem
rm -rf bun.lockb node_modules
bun install
Initialiser et exécuter 4 modèles avec création de fichiers bash pour le processus de test via l'automatisation
simple-web-proof
echo '#!/bin/bash
vlayerup && vlayer --version
vlayer init simple-web-proof --template simple-web-proof
cd simple-web-proof
forge build
cd vlayer
echo "VLAYER_API_TOKEN=<API-KEY>
EXAMPLES_TEST_PRIVATE_KEY=0x<PRIVATE-KEY>
CHAIN_NAME=optimismSepolia
JSON_RPC_URL=https://sepolia.optimism.io
" > .env.testnet.local
bun add @vlayer/sdk
bun run prove:testnet
' > simple-web-proof.sh
chmod +x ./simple-web-proof.sh
./simple-web-proof.sh
###replace <API-KEY> and <PRIVATE-KEY> to yours
###nano $HOME/simple-web-proof.sh to edit
simple-email-proof
echo '#!/bin/bash
vlayerup && vlayer --version
vlayer init simple-email-proof --template simple-email-proof
cd simple-email-proof
forge build
cd vlayer
echo "VLAYER_API_TOKEN=<API-KEY>
EXAMPLES_TEST_PRIVATE_KEY=0x<PRIVATE-KEY>
CHAIN_NAME=optimismSepolia
JSON_RPC_URL=https://sepolia.optimism.io
" > .env.testnet.local
bun add @vlayer/sdk
bun run prove:testnet
' > simple-email-proof.sh
chmod +x ./simple-email-proof.sh
./simple-email-proof.sh
###replace <API-KEY> and <PRIVATE-KEY> to yours
###nano $HOME/simple-email-proof.sh to edit
simple-time-travel
echo '#!/bin/bash
vlayerup && vlayer --version
vlayer init simple-time-travel --template simple-time-travel
cd simple-time-travel
forge build
cd vlayer
echo "VLAYER_API_TOKEN=<API-KEY>
EXAMPLES_TEST_PRIVATE_KEY=0x<PRIVATE-KEY>
CHAIN_NAME=optimismSepolia
JSON_RPC_URL=https://sepolia.optimism.io
" > .env.testnet.local
bun add @vlayer/sdk
bun run prove:testnet
' > simple-time-travel.sh
chmod +x ./simple-time-travel.sh
./simple-time-travel.sh
###replace <API-KEY> and <PRIVATE-KEY> to yours
###nano $HOME/simple-time-travel.sh to edit
simple-teleport
echo '#!/bin/bash
vlayerup && vlayer --version
vlayer init simple-teleport --template simple-teleport
cd simple-teleport
forge build
cd vlayer
echo "VLAYER_API_TOKEN=<API-KEY>
EXAMPLES_TEST_PRIVATE_KEY=0x<PRIVATE-KEY>
CHAIN_NAME=optimismSepolia
JSON_RPC_URL=https://sepolia.optimism.io
" > .env.testnet.local
bun add @vlayer/sdk
bun run prove:testnet
' > simple-teleport.sh
chmod +x ./simple-teleport.sh
./simple-teleport.sh
###replace <API-KEY> and <PRIVATE-KEY> to yours
###nano $HOME/simple-teleport.sh to edit
Chaînes prises en charge
baseSepolia
Sepolia
optimismSepolia
polygonAmoy
arbitrumSepolia
lineaSepolia
worldchainSepolia
zksyncSepoliaTestnet
Sources officielles
off site https://www.vlayer.xyz/
off docs https://book.vlayer.xyz/introduction.html
dashboard https://dashboard.vlayer.xyz/
x/twitter https://x.com/vlayer_xyz
discord https://discord.gg/7PgpAnGd
linkedin https://www.linkedin.com/company/vlayer-labs
github https://github.com/vlayer-xyz
0
Subscribe to my newsletter
Read articles from tonym00n directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by

tonym00n
tonym00n
Python, Solidity