Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: stop using node0 at the first node name #538

Merged
merged 10 commits into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/flow-update-readme.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ jobs:

export KIND_CREATE_CLUSTER_OUTPUT=$( kind create cluster -n "${SOLO_CLUSTER_NAME}" 2>&1 | tee test.log )

export SOLO_INIT_OUTPUT=$( solo init -t v0.42.5 -i node0,node1,node2 -n "${SOLO_NAMESPACE}" -s \
export SOLO_INIT_OUTPUT=$( solo init -t v0.42.5 -i node1,node2,node3 -n "${SOLO_NAMESPACE}" -s \
"${SOLO_CLUSTER_SETUP_NAMESPACE}" --key-format pfx | tee test.log )

export SOLO_NODE_KEYS_OUTPUT=$( solo node keys --gossip-keys --tls-keys --key-format pfx | tee test.log )
Expand All @@ -111,9 +111,9 @@ jobs:

export SOLO_MIRROR_NODE_DEPLOY_OUTPUT=$( solo mirror-node deploy | tee test.log )

export SOLO_RELAY_DEPLAY_OUTPUT=$( solo relay deploy -i node0,node1 | tee test.log )
export SOLO_RELAY_DEPLAY_OUTPUT=$( solo relay deploy -i node1,node2 | tee test.log )

export SOLO_INIT_047_OUTPUT=$( solo init -t v0.48.0-alpha.0 -i node0,node1,node2 -n "${SOLO_NAMESPACE}" \
export SOLO_INIT_047_OUTPUT=$( solo init -t v0.48.0-alpha.0 -i node1,node2,node3 -n "${SOLO_NAMESPACE}" \
-s "${SOLO_CLUSTER_SETUP_NAMESPACE}" --key-format pem | tee test.log )

export SOLO_NODE_KEY_PEM_OUTPUT=$( solo node keys --gossip-keys --tls-keys --key-format pem | tee test.log )
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/script/relay_smoke_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ echo "Starting test network with a single node"

./test/e2e/setup-e2e.sh
solo network deploy
solo node keys --gossip-keys --tls-keys --key-format pfx -i node0
solo node setup -i node0
solo node start -i node0
solo node keys --gossip-keys --tls-keys --key-format pfx -i node1
solo node setup -i node1
solo node start -i node1
solo mirror-node deploy
solo relay deploy -i node0
kubectl port-forward svc/relay-node0-hedera-json-rpc-relay -n solo-e2e 7546:7546 &
kubectl port-forward svc/haproxy-node0-svc -n solo-e2e 50211:50211 &
solo relay deploy -i node1
kubectl port-forward svc/relay-node1-hedera-json-rpc-relay -n solo-e2e 7546:7546 &
kubectl port-forward svc/haproxy-node1-svc -n solo-e2e 50211:50211 &
kubectl port-forward svc/fullstack-deployment-hedera-explorer -n solo-e2e 8080:80 &

echo "Clone hedera local node"
Expand Down
23 changes: 12 additions & 11 deletions README.md.template
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,10 @@ You may now view pods in your cluster using `k9s -A` as below:

### Example - 1: Deploy a standalone test network (version `0.42.5`)

* Initialize `solo` with tag `v0.42.5` and list of node names `node0,node1,node2`:
* Initialize `solo` with tag `v0.42.5` and list of node names `node1,node2,node3`:

```
$ solo init -t v0.42.5 -i node0,node1,node2 -n "${SOLO_NAMESPACE}" -s "${SOLO_CLUSTER_SETUP_NAMESPACE}" --key-format pfx
$ solo init -t v0.42.5 -i node1,node2,node3 -n "${SOLO_NAMESPACE}" -s "${SOLO_CLUSTER_SETUP_NAMESPACE}" --key-format pfx
```

Example output
Expand All @@ -140,8 +140,8 @@ Key files are generated in `~/.solo/keys` directory.
```
$ ls ~/.solo/cache/keys

hedera-node0.crt hedera-node1.crt hedera-node2.crt private-node0.pfx private-node2.pfx
hedera-node0.key hedera-node1.key hedera-node2.key private-node1.pfx public.pfx
hedera-node1.crt hedera-node2.crt hedera-node3.crt private-node1.pfx private-node3.pfx
hedera-node1.key hedera-node2.key hedera-node3.key private-node2.pfx public.pfx
```
* Setup cluster with shared components
* In a separate terminal, you may run `k9s` to view the pod status.
Expand Down Expand Up @@ -271,7 +271,7 @@ Once the nodes are up, you may now expose various services (using `k9s` (shift-f
* JSON Rpc Relays
* You can deploy JSON RPC relays for one or more nodes as below:
```
$ solo relay deploy -i node0,node1
$ solo relay deploy -i node1,node2
```

Example output
Expand All @@ -282,13 +282,13 @@ $SOLO_RELAY_DEPLAY_OUTPUT

### Example - 2: Deploy a standalone test network (version `0.47.0-alpha.0`)

* Initialize `solo` with tag `v0.47.0-alpha.0` and list of node names `node0,node1,node2`:
* Initialize `solo` with tag `v0.47.0-alpha.0` and list of node names `node1,node2,node3`:

```
# reset .solo directory
$ rm -rf ~/.solo

$ solo init -t v0.47.0-alpha.0 -i node0,node1,node2 -n "${SOLO_NAMESPACE}" -s "${SOLO_CLUSTER_SETUP_NAMESPACE}" --key-format pem
$ solo init -t v0.47.0-alpha.0 -i node1,node2,node3 -n "${SOLO_NAMESPACE}" -s "${SOLO_CLUSTER_SETUP_NAMESPACE}" --key-format pem
```

* Example output
Expand All @@ -311,10 +311,11 @@ $SOLO_NODE_KEY_PEM_OUTPUT
PEM key files are generated in `~/.solo/keys` directory.
```
$ ls ~/.solo/cache/keys
a-private-node0.pem a-public-node1.pem hedera-node1.crt s-private-node0.pem s-public-node1.pem
a-private-node1.pem a-public-node2.pem hedera-node1.key s-private-node1.pem s-public-node2.pem
a-private-node2.pem hedera-node0.crt hedera-node2.crt s-private-node2.pem
a-public-node0.pem hedera-node0.key hedera-node2.key s-public-node0.pem
a-private-node1.pem a-private-node3.pem a-public-node2.pem hedera-node1.crt
hedera-node2.crt hedera-node3.crt s-private-node1.pem s-private-node3.pem
s-public-node2.pem unused-gossip-pem/
a-private-node2.pem a-public-node1.pem a-public-node3.pem hedera-node1.key
hedera-node2.key hedera-node3.key s-private-node2.pem s-public-node1.pem s-public-node3.pem unused-tls/
```
* Setup cluster with shared components

Expand Down
2 changes: 1 addition & 1 deletion src/commands/prompts.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export async function promptClusterSetupNamespace (task, input) {

export async function promptNodeIds (task, input) {
return await prompt('input', task, input,
'node0,node1,node2',
'node1,node2,node3',
'Enter list of node IDs (comma separated list): ',
null,
flags.nodeIDs.name)
Expand Down
3 changes: 0 additions & 3 deletions src/core/templates.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ export class Templates {
* @returns {string}
*/
static renderGossipPemPrivateKeyFile (prefix, nodeId) {
// s-node0-key.pem
return `${prefix}-private-${nodeId}.pem`
}

Expand All @@ -79,7 +78,6 @@ export class Templates {
* @returns {string}
*/
static renderGossipPemPublicKeyFile (prefix, nodeId) {
// s-node0-cert.pem
return `${prefix}-public-${nodeId}.pem`
}

Expand All @@ -96,7 +94,6 @@ export class Templates {
* @returns {string}
*/
static renderTLSPemPublicKeyFile (nodeId) {
// s-node0-cert.pem
return `hedera-${nodeId}.crt`
}

Expand Down
2 changes: 1 addition & 1 deletion test/e2e/commands/account.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ describe('AccountCommand', () => {
argv[flags.namespace.name] = namespace
argv[flags.releaseTag.name] = HEDERA_PLATFORM_VERSION_TAG
argv[flags.keyFormat.name] = constants.KEY_FORMAT_PEM
argv[flags.nodeIDs.name] = 'node0'
argv[flags.nodeIDs.name] = 'node1'
argv[flags.generateGossipKeys.name] = true
argv[flags.generateTlsKeys.name] = true
argv[flags.clusterName.name] = TEST_CLUSTER
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/commands/cluster.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ describe('ClusterCommand', () => {
argv[flags.namespace.name] = namespace
argv[flags.releaseTag.name] = HEDERA_PLATFORM_VERSION_TAG
argv[flags.keyFormat.name] = constants.KEY_FORMAT_PEM
argv[flags.nodeIDs.name] = 'node0'
argv[flags.nodeIDs.name] = 'node1'
argv[flags.generateGossipKeys.name] = true
argv[flags.generateTlsKeys.name] = true
argv[flags.clusterName.name] = TEST_CLUSTER
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/commands/mirror_node.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ describe('MirrorNodeCommand', () => {
argv[flags.releaseTag.name] = HEDERA_PLATFORM_VERSION_TAG
argv[flags.keyFormat.name] = constants.KEY_FORMAT_PEM

argv[flags.nodeIDs.name] = 'node0' // use a single node to reduce resource during e2e tests
argv[flags.nodeIDs.name] = 'node1' // use a single node to reduce resource during e2e tests
argv[flags.generateGossipKeys.name] = true
argv[flags.generateTlsKeys.name] = true
argv[flags.clusterName.name] = TEST_CLUSTER
Expand Down
6 changes: 3 additions & 3 deletions test/e2e/commands/network.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ describe('NetworkCommand', () => {
argv[flags.namespace.name] = namespace
argv[flags.releaseTag.name] = HEDERA_PLATFORM_VERSION_TAG
argv[flags.keyFormat.name] = constants.KEY_FORMAT_PEM
argv[flags.nodeIDs.name] = 'node0'
argv[flags.nodeIDs.name] = 'node1'
argv[flags.generateGossipKeys.name] = true
argv[flags.generateTlsKeys.name] = true
argv[flags.deployMinio.name] = true
Expand Down Expand Up @@ -87,8 +87,8 @@ describe('NetworkCommand', () => {
await expect(networkCmd.deploy(argv)).resolves.toBeTruthy()

// check pod names should match expected values
await expect(k8.getPodByName('network-node0-0'))
.resolves.toHaveProperty('metadata.name', 'network-node0-0')
await expect(k8.getPodByName('network-node1-0'))
.resolves.toHaveProperty('metadata.name', 'network-node1-0')
// get list of pvc using k8 listPvcsByNamespace function and print to log
const pvcs = await k8.listPvcsByNamespace(namespace)
networkCmd.logger.showList('PVCs', pvcs)
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/commands/node-add-local.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ import { describe } from '@jest/globals'
import { testNodeAdd } from '../../test_add.mjs'

describe('Node add with hedera local build', () => {
const localBuildPath = 'node0=../hedera-services/hedera-node/data/,../hedera-services/hedera-node/data,node2=../hedera-services/hedera-node/data'
const localBuildPath = 'node1=../hedera-services/hedera-node/data/,../hedera-services/hedera-node/data,node3=../hedera-services/hedera-node/data'
testNodeAdd(localBuildPath)
}, 180000)
4 changes: 2 additions & 2 deletions test/e2e/commands/node-local-hedera.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describe('Node local build', () => {
const LOCAL_HEDERA = 'local-hedera-app'
const argv = getDefaultArgv()
argv[flags.keyFormat.name] = constants.KEY_FORMAT_PFX
argv[flags.nodeIDs.name] = 'node0,node1,node2'
argv[flags.nodeIDs.name] = 'node1,node2,node3'
argv[flags.generateGossipKeys.name] = true
argv[flags.generateTlsKeys.name] = true
argv[flags.clusterName.name] = TEST_CLUSTER
Expand All @@ -48,7 +48,7 @@ describe('Node local build', () => {

describe('Node for hedera app should start successfully', () => {
console.log('Starting local build for Hedera app')
argv[flags.localBuildPath.name] = 'node0=../hedera-services/hedera-node/data/,../hedera-services/hedera-node/data,node2=../hedera-services/hedera-node/data'
argv[flags.localBuildPath.name] = 'node1=../hedera-services/hedera-node/data/,../hedera-services/hedera-node/data,node3=../hedera-services/hedera-node/data'
argv[flags.namespace.name] = LOCAL_HEDERA
const bootstrapResp = bootstrapNetwork(LOCAL_HEDERA, argv)
hederaK8 = bootstrapResp.opts.k8
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/commands/node-local-ptt.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ describe('Node local build', () => {
const LOCAL_PTT = 'local-ptt-app'
const argv = getDefaultArgv()
argv[flags.keyFormat.name] = constants.KEY_FORMAT_PFX
argv[flags.nodeIDs.name] = 'node0,node1,node2'
argv[flags.nodeIDs.name] = 'node1,node2,node3'
argv[flags.generateGossipKeys.name] = true
argv[flags.generateTlsKeys.name] = true
argv[flags.clusterName.name] = TEST_CLUSTER
Expand Down
6 changes: 3 additions & 3 deletions test/e2e/commands/relay.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ describe('RelayCommand', () => {
argv[flags.releaseTag.name] = HEDERA_PLATFORM_VERSION_TAG
argv[flags.keyFormat.name] = constants.KEY_FORMAT_PEM

argv[flags.nodeIDs.name] = 'node0,node1'
argv[flags.nodeIDs.name] = 'node1,node2'
argv[flags.generateGossipKeys.name] = true
argv[flags.generateTlsKeys.name] = true
argv[flags.clusterName.name] = TEST_CLUSTER
Expand All @@ -67,8 +67,8 @@ describe('RelayCommand', () => {
})

it.each([
{ relayNodes: 'node0' },
{ relayNodes: 'node0,node1' }
{ relayNodes: 'node1' },
{ relayNodes: 'node1,node2' }
])('relay deploy and destroy should work with different number of relay nodes', async (input) => {
argv[flags.nodeIDs.name] = input.relayNodes
configManager.update(argv)
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/core/account_manager.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ describe('AccountManager', () => {
const namespace = 'account-mngr-e2e'
const argv = getDefaultArgv()
argv[flags.namespace.name] = namespace
argv[flags.nodeIDs.name] = 'node0'
argv[flags.nodeIDs.name] = 'node1'
argv[flags.clusterName.name] = TEST_CLUSTER
argv[flags.fstChartVersion.name] = version.FST_CHART_VERSION
argv[flags.generateGossipKeys.name] = true
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/core/k8_e2e.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ describe('K8', () => {
}, defaultTimeout)

it('should be able to port forward gossip port', (done) => {
const podName = Templates.renderNetworkPodName('node0')
const podName = Templates.renderNetworkPodName('node1')
const localPort = constants.HEDERA_NODE_INTERNAL_GOSSIP_PORT
try {
k8.portForward(podName, localPort, constants.HEDERA_NODE_INTERNAL_GOSSIP_PORT).then((server) => {
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/core/platform_installer_e2e.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ describe('PackageInstallerE2E', () => {
const testCacheDir = getTestCacheDir()
argv[flags.cacheDir.name] = testCacheDir
argv[flags.namespace.name] = namespace
argv[flags.nodeIDs.name] = 'node0'
argv[flags.nodeIDs.name] = 'node1'
argv[flags.clusterName.name] = TEST_CLUSTER
argv[flags.fstChartVersion.name] = version.FST_CHART_VERSION
argv[flags.generateGossipKeys.name] = true
Expand All @@ -48,7 +48,7 @@ describe('PackageInstallerE2E', () => {
const accountManager = bootstrapResp.opts.accountManager
const configManager = bootstrapResp.opts.configManager
const installer = bootstrapResp.opts.platformInstaller
const podName = 'network-node0-0'
const podName = 'network-node1-0'
const packageVersion = 'v0.42.5'

afterAll(async () => {
Expand Down
6 changes: 3 additions & 3 deletions test/e2e/e2e_node_util.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export function e2eNodeKeyRefreshTest (keyFormat, testName, mode, releaseTag = H
argv[flags.namespace.name] = namespace
argv[flags.releaseTag.name] = releaseTag
argv[flags.keyFormat.name] = keyFormat
argv[flags.nodeIDs.name] = 'node0,node1,node2'
argv[flags.nodeIDs.name] = 'node1,node2,node3'
argv[flags.generateGossipKeys.name] = true
argv[flags.generateTlsKeys.name] = true
argv[flags.clusterName.name] = TEST_CLUSTER
Expand Down Expand Up @@ -86,7 +86,7 @@ export function e2eNodeKeyRefreshTest (keyFormat, testName, mode, releaseTag = H

try {
await expect(k8.waitForPodReady(
['app=haproxy-node0',
['app=haproxy-node1',
'fullstack.hedera.com/type=haproxy'],
1, 300, 1000)).resolves.toBeTruthy()
} catch (e) {
Expand All @@ -101,7 +101,7 @@ export function e2eNodeKeyRefreshTest (keyFormat, testName, mode, releaseTag = H
describe(
`Node should refresh successfully [mode ${mode}, release ${releaseTag}, keyFormat: ${keyFormat}]`,
() => {
const nodeId = 'node0'
const nodeId = 'node1'

beforeAll(async () => {
const podName = await nodeRefreshTestSetup(argv, testName, k8,
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/setup-e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ kind create cluster -n "${SOLO_CLUSTER_NAME}" --image "${KIND_IMAGE}" || exit 1
# Init and deploy a network for e2e tests in (test/e2e/core)
# -d ${SOLO_CHARTS_DIR} is optional, if you want to use a local chart, it will be ignored if not set
# **********************************************************************************************************************
solo init --namespace "${SOLO_NAMESPACE}" -i node0 -s "${SOLO_CLUSTER_SETUP_NAMESPACE}" -d "${SOLO_FST_CHARTS_DIR}" --dev || exit 1 # cache args for subsequent commands
solo init --namespace "${SOLO_NAMESPACE}" -i node1 -s "${SOLO_CLUSTER_SETUP_NAMESPACE}" -d "${SOLO_FST_CHARTS_DIR}" --dev || exit 1 # cache args for subsequent commands
solo cluster setup || exit 1
helm list --all-namespaces
2 changes: 1 addition & 1 deletion test/scripts/gen-legacy-keys.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#

keysDir="${HOME}/.solo/cache/keys"
ids="node0,node1,node2"
ids="node1,node2,node3"
validity=36524 # number of days
keytool_path="${HOME}/.solo/bin/jre/bin/keytool"

Expand Down
4 changes: 2 additions & 2 deletions test/scripts/gen-openssl-keys.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

keysDir="${HOME}/.solo/cache/keys"
ids="node0,node1,node2"
ids="node1,node2,node3"
validity=36524 # number of days
generate_pfx=false

Expand Down Expand Up @@ -162,7 +162,7 @@ function generate_pfx_files() {
echo "------------------------------------------------------------------------------------"
echo "Generated: ${cert_pfx}"
echo "------------------------------------------------------------------------------------"
#openssl pkcs12 -info -in a-public-node0.pfx -passin pass:password -passout pass:password -nokeys
#openssl pkcs12 -info -in a-public-node1.pfx -passin pass:password -passout pass:password -nokeys
openssl pkcs12 -info -in "${cert_pfx}" -passin pass:"${dummy_password}" -passout pass:"${dummy_password}" -nokeys
}

Expand Down
8 changes: 4 additions & 4 deletions test/unit/core/helpers.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ describe('Helpers', () => {
output: []
},
{
input: 'node0',
output: ['node0']
input: 'node1',
output: ['node1']
},
{
input: 'node0,node2',
output: ['node0', 'node2']
input: 'node1,node3',
output: ['node1', 'node3']
}
])('should be able to parse node ID', (t) => {
expect(helpers.parseNodeIds(t.input)).toStrictEqual(t.output)
Expand Down
6 changes: 3 additions & 3 deletions test/unit/core/key_manager.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ describe('KeyManager', () => {

it('should generate signing key', async () => {
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'keys-'))
const nodeId = 'node0'
const nodeId = 'node1'
const keyPrefix = constants.SIGNING_KEY_PREFIX

const signingKey = await keyManager.generateSigningKey(nodeId)
Expand Down Expand Up @@ -80,7 +80,7 @@ describe('KeyManager', () => {

it('should generate TLS key', async () => {
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'keys-'))
const nodeId = 'node0'
const nodeId = 'node1'
const keyName = 'TLS'

const tlsKey = await keyManager.generateGrpcTLSKey(nodeId)
Expand Down Expand Up @@ -111,7 +111,7 @@ describe('KeyManager', () => {
it('should generate pfx keys', async () => {
const keysDir = getTmpDir()
const tmpDir = getTmpDir()
const nodeIds = ['node0', 'node1', 'node2']
const nodeIds = ['node1', 'node2', 'node3']
const downloader = new PackageDownloader(testLogger)
const zippy = new Zippy(testLogger)
const keytoolDepManager = new KeytoolDependencyManager(downloader, zippy, testLogger)
Expand Down
Loading
Loading