Skip to content

Instantly share code, notes, and snippets.

@IgorShadurin
Last active July 10, 2021 19:36
Show Gist options
  • Save IgorShadurin/3d9ba1192778c07c91d3fcc9f98a7b84 to your computer and use it in GitHub Desktop.
Save IgorShadurin/3d9ba1192778c07c91d3fcc9f98a7b84 to your computer and use it in GitHub Desktop.
Fairdrive spin up with Fullstack

Installing Fairdrive + Fullstack (bee + fairOS) for local testing

1 - Ensure that you have installed (docker, git, wget). Check that ports 3000, 1633, 1634, 1635 are available.

2 - Install bee + fairos:

mkdir bee-fairos

cd bee-fairos

wget https://gist.github.com/IgorShadurin/3d9ba1192778c07c91d3fcc9f98a7b84/raw/f8ca14eca0e4c038d6dfa8229179173a86b36b32/docker-compose.yml

docker compose up or docker-compose up

Wait message about funding like that "bee-1_1 | time="2021-07-10T18:51:54Z" level=warning msg="get your Goerli ETH and Goerli BZZ now via the bzzaar at https://bzz.ethswarm.org/?transaction=buy&amount=10&slippage=30&receiver=0xab0a2e21e53889481b2af53950baa0f530d58c55". Wallet in this example is 0xab0a2e21e53889481b2af53950baa0f530d58c55.

Copy wallet from YOUR logs.

Open official SWARM faucet https://discord.com/channels/799027393297514537/841664915218628619 and fund your wallet with 10 gBzz + 0.5 gEth from https://faucet.goerli.mudit.blog/

If Docker with bee + fairos closed before you fund, please run "docker compose up" again.

Wait until bee will deploy cheqbook and this message appears "fairos_1 | time="2021-07-10T19:30:11Z" level=info msg="fairOS-dfs API server listening on port: 9090""

Open http://localhost:9090 in your browser and you can see few lines with information about fairOS. These lines will appear only after chequbook deployment.

3 - Clone fairdrive and install all dependencies into Docker image with this command

curl -sSL https://gist.github.com/IgorShadurin/3d9ba1192778c07c91d3fcc9f98a7b84/raw/9b2c6064b191fa5d0eb6ff94022cfcae677b3b53/install-fairdrive.sh | sh

4 - Run prepared Docker container with docker run --rm -it -p 3000:3000 fairdrive start

5 - Open http://localhost:3000 in your browser

version: '3'
services:
bee-1:
image: ethersphere/bee:0.5.2
restart: unless-stopped
environment:
- BEE_API_ADDR
- BEE_BLOCK_TIME
- BEE_BOOTNODE
- BEE_BOOTNODE_MODE
- BEE_CLEF_SIGNER_ENABLE=false
- BEE_CLEF_SIGNER_ENDPOINT=http://clef-1:8550
- BEE_CONFIG
- BEE_CORS_ALLOWED_ORIGINS
- BEE_DATA_DIR
- BEE_CACHE_CAPACITY
- BEE_DB_OPEN_FILES_LIMIT
- BEE_DB_BLOCK_CACHE_CAPACITY
- BEE_DB_WRITE_BUFFER_SIZE
- BEE_DB_DISABLE_SEEKS_COMPACTION
- BEE_DEBUG_API_ADDR
- BEE_DEBUG_API_ENABLE
- BEE_GATEWAY_MODE
- BEE_GLOBAL_PINNING_ENABLE
- BEE_FULL_NODE
- BEE_NAT_ADDR
- BEE_NETWORK_ID
- BEE_P2P_ADDR
- BEE_P2P_QUIC_ENABLE
- BEE_P2P_WS_ENABLE
- BEE_PASSWORD=test
- BEE_PASSWORD_FILE
- BEE_PAYMENT_EARLY
- BEE_PAYMENT_THRESHOLD
- BEE_PAYMENT_TOLERANCE
- BEE_POSTAGE_STAMP_ADDRESS
- BEE_RESOLVER_OPTIONS
- BEE_STANDALONE
- BEE_SWAP_ENABLE
- BEE_SWAP_ENDPOINT=https://goerli.infura.io/v3/d6b35821fc8642029a0ecf34b116ab30
- BEE_SWAP_FACTORY_ADDRESS
- BEE_SWAP_LEGACY_FACTORY_ADDRESSES
- BEE_SWAP_INITIAL_DEPOSIT
- BEE_SWAP_DEPLOYMENT_GAS_PRICE
- BEE_TRACING_ENABLE
- BEE_TRACING_ENDPOINT
- BEE_TRACING_SERVICE_NAME
- BEE_TRANSACTION
- BEE_VERBOSITY
- BEE_WELCOME_MESSAGE
- BEE_MAINNET
ports:
- "${API_ADDR:-1633}${BEE_API_ADDR:-:1633}"
- "${P2P_ADDR:-1634}${BEE_P2P_ADDR:-:1634}"
- "${DEBUG_API_ADDR:-127.0.0.1:1635}${BEE_DEBUG_API_ADDR:-:1635}"
volumes:
- bee-1:/home/bee/.bee
command: start
fairos:
image: fairdatasociety/fairos-dfs:latest
restart: unless-stopped
ports:
- '9090:9090'
command: --cors-origins "http://localhost:3000" --beeHost "bee-1" --cookieDomain "localhost"
depends_on:
- bee-1
volumes:
bee-1:
#FROM node:16-alpine
FROM node:16
#RUN apk update && apk add --no-cache git
WORKDIR /app
COPY package.json ./
RUN yarn
COPY . .
RUN echo "REACT_APP_FAIROSHOST=http://localhost:9090/v1/" >> .env
RUN echo "REACT_APP_FAIRDRIVEHOST=http://localhost:3000" >> .env
RUN echo "REACT_APP_NAME=Fairdrive" >> .env
EXPOSE 3000
ENTRYPOINT ["yarn"]
FROM golang:1.16 AS build
WORKDIR /usr/fairos
# enable modules caching in separate layer
COPY go.mod go.sum /usr/fairos/
RUN go mod download
COPY . /usr/fairos/
RUN make binary
FROM debian:10.9-slim
EXPOSE 9090
COPY --from=build /usr/fairos/dist/dfs /usr/local/bin/dfs
COPY --from=build /usr/fairos/dist/dfs-cli /usr/local/bin/dfs-cli
ENTRYPOINT ["dfs"]
git clone https://github.com/fairDataSociety/fairdrive-theapp.git && cd fairdrive-theapp/app && wget https://gist.github.com/IgorShadurin/3d9ba1192778c07c91d3fcc9f98a7b84/raw/e96ba267e91394ef3dd28f0dad4a56c11a2700ed/Dockerfile-fairdrive -O Dockerfile && docker build -t fairdrive .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment