Skip to content

Commit

Permalink
update local-node start
Browse files Browse the repository at this point in the history
Signed-off-by: Iliya Savov <[email protected]>
  • Loading branch information
isavov committed Nov 30, 2023
1 parent 72ee1b3 commit 6af67a3
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 21 deletions.
34 changes: 33 additions & 1 deletion .github/workflows/acceptance-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
node-version: 18

- name: Checkout repo
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install packages
run: npm ci
Expand All @@ -48,18 +48,50 @@ jobs:
- name: Build Typescript
run: npx lerna run build

- name: Install hedera local
run: npm install @hashgraph/hedera-local -g

- name: Set operator id and key env variable if CI is manual
if: ${{ inputs.operator_id }}
run: |
echo "OPERATOR_ID_MAIN=${{ inputs.operator_id }}" >> $GITHUB_ENV
echo "OPERATOR_KEY_MAIN=${{ inputs.operator_key }}" >> $GITHUB_ENV
# - name: Setup upterm session
# uses: lhotari/action-upterm@v1
# with:
# ## limits ssh access and adds the ssh public key for the user which triggered the workflow
# limit-access-to-actor: true

- name: Run hedera local
run: hedera restart -d

- name: Stop relay
run: |
docker stop json-rpc-relay json-rpc-relay-ws
# - name: Run hedera local
# run: hedera restart -d

# - name: Stop relay
# run: |
# docker stop json-rpc-relay json-rpc-relay-ws

# - name: Run hedera local
# run: hedera restart -d

# - name: Stop relay
# run: |
# docker stop json-rpc-relay json-rpc-relay-ws

- name: Run acceptance tests
uses: nick-fields/retry@v2
with:
max_attempts: 3
timeout_minutes: 20
command: npm run acceptancetest:${{ inputs.testfilter }}
on_retry_command: scripts/retry_script.sh

env:
TEST_WS_SERVER: ${{ inputs.test_ws_server }}
SUBSCRIPTIONS_ENABLED: ${{ inputs.test_ws_server }}
6 changes: 2 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 16 additions & 16 deletions packages/server/tests/acceptance/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ describe('RPC Server Acceptance Tests', function () {
logger.info(`E2E_RELAY_HOST: ${process.env.E2E_RELAY_HOST}`);

if (USE_LOCAL_NODE === 'true') {
runLocalHederaNetwork();
// runLocalHederaNetwork();
}

if (global.relayIsLocal) {
Expand All @@ -106,7 +106,7 @@ describe('RPC Server Acceptance Tests', function () {
if (USE_LOCAL_NODE === 'true') {
// stop local-node
logger.info('Shutdown local node');
shell.exec('hedera stop');
//shell.exec('hedera stop');
}

//stop relay
Expand Down Expand Up @@ -138,23 +138,23 @@ describe('RPC Server Acceptance Tests', function () {
}
}

function runLocalHederaNetwork() {
// set env variables for docker images until local-node is updated
process.env['NETWORK_NODE_IMAGE_TAG'] = '0.45.0-alpha.0';
process.env['HAVEGED_IMAGE_TAG'] = '0.45.0-alpha.0';
process.env['MIRROR_IMAGE_TAG'] = '0.92.0';
// function runLocalHederaNetwork() {
// // set env variables for docker images until local-node is updated
// process.env['NETWORK_NODE_IMAGE_TAG'] = '0.45.0-alpha.0';
// process.env['HAVEGED_IMAGE_TAG'] = '0.45.0-alpha.0';
// process.env['MIRROR_IMAGE_TAG'] = '0.92.0';

console.log(
`Docker container versions, services: ${process.env['NETWORK_NODE_IMAGE_TAG']}, mirror: ${process.env['MIRROR_IMAGE_TAG']}`,
);
// console.log(
// `Docker container versions, services: ${process.env['NETWORK_NODE_IMAGE_TAG']}, mirror: ${process.env['MIRROR_IMAGE_TAG']}`,
// );

console.log('Installing local node...');
shell.exec(`npm install @hashgraph/hedera-local -g`);
// console.log('Installing local node...');
// shell.exec(`npm install @hashgraph/hedera-local -g`);

console.log('Starting local node...');
shell.exec(`hedera start -d`);
console.log('Hedera Hashgraph local node env started');
}
// console.log('Starting local node...');
// shell.exec(`hedera start -d`);
// console.log('Hedera Hashgraph local node env started');
// }

function runLocalRelay() {
// start local relay, stop relay instance in local
Expand Down
10 changes: 10 additions & 0 deletions scripts/retry_script.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
set -v
set +e
hedera stop
sleep 5
ls -lah $(dirname $(readlink -f $(which hedera)))/../network-logs
sudo rm -rf $(dirname $(readlink -f $(which hedera)))/../network-logs
sleep 5
hedera restart -d
docker stop json-rpc-relay json-rpc-relay-ws

0 comments on commit 6af67a3

Please sign in to comment.