1.1.1 • Published 5 months ago

gaib-core v1.1.1

Weekly downloads
-
License
MIT
Repository
-
Last release
5 months ago

Project Structure

project-root/
│
├── contracts/            # Smart contract source files
│   ├── interfaces/       # Contract interfaces
│   └── libraries/        # Reusable contract libraries
│
├── scripts/              # Deployment and interaction scripts
│
├── test/                 # Test files for smart contracts
│
├── typechain/            # Generated TypeScript typings
│
├── .env                  # Environment variables (gitignored)
├── .gitignore            # Specifies intentionally untracked files to ignore
├── hardhat.config.ts     # Hardhat configuration file
├── package.json          # Project dependencies and scripts
├── tsconfig.json         # TypeScript compiler options
└── README.md             # Project documentation

This structure organizes the project into several key directories:

  • contracts/: Contains all Solidity smart contract files.
  • scripts/: Includes scripts for deploying contracts and interacting with them.
  • test/: Houses all test files for the smart contracts.
  • typechain/: Stores automatically generated TypeScript typings for the contracts.

Configuration files like hardhat.config.ts, package.json, and tsconfig.json are in the root directory, along with the .env file for environment variables (which should not be committed to version control).

Contract deployment document

For detailed deployment instructions, please refer to the https://github.com/gaib-ai/gaib-core/blob/master/deployDocument.md

Install Dependencies

npm i

Build Contracts and Generate Typechain Typeings

npm run build

Run Contract Tests

npm run test

Run Coverage Report for Tests

npm run coverage

Deploy and Verify to Bsc-Testnet

Create a new .env file in the root directory, and put your PRIVATE_KEY and BSCSCAN_API_KEY in it.

If you do not have BSCSCAN_API_KEY, go to https://etherscan.io/myapikey and add one.

PRIVATE_KEY = <Your Private Key>
BSCSCAN_API_KEY = <Your Bscscan Api Key>

And then run:

npm run deploy

Generate Flattened Contract

npm run flatten

Run Scripts on Server

pm2 start

Check Scripts Logs on Server

pm2 logs