Skip to content

Instantly share code, notes, and snippets.

@JacobPlaster
Last active March 26, 2020 17:31
Show Gist options
  • Save JacobPlaster/450ef46065bed56633b35f04b935526d to your computer and use it in GitHub Desktop.
Save JacobPlaster/450ef46065bed56633b35f04b935526d to your computer and use it in GitHub Desktop.
Starkware committee node

Clone repo

git clone https://github.com/starkware-libs/starkex-resources
./build.sh
cd build/Release/committee

Generate TLS certs

mkdir certs

Create ssl config using eth pubkey (CN = pubkey)

echo "[req]
default_bits = 2048
prompt = no
default_md = sha256
distinguished_name = dn

[ dn ]
CN = YOUR_ETH_PUBKEY
" >> ./certs/user.conf
openssl genrsa -out ./certs/user.key 4096
openssl req -new -key ./certs/user.key -out ./certs/user.csr -config ./certs/user.conf

Add ETH privatekey to txt file

rm private_key.txt
echo "YOUR_ETH_PRIVATEKEY" >> ./private_key.txt

Update committee config

vim ./config.yml

# uncomment CERTIFICATES_PATH

Edit docker-compose script to mount certificates

vim ./docker-compose.yml

# change the volumes to:
 volumes:
    - ./config.yml:/config.yml:ro
    - ./private_key.txt:/private_key.txt:ro
    - ./certs:/certs:ro

Enable persistent memory on aerospike

vim ../aerospike/aerospike.conf

# add this device to namespace starkware
storage-engine device {
    file /opt/aerospike/data/aerospike_starkware.dat
    filesize 40G
    data-in-memory true # Store data in memory in addition to file.
}

Add aerospike volume to docker-compose.yml and the starkware availability gateway

touch ../aerospike/aerospike_starkware.dat
vim docker-compose.yml

version: "3.3"
services:
  committee-aerospike:
    image: aerospike/aerospike-server:4.7.0.5
    command: ["--config-file","/etc/aerospike.conf"]
    hostname: aerospike
    ports:
      - "3000:3000"
    volumes:
      - ../aerospike/aerospike.conf:/etc/aerospike.conf:ro
      - ../aerospike/aerospike_starkware.dat:/opt/aerospike/data/aerospike_starkware.dat
  committee:
    build:
      context: ../
      dockerfile: committee/Dockerfile
    volumes:
      - ./config.yml:/config.yml:ro
      - ./private_key.txt:/private_key.txt:ro
      - ./certs:/certs:ro
    depends_on:
      - committee-aerospike
    environment:
      AVAILABILITY_GW_ENDPOINT: "https://availability-devnet.starkex.co"

Start docker containers

docker-compose build
docker-compose up
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment