Skip to content

Commit

Permalink
Attempt to fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
fmacleal committed Jul 4, 2024
1 parent bb9b23a commit 4b27107
Show file tree
Hide file tree
Showing 10 changed files with 111 additions and 51 deletions.
4 changes: 2 additions & 2 deletions .github/images/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ RUN cd /tmp \

# -- configure entrypoint to run RIT--------------------------------------------

RUN mkdir -p /usr/src/logback
RUN mkdir -p /usr/src/logbacks

WORKDIR /usr/src

COPY entrypoint.sh /usr/src/entrypoint.sh
COPY rit-local-configs/regtest-all-keys.js /usr/src/regtest.js
COPY rit-local-configs/logback/* /usr/src/logback/
COPY rit-local-configs/logbacks/* /usr/src/logbacks/
COPY scripts/* /usr/src/

RUN chmod +x /usr/src/entrypoint.sh \
Expand Down
12 changes: 7 additions & 5 deletions .github/images/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

set -e


echo -e "\n\n--------- Starting the configuration of rskj ---------\n\n"
cd /usr/src/
git clone https://github.com/rsksmart/rskj.git rskj
Expand All @@ -16,7 +15,8 @@ git clone https://github.com/rsksmart/powpeg-node.git powpeg
cp configure_gradle_federator.sh powpeg
cd powpeg && git checkout ${INPUT_FEDERATOR_BRANCH}
chmod +x ./configure.sh && chmod +x gradlew
./configure_gradle_federator.sh
FED_VERSION=$(bash configure_gradle_federator.sh)
echo "FED_VERSION=$FED_VERSION"
./configure.sh
./gradlew --info --no-daemon clean build -x test

Expand All @@ -25,13 +25,13 @@ cd /usr/src/
git clone https://github.com/rsksmart/rootstock-integration-tests.git rit
mv configure_rit_locally.sh rit
mv regtest.js rit/config/regtest.js
mv /usr/src/logback/* /usr/src/rit/logback/
mv /usr/src/logbacks/* /usr/src/rit/logbacks/
cd rit
git checkout ${INPUT_RIT_BRANCH}
chmod +x ./configure.sh
./configure.sh
./configure_rit_locally.sh "$FED_VERSION"
export LOG_LEVEL=$RIT_LOG_LEVEL
./configure_rit_locally.sh "${FED_VERSION}"
export LOG_LEVEL=${RIT_LOG_LEVEL}

echo -e "\n\n--------- Executing Rootstock Integration Tests ---------\n\n"
npm install -y
Expand All @@ -48,3 +48,5 @@ echo -e "$MESSAGE"

echo "status=${STATUS}" >>${GITHUB_OUTPUT}
echo "message=${MESSAGE}" >> ${GITHUB_OUTPUT}

tail -f /dev/null
140 changes: 100 additions & 40 deletions .github/images/rit-local-configs/regtest-all-keys.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,44 +2,7 @@ const path = require('path');
const nodesConfigPath = 'config/node-configs';
const keysPathResolve = 'node-keys';
const classpath = process.env.POWPEG_NODE_JAR_PATH;
const federatesLogbackPath = path.resolve(__dirname, 'logback');

function createPublicKeyEntry(key) {
return { btc: key, rsk: key, mst: key };
}

const publicKeys = [
createPublicKeyEntry('0362634ab57dae9cb373a5d536e66a8c4f67468bbcfb063809bab643072d78a124'),
createPublicKeyEntry('03c5946b3fbae03a654237da863c9ed534e0878657175b132b8ca630f245df04db'),
createPublicKeyEntry('02cd53fc53a07f211641a677d250f6de99caf620e8e77071e811a28b3bcddf0be1'),
createPublicKeyEntry('031da807c71c2f303b7f409dd2605b297ac494a563be3b9ca5f52d95a43d183cc5'),
createPublicKeyEntry('036bb9eab797eadc8b697f0e82a01d01cabbfaaca37e5bafc06fdc6fdd38af894a'),
]

const nodeIds = [
'62634ab57dae9cb373a5d536e66a8c4f67468bbcfb063809bab643072d78a1243bd206c2c7a218d6ff4c9a185e71f066bd354e5267875b7683fbc70a1d455e87',
'c5946b3fbae03a654237da863c9ed534e0878657175b132b8ca630f245df04dbb0bde4f3854613b16032fb214f9cc00f75363976ee078cc4409cdc543036ccfd',
'cd53fc53a07f211641a677d250f6de99caf620e8e77071e811a28b3bcddf0be19e9da12b897b83765fbaebe717fab74fcb1b57c82f7978b8be3296239909e626',
'1da807c71c2f303b7f409dd2605b297ac494a563be3b9ca5f52d95a43d183cc52191fc2bd3b06ece06b68390cbb3ba306284aed9ca7cb61dd6289e66e693126f',
'6bb9eab797eadc8b697f0e82a01d01cabbfaaca37e5bafc06fdc6fdd38af894a9a8cbaf526d344b5df39b80433609e006586050fd2188d30ab000b0fb6a6baaf',
]

const generateFedConfig = (i) => {
nodeIndex = i + 1
logbackFile: `${federatesLogbackPath}/logback-fed.xml`,
classpath: classpath,
configFile: `${nodesConfigPath}/rsk-reg-${nodeIndex}.conf`,
publicKeys: publicKeys[i],
customConfig: {
'federator.signers.BTC.type': 'keyFile',
'federator.signers.BTC.path': path.resolve(__dirname, `${keysPathResolve}/reg${nodeIndex}.key`),
'federator.signers.RSK.type': 'keyFile',
'federator.signers.RSK.path': path.resolve(__dirname, `${keysPathResolve}/regg${nodeIndex}.key`),
'federator.signers.MST.type': 'keyFile',
'federator.signers.MST.path': path.resolve(__dirname, `${keysPathResolve}/regg${nodeIndex}.key`)
},
nodeId: nodeIds[i]
},
const federatesLogbackPath = path.resolve(__dirname, 'logbacks');

module.exports = {
init: {
Expand All @@ -51,6 +14,103 @@ module.exports = {
rpcPassword: 'test',
dir: process.env.BITCOIN_DATA_DIR,
},
federate: [1, 2, 3].map(generateFedConfig),
additionalFederateNodes: [4, 5].map(generateFedConfig),
federate: [
{
logbackFile: `${federatesLogbackPath}/logback-fed-1.xml`,
classpath: classpath,
configFile: `${nodesConfigPath}/rsk-reg-1.conf`,
publicKeys: {
btc: '0362634ab57dae9cb373a5d536e66a8c4f67468bbcfb063809bab643072d78a124',
rsk: '0362634ab57dae9cb373a5d536e66a8c4f67468bbcfb063809bab643072d78a124',
mst: '0362634ab57dae9cb373a5d536e66a8c4f67468bbcfb063809bab643072d78a124',
},
customConfig: {
'federator.signers.BTC.type': 'keyFile',
'federator.signers.BTC.path': path.resolve(__dirname, `${keysPathResolve}/reg1.key`),
'federator.signers.RSK.type': 'keyFile',
'federator.signers.RSK.path': path.resolve(__dirname, `${keysPathResolve}/reg1.key`),
'federator.signers.MST.type': 'keyFile',
'federator.signers.MST.path': path.resolve(__dirname, `${keysPathResolve}/reg1.key`)
},
nodeId: '62634ab57dae9cb373a5d536e66a8c4f67468bbcfb063809bab643072d78a1243bd206c2c7a218d6ff4c9a185e71f066bd354e5267875b7683fbc70a1d455e87'
},
{
logbackFile: `${federatesLogbackPath}/logback-fed-2.xml`,
classpath: classpath,
configFile: `${nodesConfigPath}/rsk-reg-2.conf`,
publicKeys: {
btc: '03c5946b3fbae03a654237da863c9ed534e0878657175b132b8ca630f245df04db',
rsk: '03c5946b3fbae03a654237da863c9ed534e0878657175b132b8ca630f245df04db',
mst: '03c5946b3fbae03a654237da863c9ed534e0878657175b132b8ca630f245df04db',
},
customConfig: {
'federator.signers.BTC.type': 'keyFile',
'federator.signers.BTC.path': path.resolve(__dirname, `${keysPathResolve}/reg2.key`),
'federator.signers.RSK.type': 'keyFile',
'federator.signers.RSK.path': path.resolve(__dirname, `${keysPathResolve}/reg2.key`),
'federator.signers.MST.type': 'keyFile',
'federator.signers.MST.path': path.resolve(__dirname, `${keysPathResolve}/reg2.key`)
},
nodeId: 'c5946b3fbae03a654237da863c9ed534e0878657175b132b8ca630f245df04dbb0bde4f3854613b16032fb214f9cc00f75363976ee078cc4409cdc543036ccfd'
},
{
logbackFile: `${federatesLogbackPath}/logback-fed-3.xml`,
classpath: classpath,
configFile: `${nodesConfigPath}/rsk-reg-3.conf`,
publicKeys: {
btc: '02cd53fc53a07f211641a677d250f6de99caf620e8e77071e811a28b3bcddf0be1',
rsk: '02cd53fc53a07f211641a677d250f6de99caf620e8e77071e811a28b3bcddf0be1',
mst: '02cd53fc53a07f211641a677d250f6de99caf620e8e77071e811a28b3bcddf0be1',
},
customConfig: {
'federator.signers.BTC.type': 'keyFile',
'federator.signers.BTC.path': path.resolve(__dirname, `${keysPathResolve}/reg3.key`),
'federator.signers.RSK.type': 'keyFile',
'federator.signers.RSK.path': path.resolve(__dirname, `${keysPathResolve}/reg3.key`),
'federator.signers.MST.type': 'keyFile',
'federator.signers.MST.path': path.resolve(__dirname, `${keysPathResolve}/reg3.key`)
},
nodeId: 'cd53fc53a07f211641a677d250f6de99caf620e8e77071e811a28b3bcddf0be19e9da12b897b83765fbaebe717fab74fcb1b57c82f7978b8be3296239909e626'
}
],
additionalFederateNodes: [
{
logbackFile: `${federatesLogbackPath}/logback-fed-4.xml`,
classpath: classpath,
configFile: `${nodesConfigPath}/rsk-reg-4.conf`,
publicKeys: {
btc: '031da807c71c2f303b7f409dd2605b297ac494a563be3b9ca5f52d95a43d183cc5',
rsk: '031da807c71c2f303b7f409dd2605b297ac494a563be3b9ca5f52d95a43d183cc5',
mst: '031da807c71c2f303b7f409dd2605b297ac494a563be3b9ca5f52d95a43d183cc5',
},
customConfig: {
'federator.signers.BTC.type': 'keyFile',
'federator.signers.BTC.path': path.resolve(__dirname, `${keysPathResolve}/reg4.key`),
'federator.signers.RSK.type': 'keyFile',
'federator.signers.RSK.path': path.resolve(__dirname, `${keysPathResolve}/reg4.key`),
'federator.signers.MST.type': 'keyFile',
'federator.signers.MST.path': path.resolve(__dirname, `${keysPathResolve}/reg4.key`)
},
nodeId: '1da807c71c2f303b7f409dd2605b297ac494a563be3b9ca5f52d95a43d183cc52191fc2bd3b06ece06b68390cbb3ba306284aed9ca7cb61dd6289e66e693126f'
},
{
logbackFile: `${federatesLogbackPath}/logback-fed-5.xml`,
classpath: classpath,
configFile: `${nodesConfigPath}/rsk-reg-5.conf`,
publicKeys: {
btc: '036bb9eab797eadc8b697f0e82a01d01cabbfaaca37e5bafc06fdc6fdd38af894a',
rsk: '036bb9eab797eadc8b697f0e82a01d01cabbfaaca37e5bafc06fdc6fdd38af894a',
mst: '036bb9eab797eadc8b697f0e82a01d01cabbfaaca37e5bafc06fdc6fdd38af894a',
},
customConfig: {
'federator.signers.BTC.type': 'keyFile',
'federator.signers.BTC.path': path.resolve(__dirname, `${keysPathResolve}/reg5.key`),
'federator.signers.RSK.type': 'keyFile',
'federator.signers.RSK.path': path.resolve(__dirname, `${keysPathResolve}/reg5.key`),
'federator.signers.MST.type': 'keyFile',
'federator.signers.MST.path': path.resolve(__dirname, `${keysPathResolve}/reg5.key`)
},
nodeId: '6bb9eab797eadc8b697f0e82a01d01cabbfaaca37e5bafc06fdc6fdd38af894a9a8cbaf526d344b5df39b80433609e006586050fd2188d30ab000b0fb6a6baaf'
}
]
}
2 changes: 0 additions & 2 deletions .github/images/scripts/configure_gradle_federator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,4 @@ echo "$FED_VERSION"

if [[ $FED_VERSION == SNAPSHOT* || $FED_VERSION == RC* ]]; then
echo -e "$SETTINGS_GRADLE_CONTENT_LOCAL" > DONT-COMMIT-settings.gradle
else
echo "Settings gradle script local not necessary"
fi
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
RSKJ_BRANCH: 'master'
FEDERATOR_BRANCH: 'master'
run: |
docker run \
docker run -v /private/var \
--env RSKJ_BRANCH="${{ env.RSKJ_BRANCH }}" \
--env FEDERATOR_BRANCH="${{ env.FEDERATOR_BRANCH }}" \
--rm ${{ env.TEST_TAG }}
Expand Down Expand Up @@ -90,7 +90,7 @@ jobs:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

#
- name: Test RIT Action
id: test-rit-action
uses: docker://ghcr.io/rsksmart/rootstock-integration-tests/rit:latest
Expand Down

0 comments on commit 4b27107

Please sign in to comment.