diff --git a/p2p/krypto-tour/README.md b/p2p/krypto-tour/README.md index 6360b91e..1460f246 100644 --- a/p2p/krypto-tour/README.md +++ b/p2p/krypto-tour/README.md @@ -1,148 +1,154 @@ -# Workshop - Discover Blockchain Development and Tools +# Workshop - Découverte du Développement Blockchain et des Outils -✔ 📖 **Discover Foundry** -✔ 🛠️ **Deploy a Smart-Contract on a Local Blockchain** -✔ 🚀 **Call this Smart-Contract** +✔ 📖 **Découvrez Foundry** +✔ 🛠️ **Déployez un Smart Contract sur une Blockchain Locale** +✔ 🚀 **Appelez ce Smart Contract** ## Introduction -This workshop introduces blockchain development and the tools you'll need to deploy and interact with smart contracts. We’ll guide you through deploying your first smart contract using Foundry on a local blockchain, and calling it to see how it works. +Cet atelier présente le développement blockchain et les outils nécessaires pour déployer et interagir avec des smart contracts. Nous vous guiderons à travers le déploiement de votre premier smart contract en utilisant Foundry sur une blockchain locale, et nous l’appellerons pour voir comment il fonctionne. -### What is a Smart Contract? -A smart contract is a self-executing contract with the terms directly written into code. Once deployed on a blockchain, it can be interacted with like any other piece of software, but it's decentralized, meaning no one can alter it once it's live. +### Qu'est-ce qu'un Smart Contract ? +Un smart contract est un contrat auto-exécutable avec des actions directement écrits dans le code. Une fois déployé sur une blockchain, il peut être interagi comme n'importe quel autre logiciel, mais il est décentralisé, ce qui signifie que personne ne peut le modifier une fois qu'il est en ligne. -## Prerequisites +## Prérequis -This workshop requires **no prior knowledge**. All you need is a computer and an internet connection. +Cet atelier ne nécessite **aucune connaissance préalable**. Tout ce dont vous avez besoin est un ordinateur et une connexion Internet. -## Step 1 - Install VSCode +## Étape 1 - Installer VSCode -VSCode is a text editor that developers use to write code. Think of it like a digital notebook where you'll be writing your smart contract. +VSCode est un éditeur de texte que les développeurs utilisent pour écrire du code. Pensez-y comme `Word` de Microsoft office mais spécialisé pour écrire du code. C'est ici où vous allez écrire votre smart contract. -1. Go to the [official website](https://code.visualstudio.com/download) and download the version of VSCode for your operating system. -2. Follow the installation instructions on the site, and once installed, open it up. You'll use it to write your smart contract later. +1. Allez sur le [site officiel](https://code.visualstudio.com/download) et téléchargez la version de VSCode pour votre système d'exploitation. +2. Suivez les instructions d'installation sur le site, et une fois installé, ouvrez-le. Vous l'utiliserez pour écrire votre smart contract plus tard. -## Step 2 - Install Foundry +## Étape 2 - Installer Foundry -Foundry is a set of tools that helps you develop and test smart contracts quickly. +Foundry est un ensemble d'outils qui vous aide à développer et tester des smart contracts rapidement. -1. Follow the instructions given [here](https://book.getfoundry.sh/getting-started/installation) to install Foundry. The guide walks you through installing it on your system. -2. After installation, run the following command in your terminal to make sure it's installed correctly: - To open a terminal in vscode, click on the **Terminal** tab in the top menu and then click on **New Terminal** +1. Suivez les instructions données [ici](https://book.getfoundry.sh/getting-started/installation) pour installer Foundry. Le guide vous accompagne dans son installation sur votre système. +2. Après l'installation, exécutez la commande suivante dans votre terminal pour vous assurer qu'il est installé correctement : + Pour ouvrir un terminal dans VSCode, cliquez sur l'onglet **Terminal** dans le menu supérieur, puis cliquez sur **Nouveau Terminal** ```shell forge --version ``` - If everything went well, you should see the current version of Foundry printed out. + Si tout s'est bien passé, vous devriez voir la version actuelle de Foundry affichée. +## Étape 3 - Initialiser Votre Projet -## Step 3 - Initialize Your Project +### Qu'est-ce que l'Initialisation ? +L'initialisation configure la structure de base de votre projet. -### What is Initialization? -Initialization sets up the basic structure of your project. - -1. In your terminal, navigate to the folder where you want to create your project. Then, run the following command to initialize the project: +1. Dans votre terminal, naviguez vers le dossier où vous souhaitez créer votre projet. Ensuite, exécutez la commande suivante pour initialiser le projet : ```shell forge init workshop ``` - This will create a new project folder called `workshop` with some starter files. + Cela créera un nouveau dossier de projet appelé `workshop` avec quelques fichiers de démarrage. + +### Supprimer les Fichiers Inutiles +Certains fichiers fournis avec le projet de démarrage ne sont pas nécessaires pour cet atelier. + +1. Supprimez les dossiers et fichiers suivants : + - Dossier `test` + - Dossier `script` + - Fichier `Counter.sol` dans le dossier `src` -### Delete Unnecessary Files -Some of the files that come with the starter project aren’t needed for this workshop. +2. Maintenant, ajoutez le fichier `HelloWorld.sol` dans le dossier `src`. C'est le smart contract que vous allez déployer. + - Le smart contract n'a qu'une seule fonction `hello()` qui renvoie le message `Hello world`. -1. Delete the following folders and file: - - `test` folder - - `script` folder - - `Counter.sol` file in the `src` folder +> **Pourquoi un "Hello World" ?** +> Le programme "Hello World" est souvent le premier exemple de code que les développeurs écrivent lorsqu'ils apprennent un nouveau langage de programmation. Cette tradition remonte à 1972, lorsqu'il a été utilisé dans le livre "The C Programming Language" pour illustrer la syntaxe de base et l'affichage à l'écran. -2. Now, add the file `HelloWorld.sol` in the `src` folder. This is the smart contract you'll be deploying. - - The smart contract have only one function `hello()` that returns the message `Hello world`. -## Step 4 - Start the Local Blockchain +## Étape 4 - Démarrer la Blockchain Locale -### What is a Local Blockchain? -A local blockchain is like a blockchain simulator running on your computer. It allows you to test your smart contracts without using real money or interacting with a public blockchain. +### Qu'est-ce qu'une Blockchain Locale ? -1. To start your local blockchain, run the following command in the terminal: +Une blockchain locale est comme un simulateur de blockchain fonctionnant sur votre ordinateur. Elle vous permet de tester vos smart contracts sans utiliser de l'argent réel ou interagir avec une blockchain publique. + +1. Pour démarrer votre blockchain locale, exécutez la commande suivante dans le terminal : ```shell anvil ``` - Anvil will start up a local blockchain and give you a list of pre-created wallets. Each wallet has some fake cryptocurrency in it so that you can deploy smart contracts without needing real money. + Anvil démarrera une blockchain locale et vous fournira une liste de portefeuilles pré-créés. Chaque portefeuille contient une crypto-monnaie fictive afin que vous puissiez déployer des smart contracts sans avoir besoin d'argent réel. -2. **Copy one of the private keys** from the list. You will use this key to deploy your smart contract in the next step. +2. **Copiez l'une des clés privées** de la liste. Vous utiliserez cette clé pour déployer votre smart contract à l'étape suivante. + exemple: `0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80` + > **Qu'est-ce qu'une clé privée ?** + > Une clé privée est une chaîne de caractères qui permet d'accéder à un portefeuille de crypto-monnaie. C'est comme un mot de passe, mais plus long et plus sécurisé. Ne partagez jamais votre clé privée avec quelqu'un d'autre, car cela leur donnerait accès à votre portefeuille. -## Step 5 - Deploy the Smart Contract +## Étape 5 - Déployer le Smart Contract -### What Does Deploying Mean? -When you deploy a smart contract, you're publishing it on a blockchain so it can be used. Once deployed, it's live and ready for interaction. +### Que signifie Déployer ? +Lorsque vous déployez un smart contract, vous le publiez sur une blockchain afin qu'il puisse être utilisé. Une fois déployé, il est en ligne et prêt à être utilisé. -1. To deploy your smart contract, run the following command: +1. Pour déployer votre smart contract, exécutez la commande suivante : ```shell forge create --private-key PRIVATE_KEY src/HelloWorld.sol:HelloWorld ``` - Replace `PRIVATE_KEY` with the private key you copied earlier from the local blockchain. + Remplacez `PRIVATE_KEY` par la clé privée que vous avez copiée plus tôt depuis la blockchain locale. -2. After running the command, you'll see some information about the deployment. Look for the part that says `deployed to`, followed by an address. **Copy this address**, as it is where your smart contract is located on the blockchain, and you'll need it in the next step. +2. Après avoir exécuté la commande, vous verrez quelques informations sur le déploiement. Recherchez la partie qui dit `deployed to`, suivie d'une adresse. **Copiez cette adresse**, car c'est là que se trouve votre smart contract sur la blockchain, et vous en aurez besoin à l'étape suivante. -## Step 6 - Call the Smart Contract +## Étape 6 - Appeler le Smart Contract -### What Does Calling a Smart Contract Mean? -Calling a smart contract means interacting with it by executing one of its functions. For this workshop, you’ll call the `hello()` function of the smart contract, which will return a message. +### Que signifie Appeler un Smart Contract ? +Appeler un smart contract signifie interagir avec lui en exécutant l'une de ses fonctions. Pour cet atelier, vous allez appeler la fonction `hello()` du smart contract, qui renverra un message. -1. Run the following command to call the `hello()` function: +1. Exécutez la commande suivante pour appeler la fonction `hello()` : ```shell cast call CONTRACT_ADDRESS "hello()" | tr -d '\n' | cast to-ascii ``` - Replace `CONTRACT_ADDRESS` with the address of the smart contract that you copied earlier. + Remplacez `CONTRACT_ADDRESS` par l'adresse du smart contract que vous avez copiée précédemment. -2. You should see the output `Hello world`. +2. Vous devriez voir la sortie `Hello world`. - Here's what each part of the command does: - - `cast call` is used to call a function in the smart contract. - - The first argument is the address of the smart contract. - - The second argument is the function to call (`hello()` in this case). - - `tr -d '\n'` removes the newline character at the end of the output. - - `cast to-ascii` converts the output from hexadecimal to readable text (ASCII). + Voici ce que fait chaque partie de la commande : + - `cast call` est utilisé pour appeler une fonction dans le smart contract. + - Le premier argument est l'adresse du smart contract. + - Le deuxième argument est la fonction à appeler (`hello()` dans ce cas). + - `tr -d '\n'` supprime le caractère de nouvelle ligne à la fin de la sortie. + - `cast to-ascii` convertit la sortie de l'hexadécimal en texte lisible (ASCII). ## Conclusion -Congratulations! You've just deployed and called a smart contract on a local blockchain. You've taken your first steps into blockchain development, and I hope this workshop has given you a taste of how powerful this technology can be. - -Feel free to explore more, modify the smart contract, and dive deeper into Foundry and blockchain! +Félicitations ! Vous avez déployé et appelé un smart contract sur une blockchain locale. Vous avez fait vos premiers pas dans le développement blockchain, et j'espère que cet atelier vous a donné un aperçu de la puissance de cette technologie. +N'hésitez pas à explorer davantage, à modifier le smart contract et à plonger plus profondément dans Foundry et la blockchain ! -## Authors 👋 +## Auteurs 👋 | [
Lucas LECLERC](https://github.com/Intermarch3) | | :--------------------------------------------------------------------------------------------------------------------: | -

Organization

+

Organisation


- LinkedIn logo + Logo LinkedIn - Instagram logo + Logo Instagram - Twitter logo + Logo Twitter - Discord logo + Logo Discord

- Website logo + Logo Site Web

-> 🚀 Don't hesitate to follow us on our different platforms, and give a star 🌟 to PoC's repositories. +> 🚀 N'hésitez pas à nous suivre sur nos différentes plateformes et à donner une étoile 🌟 aux dépôts de PoC. \ No newline at end of file