dyne / fabchain

FABchain network based on geth + clique
https://fabchain.net
GNU Affero General Public License v3.0
8 stars 4 forks source link

Zenroom and other tools are required for some operations #10

Open sargue opened 2 years ago

sargue commented 2 years ago

Example:

$ make genesis-create
/bin/sh: 1: zenroom: not found
/bin/sh: 1: jq: not found

###########################
now RUN: make genesis-init
###########################

Those tools are probably inside the docker image so instead of trying to run directly on the host perhaps a solution is to run it inside a docker instance mounting the proper paths.

sargue commented 2 years ago

Actually jq is not even part of the docker image so that won't work either.

sargue commented 2 years ago

Once jq is installed on the system this change to the Makefile does the trick:

SCRIPTS := $(realpath ./scripts)

##@ Genesis commands
genesis-create: ## Create data/genesis.json from parameters in scripts/params_genesis.json
    $(if $(wildcard data/genesis.json), $(error Cannot overwrite data/genesis.json))
    $(if $(wildcard scripts/params_genesis.json),,\
        $(error Genesis parameters not found in scripts/params_genesis.json))
    docker run --rm \
     --mount "type=bind,source=${SCRIPTS},destination=/home/geth/scripts" \
     ${DOCKER_IMAGE} \
     zenroom scripts/genesis.lua -a scripts/params_genesis.json | jq . | tee data/genesis.json
    @echo
    @echo "###########################"
    @echo "now RUN: make genesis-init"
    @echo "###########################"
    @echo

I can prepare a PR if you prefer.