.
├── docker-compose.yml # For production deployment
├── docker-compose-dev.yml # For development deployment
|
├── .github/workflows
│ ├── backend.yml # Backend testing workflow
│ ├── frontend.yml # Frontend testing workflow
│ └── blockchain.yml # Smart contract testing workflow
|
├── backend
│ ├── campaignListener
│ | ├── listener.js
│ | └── ...
│ ├── test # Mocha/Chai test files
│ ├── src # Koa/Mongoose.js source files
│ ├── index.js # Main
│ └── ...
|
├── frontend
│ ├── test # Jest test files
│ └── ... # Nuxt.js/Vue.js source files
|
├── blockchain
│ ├── contracts # Solidity source files
│ ├── test # Truffle test files
│ └── ...
|
├── scripts
│ ├── start-eleos.sh # Startup script
│ ├── stop-eleos.sh # Shutdown script
│ └── get-ganache-accounts.sh # Script to get generated wallet accounts
|
├── README.md
├── .gitignore
├── .dockerignore
└── ...
- Ubuntu as deployment/development environment
- Docker
- Docker Compose
- Internet Access
- Clone the repository
git clone https://github.com/IS4302-Eleos/Eleos.git
- Change current working directory to root of the repository:
cd /path/to/Eleos/
- Frontend running on
127.0.0.1:80
- Backend running on
127.0.0.1:8080
- Ganache running on
127.0.0.1:8545
-
Startup Eleos
scripts/start-eleos.sh
Note: The first starup could take quite some time as this script involves building of the necessary Docker images
-
Get list of wallet addresses and private keys
scripts/get-ganache-accounts.sh
-
Interact with the application at
http://localhost:80
-
Shutdown Eleos gracefully
scripts/stop-eleos.sh
- Ubuntu as deployment/development environment
- Node 16+ as our poison
- npm as our seasonings to our poison
- Ganache UI (Optional)
- Docker
- Internet Access
- Ganache running on
127.0.0.1:8545
- MongoDB running on
127.0.0.1:27017
- Koa running on
127.0.0.1:3000
- MongoDB credentials are
test:test
Note: Same steps can be taken for backend
/ frontend
/ blockchain
-
Clone the repository
git clone https://github.com/IS4302-Eleos/Eleos.git
-
Change current working directory to respective directory:
cd /path/to/Eleos/<backend|frontend|blockchain>
-
Install
npm
packages:npm install
Note: Same steps can be taken for backend
/ frontend
/ blockchain
-
Create a new branch (preferably with a descriptive name)
-
Checkout to the new branch
-
Setup the necessary services (e.g
ganache
,mongodb
):# If you have ganache UI installed, configure the RPC server to listen on 127.0.0.1:8545. # But if you do not have ganache GUI installed, docker run --detach \ --publish 8545:8545 \ --name ganache \ trufflesuite/ganache-cli \ -d \ --db /app \ -i eleos \ --accounts 20 \ --deterministic \ --mnemonic="grit portion captain traffic same bacon donate captain brown success impulse security"
docker run --detach \ --publish 27017:27017 \ -e MONGO_INITDB_ROOT_USERNAME=test \ -e MONGO_INITDB_ROOT_PASSWORD=test \ --name mongo mongo
-
Change your current working directory to
/path/to/Eleos/<backend|frontend|blockchain>/
and write your code in it.cd /path/to/Eleos/<backend|frontend|blockchain>/
-
Write your test code in
./test/
-
Run your test code.
npm test
-
Identify codestyle violations in your code.
npm run lint # Reports violations npm run lintfix # Automatically fix violations but up to certain extent
-
Commit and push your code to your remote branch.
-
Create pull request and merge after PR reviews.
We use MetaMask as our Ethereum gateway and wallet management during our development. If you wish to use a different extension, do ensure that it supports Ethers.js.
- Install Metamask and set up a wallet account.
- Enable test networks in Metamask under
Settings > Advanced > Show Test Networks
. - Add the network you plan to use in MetaMask under
Settings > Networks > Add Network
.- If you are planning to run Eleos locally with default settings, you may skip this step as
localhost:8545
will be added by default for you. - The default chain ID is
1337
, you may change it in the Ganache docker environment settings. If you do change it, please rebuild the frontend with the environment variableCHAIN_ID=0x??
where0x??
is the hexadecimal representation of the chain ID you chose.
- If you are planning to run Eleos locally with default settings, you may skip this step as
- Switch your network in MetaMask to your newly added network.
- Import or create the necessary accounts.
scripts/get-ganache-accounts.sh
will provide accounts that contains 100 ETH each in your local Ganache network.
- Go to the frontend webpage (http://localhost/ for production, http://localhost:3000/ for development).