AntelopeIO / DUNES

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

Tie DUNE releases with specific leap, CDT and reference-contracts version #182

Closed mikelik closed 1 year ago

mikelik commented 1 year ago

Right now when preparing a new DUNE release and new image the bootstrap.sh script will always download the latest leap and CDT version.

It causes some issues, i.e. if there were some recent leap config changes we have to incorporate them in the DUNE release (like recently with read-only-read-window-time-us).

To fix this bootstrap.sh needs to have hardcoded leap and CDT version (so specific tag needs to be downloaded). Those versions should be updated every DUNE release. Additionally bootstrap-contracts.sh needs to checkout specific tag (because reference-contracts are dependent on CDT version). Related: https://github.com/AntelopeIO/DUNE/issues/194.

Alternative: Leap, CDT and reference-contracts should downloaded via wget (instead of git clone).

stephenpdeos commented 1 year ago

Related to #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
stephenpdeos commented 1 year ago

The version we will take is the latest version for both CDT and Leap, reference-contracts will be Github commit hash for the current version in main.