Skip to content

Commit b0e139f

Browse files
committed
Merge commit '473a650730efa401a23305579534254654425354' into 01081-D-explorer
Signed-off-by: Jeffrey Tang <[email protected]> # Conflicts: # src/commands/mirror_node.ts
2 parents 6944087 + 473a650 commit b0e139f

31 files changed

+430
-194
lines changed

.github/workflows/flow-task-test.yaml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ jobs:
3838
example-task-file-test:
3939
timeout-minutes: 20
4040
runs-on: solo-linux-large
41+
strategy:
42+
matrix:
43+
type: ["NO_ACCOUNT_INIT", "ACCOUNT_INIT"]
4144
steps:
4245
- name: Harden Runner
4346
uses: step-security/harden-runner@c95a14d0e5bab51a9f56296a4eb0e416910cd350 # v2.10.3
@@ -53,6 +56,11 @@ jobs:
5356
node-version: 20
5457
cache: npm
5558

59+
- name: Setup Helm
60+
uses: azure/setup-helm@fe7b79cd5ee1e45176fcad797de68ecaf3ca4814 # v4.2.0
61+
with:
62+
version: "v3.12.3" # helm version
63+
5664
- name: Setup Kind
5765
uses: helm/kind-action@a1b0e391336a6ee6713a0583f8c6240d70863de3 # v1.12.0
5866
with:
@@ -63,9 +71,9 @@ jobs:
6371
verbosity: 3
6472
wait: 120s
6573

66-
- name: Run Example Task File Test
74+
- name: Run Example Task File Test with type ${{ matrix.type }}
6775
run: |
68-
task default-with-relay
69-
sleep 10
70-
.github/workflows/script/solo_smoke_test.sh
76+
export CONSENSUS_NODE_VERSION=v0.58.3
77+
task default
78+
.github/workflows/script/solo_smoke_test.sh ${{ matrix.type }}
7179
task clean

.github/workflows/script/helper.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ function create_test_account ()
1414

1515
# get private key of the account
1616
npm run solo-test -- account get -n solo-e2e --account-id ${OPERATOR_ID} --private-key > test.log
17-
export OPERATOR_KEY=$(grep "privateKey" test.log | awk '{print $2}' | sed 's/"//g'| sed 's/,//g')
17+
18+
# retrieve the field privateKey but not privateKeyRaw
19+
export OPERATOR_KEY=$(grep "privateKey" test.log | grep -v "privateKeyRaw" | awk '{print $2}' | sed 's/"//g'| sed 's/,//g')
1820
export CONTRACT_TEST_KEY_ONE=0x$(grep "privateKeyRaw" test.log | awk '{print $2}' | sed 's/"//g'| sed 's/,//g')
1921
echo "CONTRACT_TEST_KEY_ONE=${CONTRACT_TEST_KEY_ONE}"
2022
rm test.log

.github/workflows/script/solo_smoke_test.sh

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,48 @@ function start_sdk_test ()
8686
return $result
8787
}
8888

89+
function check_monitor_log()
90+
{
91+
# get the logs of mirror-monitor
92+
kubectl get pods -n solo-e2e | grep mirror-monitor | awk '{print $1}' | xargs kubectl logs -n solo-e2e > mirror-monitor.log
93+
94+
if grep -q "ERROR" mirror-monitor.log; then
95+
echo "mirror-monitor.log contains ERROR"
96+
exit 1
97+
fi
98+
99+
# any line contains "Scenario pinger published" should contain the string "Errors: {}"
100+
if grep -q "Scenario pinger published" mirror-monitor.log; then
101+
if grep -q "Errors: {}" mirror-monitor.log; then
102+
echo "mirror-monitor.log contains Scenario pinger published and Errors: {}"
103+
else
104+
echo "mirror-monitor.log contains Scenario pinger published but not Errors: {}"
105+
exit 1
106+
fi
107+
fi
108+
}
109+
110+
function check_importer_log()
111+
{
112+
kubectl get pods -n solo-e2e | grep mirror-importer | awk '{print $1}' | xargs kubectl logs -n solo-e2e > mirror-importer.log
113+
if grep -q "ERROR" mirror-importer.log; then
114+
echo "mirror-importer.log contains ERROR"
115+
exit 1
116+
fi
117+
}
118+
119+
# if first parameter equals to ACCOUNT_INIT,
120+
# then call solo account init before deploy mirror and relay node
121+
if [ "$1" == "ACCOUNT_INIT" ]; then
122+
echo "Call solo account init"
123+
npm run solo-test -- account init -n solo-e2e
124+
fi
125+
126+
task solo:mirror-node
127+
task solo:relay
128+
89129
echo "Change to parent directory"
130+
90131
cd ../
91132
create_test_account
92133
clone_smart_contract_repo
@@ -97,3 +138,8 @@ start_contract_test
97138
start_sdk_test
98139
echo "Sleep a while to wait background transactions to finish"
99140
sleep 30
141+
142+
echo "Run mirror node acceptance test"
143+
helm test mirror -n solo-e2e --timeout 10m
144+
check_monitor_log
145+
check_importer_log

.github/workflows/zxc-e2e-test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ jobs:
167167
if: ${{ runner.os == 'linux' && (inputs.npm-test-script == 'test-e2e-node-local-hedera' || inputs.npm-test-script == 'test-e2e-node-local-ptt' || inputs.npm-test-script == 'test-e2e-node-add-local') && !cancelled() && !failure() }}
168168
run: |
169169
cd ..
170-
git clone https://github.com/hashgraph/hedera-services.git --depth 1 --branch v0.58.1
170+
git clone https://github.com/hashgraph/hedera-services.git --depth 1 --branch v0.58.3
171171
cd hedera-services
172172
ls -ltr
173173
${{ env.CG_EXEC }} ./gradlew assemble --stacktrace --info

Taskfile.helper.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ tasks:
196196
cmds:
197197
- |
198198
if [[ "${CONSENSUS_NODE_VERSION}" != "" ]]; then
199-
export CONSENSUS_NODE_FLAG='--release-tag ${CONSENSUS_NODE_VERSION}'
199+
export CONSENSUS_NODE_FLAG='--release-tag {{.CONSENSUS_NODE_VERSION}}'
200200
fi
201201
SOLO_HOME_DIR=${SOLO_HOME_DIR} npm run solo -- node setup --namespace "${SOLO_NAMESPACE}" --node-aliases-unparsed {{.node_identifiers}} ${CONSENSUS_NODE_FLAG} ${LOCAL_BUILD_FLAG} -q --dev
202202

docs/content/User/StepByStepGuide.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
## Advanced User Guide
2+
23
For those who would like to have more control or need some customized setups, here are some step by step instructions of how to setup and deploy a solo network.
4+
35
### Setup Kubernetes cluster
46

57
#### Remote cluster
@@ -28,6 +30,7 @@ Then run the following command to set the kubectl context to the new cluster:
2830
```bash
2931
kind create cluster -n "${SOLO_CLUSTER_NAME}"
3032
```
33+
3134
Example output
3235

3336
```
@@ -48,7 +51,6 @@ Thanks for using kind! 😊
4851

4952
You may now view pods in your cluster using `k9s -A` as below:
5053

51-
5254
```
5355
Context: kind-solo <0> all <a> Attach <ctr… ____ __.________
5456
Cluster: kind-solo <ctrl-d> Delete <l> | |/ _/ __ \______
@@ -75,7 +77,6 @@ You may now view pods in your cluster using `k9s -A` as below:
7577
└─────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
7678
```
7779

78-
7980
### Step by Step Instructions
8081

8182
* Initialize `solo` directories:
@@ -136,13 +137,16 @@ Kubernetes Cluster : kind-solo
136137
✔ Generate gRPC TLS Keys
137138
✔ Finalize
138139
```
140+
139141
PEM key files are generated in `~/.solo/keys` directory.
142+
140143
```
141144
hedera-node1.crt hedera-node3.crt s-private-node1.pem s-public-node1.pem unused-gossip-pem
142145
hedera-node1.key hedera-node3.key s-private-node2.pem s-public-node2.pem unused-tls
143146
hedera-node2.crt hedera-node4.crt s-private-node3.pem s-public-node3.pem
144147
hedera-node2.key hedera-node4.key s-private-node4.pem s-public-node4.pem
145148
```
149+
146150
* Setup cluster with shared components
147151

148152
```

examples/address-book/README.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
# Yahcli Address Book Example
22

3-
This is an example of how to use Yahcli to pull the ledger and mirror node address book. And to update the ledger address book. It updates File 101 (the ledger address book file) and File 102 (the ledger node details file).
3+
This is an example of how to use Yahcli to pull the ledger and mirror node address book. And to update the ledger address book. It updates File 101 (the ledger address book file) and File 102 (the ledger node details file).
44

55
NOTE: Mirror Node refers to File 102 as its address book.
66

77
## Usage
88

9-
To get the address book from the ledger, this requires a port forward to be setup on port 50211 to consensus node with node ID = 0.
9+
To get the address book from the ledger, this requires a port forward to be setup on port 50211 to consensus node with node ID = 0.
10+
1011
```bash
1112
# try and detect if the port forward is already setup
1213
netstat -na | grep 50211
@@ -17,28 +18,35 @@ kubectl port-forward -n "${SOLO_NAMESPACE}" pod/network-node1-0 50211:50211
1718
```
1819

1920
To get the address book from the ledger, run the following command:
21+
2022
```bash
2123
cd <solo-root>/examples/address-book
2224
task get:ledger:addressbook
2325
```
24-
It will output the address book in JSON format to:
26+
27+
It will output the address book in JSON format to:
28+
2529
* `examples/address-book/localhost/sysfiles/addressBook.json`
2630
* `examples/address-book/localhost/sysfiles/nodeDetails.json`
2731

2832
You can update the address book files with your favorite text editor.
2933

3034
Once the files are ready, you can upload them to the ledger by running the following command:
35+
3136
```bash
3237
cd <solo-root>/examples/address-book
3338
task update:ledger:addressbook
3439
```
3540

3641
To get the address book from the mirror node, run the following command:
42+
3743
```bash
3844
cd <solo-root>/examples/address-book
3945
task get:mirror:addressbook
4046
```
47+
4148
NOTE: Mirror Node may not pick up the changes automatically, it might require running some transactions through, example:
49+
4250
```bash
4351
cd <solo-root>
4452
npm run solo -- account create

examples/performance-tuning/latitude/Taskfile.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ vars:
88
env:
99
SOLO_NETWORK_SIZE: 10
1010
SOLO_NAMESPACE: %SOLO_NAMESPACE%
11-
SOLO_CHART_VERSION: 0.42.3
11+
SOLO_CHART_VERSION: 0.42.10
1212
#CONSENSUS_NODE_VERSION: 0.0.0
1313
VALUES_FLAG: "--values-file {{.USER_WORKING_DIR}}/init-containers-values.yaml"
1414
SETTINGS_FLAG: "--settings-txt {{.USER_WORKING_DIR}}/settings.txt"
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
contracts.chainId=298
22
entities.unlimitedAutoAssociationsEnabled=true
33
bootstrap.throttleJsonDef.resource=genesis/throttles-dev.json
4+
networkAdmin.exportCandidateRoster=true
5+
addressBook.useRosterLifecycle=true

resources/templates/application.env

Whitespace-only changes.

resources/templates/application.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,5 @@ blockStream.streamMode=RECORDS
1818
scheduling.longTermEnabled=false
1919
# TODO: uncomment this when we are ready to use genesis-network.json
2020
#addressBook.useRosterLifecycle=true
21+
# TODO: we can remove this after we no longer need less than v0.59.x
22+
networkAdmin.exportCandidateRoster=true

src/commands/cluster/configs.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import {Flags as flags} from '../flags.js';
2020
import * as constants from '../../core/constants.js';
2121
import {ListrEnquirerPromptAdapter} from '@listr2/prompt-adapter-enquirer';
2222
import {SoloError} from '../../core/errors.js';
23+
import {type Namespace} from '../../core/config/remote/types.js';
2324

2425
export const CONNECT_CONFIGS_NAME = 'connectConfig';
2526

@@ -123,3 +124,13 @@ export interface ClusterResetConfigClass {
123124
clusterName: string;
124125
clusterSetupNamespace: string;
125126
}
127+
128+
export interface SelectClusterContextContext {
129+
config: {
130+
quiet: boolean;
131+
namespace: Namespace;
132+
clusterName: string;
133+
context: string;
134+
clusters: string[];
135+
};
136+
}

src/commands/cluster/handlers.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ export class ClusterCommandHandlers implements CommandHandlers {
4545
this.tasks.initialize(argv, connectConfigBuilder.bind(this)),
4646
this.parent.setupHomeDirectoryTask(),
4747
this.parent.getLocalConfig().promptLocalConfigTask(this.parent.getK8()),
48-
this.tasks.selectContext(argv),
48+
this.tasks.selectContext(),
4949
RemoteConfigTasks.loadRemoteConfig.bind(this)(argv),
5050
this.tasks.readClustersFromRemoteConfig(argv),
51-
this.tasks.updateLocalConfig(argv),
51+
this.tasks.updateLocalConfig(),
5252
],
5353
{
5454
concurrent: false,

0 commit comments

Comments
 (0)