Skip to content

Commit 17dafaa

Browse files
committed
fix: snapshot for campaign 2&3
1 parent 4a5a69e commit 17dafaa

13 files changed

+1420
-131
lines changed

.gitignore

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ todo
66
dist/
77
.releaser.yml
88
pactus-*
9-
cmd/data/wallet.json
9+
cmd/data/*
1010
cmd/data/config.json
1111
cmd/data/validators.json
1212
cmd/bin
@@ -15,4 +15,6 @@ __pycache__
1515
/scripts/go/referral.json
1616

1717
#.env file
18-
.env
18+
.env
19+
/scripts/go/top10.json
20+
output/*

scripts/python/agent.py

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import re
2+
3+
def extract_info(input_string):
4+
# Regular expression pattern to extract desired information
5+
pattern = r'node=([^/]+)/node-version=([^/]+)/.*?/os=([^/]+)/arch=([^/]+)(/reachability=([^/]+))?'
6+
match = re.match(pattern, input_string)
7+
8+
if match:
9+
node = match.group(1)
10+
node_version = match.group(2)
11+
os = match.group(3)
12+
arch = match.group(4)
13+
reachability = "Unknown"
14+
if match.group(5) is not None:
15+
reachability = match.group(5)
16+
return {
17+
"Node": node,
18+
"Node Version": node_version,
19+
"OS": os,
20+
"Arch": arch,
21+
"Reachability": reachability
22+
}
23+
else:
24+
print("Invalid input string:", input_string)
25+
return None
26+
27+
# Sample input strings
28+
strings = [
29+
"node=pactus-daemon/node-version=v0.20.0/protocol-version=1/os=linux/arch=amd64/reachability=pactus-testnet-v2",
30+
"node=pactus-gui.exe/node-version=v0.18.4/protocol-version=1/os=windows/arch=amd64",
31+
"node=pactus-daemon/node-version=v0.20.1/protocol-version=1/os=linux/arch=amd64/reachability=Private",
32+
]
33+
34+
for s in strings:
35+
result = extract_info(s)
36+
if result:
37+
print(result)

scripts/python/blockchain_pb2.py

Lines changed: 81 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)