Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/christiansassi/blockchain-project

Project developed by Matteo Beltrami (@matteobeltrami), Luca Pedercini (@luckeez) and Christian Sassi for the Blockchain course.
https://github.com/christiansassi/blockchain-project

blockchain ganache nodejs remix-ide web3 web3js

Last synced: 2 days ago
JSON representation

Project developed by Matteo Beltrami (@matteobeltrami), Luca Pedercini (@luckeez) and Christian Sassi for the Blockchain course.

Awesome Lists containing this project

README

        

# Installation and Configuration

First, clone this repository by running `git clone https://github.com/christiansassi/blockchain-project`

## Node.js

1. Download and install Node.js from [here](https://nodejs.org/en/download/package-manager).
2. Install the required packages by running `npm install`

## Python

1. Download and install Python from [here](https://www.python.org/downloads/).
2. Install the required packages by running `pip install -r requirements.txt`

## Ganache

1. Install Ganache CLI by running `npm install ganache --global`

## Remix - Ethereum IDE

### Remix Desktop IDE (preferred)

1. Download and install Remix Desktop IDE from [here](https://github.com/remix-project-org/remix-desktop-insiders/releases).
2. After installation, click `File > Open Folder` in the top-left corner, then select your project folder.

### Remix Online IDE

1. Install the npm package by running `npm install @remix-project/remixd --global`
2. Start the Remix daemon inside your project directory. Navigate to your project folder and run `remixd -s .`
3. Open the Remix Online IDE [here](https://remix.ethereum.org/), and in the top-left corner, under the workspace section, select `connect to localhost`.

## MetaMask

1. Download and intsall MetaMask from [here](https://metamask.io/download/).
2. Click on `Import an existing wallet` and enter the following mnemonic phrase: `museum coin tiger catalog dutch doll daring toddler festival cushion fuel nest`. This mnemonic will be used by Ganache when you run the demo.
3. Click on `+ Add Network > Add a network manually` and set the following:
- **Network Name**: `Ganache`
- **RPC URL**: `http://127.0.0.1:8545`
- **Chain ID**: `1337`
- **Currency Symbol**: `ETH`

By default, MetaMask will add the address at index 0, which is `0x40271F69d03387d2C4868B01F8b003D91c247358`. To use other addresses, go to MetaMask and click `+ Add account or hardware wallet > Import account`. Copy and paste the private key for the chosen account. For example, to import the second account (index 1), use the private key `0x8e2b0a8ad2a6c502ea7b37273f2070e7e01ab6d08059c94076d6c5f58e3000c3`, as shown in the Ganache console when you run the local Ethereum blockchain.

# Getting Started

## Running Tests

These commands execute the test cases inside the [tests.js](test/tests.js) file. The test cases are designed to verify the correct functioning of the contract by creating various scenarios that test its functionalities and check for potential bugs in the contract logic. Specifically, the test cases also ensure that every `require` statement within the contract works as intended.

You can run one of the following commands:

```bash
# Rebuild the contract before running the tests
npm run test:build

# To run the tests.
# Note that if the contract is not compiled, Hardhat will compile it for you
npm run test
```

## Play with the contract

1. In the Remix IDE, open the Solidity contract.
2. Click on `Solidity Compiler` in the left sidebar and compile the contract.
3. Click on `Deploy & Run Transactions` in the left sidebar and deploy the contract using the `Deploy` button.

You can now test the contract's functions by expanding the contract window within the `Deployed Contracts` section.

> [!WARNING]
> If you want to deploy the contract again, remove the already deployed contract by clicking on the trash icon.

> [!TIP]
> If you would like to reset the wallets (e.g., restore the balances), simply select and reselect the same environment (e.g., `Remix VM (Shanghai)`).

# Contacts

Matteo Beltrami - [[email protected]](mailto:[email protected])

Luca Pedercini - [[email protected]](mailto:[email protected])

Christian Sassi - [[email protected]](mailto:[email protected])


https://www.unitn.it/