This is the server that provides the backend API for zkCREAM.
- Nodejs ^14.x
- yarn
- docker
- docker-compose
- Submobule update
git clone https://github.com/zkcream/zkcream-api-server.git && \
cd zkcream-api-server && \
git submodule update --init
- Build Docker
./scripts/buildDev.sh
./scripts/start.sh
- Then, you can http request to the endpoint, for example:
curl http://localhost:3000/foo
# response
// {msg:"foo"}
- ubuntu distro
- Submodule update
git clone https://github.com/zkcream/zkcream-api-server.git && \
cd zkcream-api-server && \
git submodule update --init
- Build zkcream
cd zkcream # inside of submodule
yarn
yarn build
-
Build rapidsnark
Install libraries based on rapidsnark's repo
sudo apt install build-essential
sudo apt-get install libgmp-dev
sudo apt-get install libsodium-dev
sudo apt-get install nasm
- Compile rapidsnark
cd rapidsnark
npm install
git submodule init
git submodule update
npx task createFieldSources
npx task buildProver
- Build and run api server
cd ../ # project's top directory
yarn
yarn build
yarn start:redis
yarn start # running at port 3000
Then access {HOST}:{PORT}
http://localhost:3000
for a test environment. You can change the hostname and port number customising the config file.
- You need to run
ganache
andipfs
node and finally migrate the contracts by typing
cd zkcream
# if you haven't built yet, run:
# yarn
# yarn build
yarn workspace @cream/contracts ganache
yarn start:ipfs
yarn workspace @cream/contracts migrate
- Then, after running redis, you can run test command as follows:
cd ../ # project's top directory
yarn start:redis
yarn test