LorranSutter / Stock-Oracle

Web app that retrieves stock data and write in a smart contract

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Stock Oracle

Oracle implementation using Solidity, Truffle and API of stock market info presented as lab assingment for BCDV1011 - Design Patterns for Blockchain from Blockchain Development program from George Brown College.

🏃 How to run

Open your terminal in the folder you want to clone the project

# Clone this repo
git clone https://github.com/LorranSutter/Stock-Oracle.git

# Go to the project folder
cd Stock-Oracle

# Install dependencies
yarn

Now you will need two opened terminals to run the project. One for truffle to simulate the EVM and another one for the frontend.

Truffle will run on http://127.0.0.1:9545/

Frontend will run on http://localhost:3000/

## In the first terminal ##

# Go to smart contract folder
cd src/StockSmartContract

# Init truffle
truffle develop

# Run migrations
migrate

The last command above will generate a new ABI and write contract address in a JSON file. You do not have to worry about importing these info in the frontend though. Also you may change the smart contract and run migrations again to see your changes.

## In the another terminal ##

# Go to frontend application
cd ..

# Run the project
yarn start

📖 References

💻 Technologies

About

Web app that retrieves stock data and write in a smart contract


Languages

Language:JavaScript 82.5%Language:Solidity 8.7%Language:CSS 6.0%Language:HTML 2.8%