AntelopeIO / DUNES

Docker Utilities for Node Execution
Other
26 stars 17 forks source link

Command line method to set reference-contract version #201

Closed ScottBailey closed 1 year ago

ScottBailey commented 1 year ago

Reference contracts should be pinned to a specific version, but have a CLI override.

Related to #182 and #192

ScottBailey commented 1 year ago

wget example for reference contracts:

#! /bin/sh -e
source ./bootstrap_common.sh

rm -rf reference-contracts || true

# Examples of github urls for branches, tags, and commit hashes:
#   https://github.com/AntelopeIO/reference-contracts/archive/main.tar.gz
#   https://github.com/AntelopeIO/reference-contracts/archive/unkown_misspell.tar.gz
#   https://github.com/AntelopeIO/reference-contracts/archive/2ae64b0b9a9096a3d25339c3df364e08fde66258.tar.gz

# The user may set REFCON_CHECKOUT to a branch, tag, or git commit hash. Default to main if the user opts not to.
if [ -z "${REFCON_CHECKOUT}" ]; then
    REFCON_CHECKOUT=main
fi

# Get the archive, extract the files, then rename the directory.
wget https://github.com/"${ORG}"/reference-contracts/archive/refs/heads/"${REFCON_CHECKOUT}".tar.gz
tar xf "${REFCON_CHECKOUT}".tar.gz
mv reference-contracts-"${REFCON_CHECKOUT}" reference-contracts

# Make the build directory and switch to it
mkdir -p reference-contracts/build
cd reference-contracts/build

# cmake and build
cmake ..
make -j4
ScottBailey commented 1 year ago

Docker file will need ARG_REFCON_CHECKOUT added in a fashion similar to CDT_VERSION. bootstrap.sh will need similar treatment.

ScottBailey commented 1 year ago

Depends on #202