SurfDB Docs
Search
⌃K

Quick Start

Get started with the surfDB
Caution: We are still in very early stage so things can break and change. The docs will be updated frequently.

Install the binary

We need to first install the surf server binary, currently only supported on linux and macos
Linux
MacOS
# download binary and add it to path
curl -L -o surf https://bafybeiaa3iplonzhxgda7zolwwy43pzfe3gqwodxzvzq3ywc7v3tkt4dtu.ipfs.gateway.valist.io/ipfs/bafybeiaa3iplonzhxgda7zolwwy43pzfe3gqwodxzvzq3ywc7v3tkt4dtu/surf-linux
chmod +x surf
sudo cp ./surf /usr/local/bin
curl -L -o surf https://bafybeiaa3iplonzhxgda7zolwwy43pzfe3gqwodxzvzq3ywc7v3tkt4dtu.ipfs.gateway.valist.io/ipfs/bafybeiaa3iplonzhxgda7zolwwy43pzfe3gqwodxzvzq3ywc7v3tkt4dtu/surf-macos
The binary has not been tested on macOS.

Nextjs & Rainbow-kit starter app

You can scaffold a new next.js + Rainbow Kit + wagmi + surfDB using just a single command
Then cd into the app folder and get the mongo and redis database up
docker-compose up -d
Run the binary
surf
# you can provide the following env variables to change the default values
# MONGO_URL="mongodb://root:[email protected]:27017/"
# REDIS_HOST="localhost"
# SURF_PORT="4200"
You should see the following output
Now we can run the app
yarn dev
Homepage

Next Steps

Authenticate yourself with the surf client by clicking on connect wallet.
Then open console and click on create data to create an entry in the database and check the result, then click on get data and see the data you created. You can even check the ceramic streamId given in the result on https://cerscan.com/
Check the api folder to see the api's we have created for data and auth.
Head over to Surf Client page now to check what you can do with the surf client.