Quick Started for developing and testing on Ubuntu(22.04)
Install Rust on your Ubuntu machine.
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
// Configure the Environment Variable
source $HOME/.cargo/env
// check your version
rustc --version
Clone mega repository and build it.
git clone https://github.com/web3infra-foundation/mega.git
cd mega
cargo build
Install PostgreSQL and init database.
-
install PostgreSQL
-
create database,then find the dump file in the SQL directory of the Mega repository and import it into the database.
-
Create user and grant privileges.
-
Install redis.
-
Config environment variables for local test. For local testing, Mega uses the .env file to configure the required parameters. However, before starting the project, you also need to configure the environment variables such as
DB_USERNAME
,DB_SECRET
, andDB_HOST
. -
init the Mega
cd mega cargo run init
-
Start the Mega server for tesing
cargo run https
-
Test the
git push
andgit clone
cd mega git remote add local http://localhost:8000/projects/mega.git git push local main cd / && mkdir temp_git cd temp_git git clone http://localhost:8000/projects/mega.git