Skip to content

Commit 4f79bc9

Browse files
authored
Add Ledger wallet support (#8)
1 parent ea7eca6 commit 4f79bc9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+1351
-569
lines changed

.github/workflows/builder.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ jobs:
6767
run: dotnet test $env:PROJECT_PATH --no-restore --no-build --verbosity normal
6868
- name: Publish
6969
run: dotnet publish $env:PROJECT_PATH --configuration Release --runtime win-x64 --no-self-contained --no-restore --no-build
70+
- name: Copy Native Libraries
71+
run: Copy lib\hidapi-win\x64\hidapi.dll bin\ZenonCli\release\net6.0\win-x64\publish\
7072
- name: Package into zip
7173
run: |
7274
Compress-Archive -Path bin\ZenonCli\release\net6.0\win-x64\publish\* -DestinationPath .\znn-cli-dotnet-windows-amd64.zip

CODE_OF_CONDUCT.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Code of conduct
2+
3+
We expect Zenon's contributors to act professionally and respectfully, and we expect our social spaces to be safe and dignified environments.
4+
5+
Specifically:
6+
7+
* Respect people, their identities, their culture, and their work.
8+
* Be kind. Be courteous. Be welcoming.
9+
* Listen. Consider and acknowledge people's points before responding.
10+
11+
## Conflict resolution
12+
13+
When multiple contributors disagree on the direction for a particular patch or the general direction of the project, the conflict should be resolved by communication. The people who disagree should get together, try to understand each other's points of view, and work to find a design that addresses everyone's concerns.
14+
15+
This is usually sufficient to resolve issues. If you cannot come to an agreement, ask for the advice of a more senior member of the team.
16+
17+
Be wary of agreement by attrition, where one person argues a point repeatedly until other participants give up in the interests of moving
18+
on. This is not conflict resolution, as it does not address everyone's concerns. Be wary of agreement by compromise, where two good competing solutions are merged into one mediocre solution. A conflict is addressed when the participants agree that the final solution is _better_ than all the conflicting proposals. Sometimes the solution is more work than either of the proposals.
19+
20+
## Questions
21+
22+
It's always ok to ask questions. The project is complex, and nobody will be an expert in all the systems. Once you find the answer, document it in the first place you looked. That way, the next person will be brought up to speed even quicker.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ A .NET based command-line interface (CLI) for interacting with Zenon Alphanet -
99
## Dependencies
1010

1111
- [CommandLine](https://github.com/commandlineparser/commandline)
12-
- [Zenon SDK for .NET](https://github.com/KingGorrin/znn_sdk_csharp)
12+
- [Zenon SDK for .NET](https://github.com/hypercore-one/znn_sdk_csharp)
1313

1414
## Installation
1515

16-
Download and extract the [latest version](../../releases).
16+
Download and extract the [latest version](https://github.com/hypercore-one/znn_cli_csharp/releases/).
1717

1818
## Contributing
1919

224 KB
Loading
397 Bytes
Loading

docs/ledger.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Connect Ledger Nano S to your Zenon Wallet
2+
3+
Install the Zenon Ledger app on your Ledger Nano S to manage ZNN, QSR and ZTS tokens with the Zenon CLI. The Zenon Ledger app is developed and supported by the [{H}yperCore One](https://github.com/hypercore-one) team.
4+
5+
### 1. Before you start
6+
7+
- You've [initialized](https://support.ledgerwallet.com/hc/en-us/articles/360000613793) your Ledger Nano S.
8+
- The latest firmware is [installed](https://support.ledgerwallet.com/hc/en-us/articles/360002731113).
9+
- Ledger Live is [ready to use](https://support.ledgerwallet.com/hc/en-us/articles/360006395233).
10+
11+
### 2. Install the Zenon app
12+
13+
1. Open the Manager in Ledger Live.
14+
2. Connect and unlock your Ledger Nano S.
15+
3. If asked, allow the manager on your device by pressing the right button.
16+
4. Find **Zenon** in the app catalog.
17+
5. Press the **Install** button of the app.
18+
- An installation window appears.
19+
- Your device will display **Processing**
20+
- The app installation is confirmed.
21+
22+
![nanos-znn-app](/docs/assets/screenshots/nanos-znn-app.png)
23+
24+
### **3. Connect device to your Zenon wallet**
25+
26+
- Open the Zenon application on your Ledger device, the screen will display "Zenon is ready".
27+
28+
![nanos-znn-app](/docs/assets/screenshots/nanos-znn-ready.png)
29+
30+
- The Zenon CLI is available Linux/MacOs/Windows as a downloadable binary from the [releases page](../../../../releases).
31+
- Install the Zenon CLI by extracting the archive to a location on your desktop device.
32+
- Open a command prompt and change directory to the location of the Zenon CLI. For example: `cd ~/znn-cli`.
33+
34+
### **4. Use the Zenon wallet**
35+
36+
- Your address can be displayed with the following command: `znn-cli wallet.deriveAddresses 0 1 -k "Nano S"`. You can use it to receive ZTS tokens.
37+
- To receive, execute the following command: `znn-cli receiveAll -k "Nano S" -u wss://my.hc1node.com:35998`.
38+
- To send 10 ZNN to z1qqjnwjjpnue8xmmpanz6csze6tcmtzzdtfsww7, execute the following command: `znn-cli send z1qqjnwjjpnue8xmmpanz6csze6tcmtzzdtfsww7 10 ZNN -k "Nano S" -u wss://my.hc1node.com:35998`.
39+
- Verify and confirm all transaction details on the ledger device.
40+
- Press both buttons to sign the transaction.
41+
42+
### **5. Contact info**
43+
44+
- Support: Go to the #dev-community channel in our Discord: https://discord.gg/aEW2UZvs
45+
- Name: [{H}yperCore One](https://github.com/hypercore-one)
46+
- Legal Entity: NOM Labz LLC
47+
- URL: [Zenon Network]http://zenon.network
Lines changed: 39 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
1-
# Setup Zenon Network devnet with HTLC branch and Zenon CLI for .NET on Ubuntu 22.04+
1+
# Setup Zenon devnet node on Ubuntu 22.04+
22

3-
The instructions below are for setting up a Zenon Network **devnet** with the **HTLC** branch merged and Zenon CLI for .NET for Ubuntu 22.04+.
4-
5-
Click the link below to follow the instructions in a Video Tutorial made by 0x3639; otherwise continue reading the instructions.
6-
7-
[Video Tutorial: Zenon Network devnet with HTLC branch and Zenon CLI for .NET on Ubuntu 22.04](https://youtu.be/UC-oX1YjlJ0)
3+
The instructions below are for setting up a Zenon **devnet** node on Ubuntu 22.04+.
84

95
## Required software
106

@@ -21,17 +17,11 @@ sudo apt install git
2117
We will need Golang to compile the go-zenon code. Execute the following command in a Terminal.
2218

2319
``` bash
20+
sudo add-apt-repository ppa:longsleep/golang-backports
21+
sudo apt update
2422
sudo apt install golang-go
2523
```
2624

27-
### .Net SDK
28-
29-
The .NET SDK allows you to develop apps with .NET. If you install the .NET SDK, you don’t need to install the corresponding runtime. To install the .NET SDK, run the following commands in the Terminal.
30-
31-
``` bash
32-
sudo apt-get update && sudo apt-get install -y dotnet6
33-
```
34-
3525
### Make
3626

3727
We will need Make to execute makefiles. Execute the following command in a Terminal.
@@ -51,7 +41,7 @@ gcc --version
5141
You should see something like the following in Ubuntu 22.04
5242

5343
``` bash
54-
gcc (Ubuntu 11.2.0-19ubuntu1) 11.2.0
44+
gcc (Ubuntu 11.4.0-1ubuntu1-22.04) 11.4.0
5545
Copyright (C) 2021 Free Software Foundation, Inc.
5646
This is free software; see the source for copying conditions. There is NO
5747
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
@@ -84,12 +74,12 @@ mkdir repos
8474
cd repos
8575
```
8676

87-
### BICH go-zenon
77+
### Zenon node
8878

89-
Create a clone of the **devnet** branch of the [Big Inches Club House go-zenon repository](https://github.com/Big-Inches-Club-House/go-zenon.git).
79+
Create a clone of the **master** branch of the [zenon-network/go-zenon repository](https://github.com/zenon-network/go-zenon.git).
9080

9181
``` bash
92-
git clone -b devnet https://github.com/Big-Inches-Club-House/go-zenon.git
82+
git clone https://github.com/zenon-network/go-zenon.git
9383
```
9484

9585
Change directory to the **go-zenon** directory.
@@ -98,61 +88,66 @@ Change directory to the **go-zenon** directory.
9888
cd go-zenon
9989
```
10090

101-
Merge the **htlc** branch with the **devnet** branch.
102-
103-
``` bash
104-
git merge origin/htlc
105-
```
106-
10791
Compile the **go-zenon** code.
10892

10993
``` bash
11094
make znnd
11195
```
11296

113-
Configure and run a **devnet** node.
97+
Change directory to the parent directory.
11498

11599
``` bash
116-
./build/znnd --data ./devnet generate-devnet --genesis-block=z1qqjnwjjpnue8xmmpanz6csze6tcmtzzdtfsww7,40000,400000
117-
./build/znnd --data ./devnet
100+
cd ..
118101
```
119102

120-
Keep the shell open during the duration of this tutorial. It is now possible to connect the **Zenon Explorer** to the node.
103+
### NoM community controller
121104

122-
Open a web browser and go to https://explorer.zenon.network and connect the **Zenon Explorer** to http://127.0.0.1:35997
105+
Create a clone of the **master** branch of the [hypercore-one/nomctl repository](https://github.com/hypercore-one/nomctl.git).
123106

124-
Search for the address **z1qqjnwjjpnue8xmmpanz6csze6tcmtzzdtfsww7**
107+
``` bash
108+
git clone https://github.com/hypercore-one/nomctl.git
109+
```
125110

126-
> Try the Firefox or Brave browser if the Zenon Explorer does not want to connect. Google Chrome can throw a mixed content error when connecting to an insecure destination.
111+
Change directory to the **nomctl** directory.
127112

128-
### Zenon CLI for .NET
113+
``` bash
114+
cd nomctl
115+
```
129116

130-
Open a new Bash Shell and change directory to **repos**.
117+
Compile the **nomctl** code.
131118

132119
``` bash
133-
cd ~/repos
120+
make
134121
```
135122

136-
Create a clone of the [KingGorrin znn-cli-csharp repository](https://github.com/KingGorrin/znn_cli_csharp.git).
123+
Change directory to the parent directory.
137124

138125
``` bash
139-
git clone https://github.com/KingGorrin/znn_cli_csharp.git
126+
cd ..
140127
```
141128

142-
Change directory to the **znn_cli_csharp** directory.
129+
## Running
130+
131+
Generate **devnet** configuration.
143132

144133
``` bash
145-
cd znn_cli_csharp
134+
./nomctl/build/nomctl generate-devnet --data ./devnet --genesis-block=z1qqjnwjjpnue8xmmpanz6csze6tcmtzzdtfsww7/40000/400000
146135
```
147136

148-
Compile the **znn_cli_csharp** code
137+
> Replace the genesis-block address if you want to use another address for you devnet.
138+
139+
Run the node with **devnet** configuration.
149140

150141
``` bash
151-
dotnet build --runtime linux-x64 src/ZenonCli/ZenonCli.csproj
142+
./go-zenon/build/znnd --data ./devnet
152143
```
153144

154-
Change directory to the binaries directory.
145+
## Explorer
155146

156-
``` bash
157-
cd ~/repos/znn_cli_csharp/bin/ZenonCli/net6.0/linux-x64
158-
```
147+
While keeping the shell with the node running it is now possible to connect the **Zenon Explorer** to the node.
148+
149+
Open a web browser and go to https://explorer.zenon.network and connect the **Zenon Explorer** to http://127.0.0.1:35997
150+
151+
Search for the address **z1qqjnwjjpnue8xmmpanz6csze6tcmtzzdtfsww7**
152+
153+
> Try the Firefox or Brave browser if the Zenon Explorer does not want to connect. Google Chrome can throw a mixed content error when connecting to an insecure destination.
Lines changed: 38 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Setup Zenon Network devnet with HTLC branch and Zenon CLI for .NET on Windows 10+
1+
# Setup Zenon devnet node on Windows 10+
22

3-
The instructions below are for setting up a Zenon Network **devnet** with the **HTLC** branch merged and Zenon CLI for .NET for Windows 10+.
3+
The instructions below are for setting up a Zenon **devnet** node on Windows 10+.
44

55
## Required software
66

@@ -28,14 +28,6 @@ We will need Golang to to compile the go-zenon code. Execute the following comma
2828
choco install go -y
2929
```
3030

31-
### .Net SDK
32-
33-
We will need DotNet SDK to compile the znn-cli-cscharp code. Execute the following command in PowerShell.
34-
35-
``` powershell
36-
choco install dotnet-sdk -y
37-
```
38-
3931
### GCC compiler
4032

4133
We will need a GCC compiler to compile the go-zenon code. Execute the following command in PowerShell.
@@ -65,12 +57,12 @@ mkdir repos
6557
cd repos
6658
```
6759

68-
### BICH go-zenon
60+
### Zenon node
6961

70-
Create a clone of the **devnet** branch of the [Big Inches Club House go-zenon repository](https://github.com/Big-Inches-Club-House/go-zenon.git).
62+
Create a clone of the **devnet** branch of the [zenon-network/go-zenon repository](https://github.com/zenon-network/go-zenon.git).
7163

7264
``` powershell
73-
git clone -b devnet https://github.com/Big-Inches-Club-House/go-zenon.git
65+
git clone https://github.com/zenon-network/go-zenon.git
7466
```
7567

7668
Change directory to the **go-zenon** directory.
@@ -79,75 +71,77 @@ Change directory to the **go-zenon** directory.
7971
cd go-zenon
8072
```
8173

82-
Merge the **htlc** branch with the **devnet** branch.
83-
84-
``` powershell
85-
git merge origin/htlc
86-
```
87-
8874
Compile the **go-zenon** code.
8975

9076
``` powershell
91-
go build -o build/libznn.dll -buildmode=c-shared -tags libznn main_libznn.go
92-
go build -o build/znnd.exe main.go
77+
go build -o build/libznn.dll -buildmode=c-shared -tags libznn cmd/libznn/main_libznn.go
78+
go build -o build/znnd.exe cmd/znnd/main.go
9379
```
9480

95-
Configure and run a **devnet** node.
81+
Change directory to the parent directory.
9682

9783
``` powershell
98-
./build/znnd --data ./devnet generate-devnet --genesis-block=z1qqjnwjjpnue8xmmpanz6csze6tcmtzzdtfsww7,40000,400000
99-
./build/znnd --data ./devnet
84+
cd ..
10085
```
10186

102-
Keep the shell open during the duration of this tutorial. It is now possible to connect the **Zenon Explorer** to the node.
103-
104-
Open a web browser and go to https://explorer.zenon.network and connect the **Zenon Explorer** to http://127.0.0.1:35997
105-
106-
Search for the address **z1qqjnwjjpnue8xmmpanz6csze6tcmtzzdtfsww7**
87+
### NoM community controller
10788

108-
> Try the Firefox or Brave browser if the Zenon Explorer does not want to connect. Google Chrome can throw a mixed content error when connecting to an insecure destination.
89+
Create a clone of the **master** branch of the [hypercore-one/nomctl repository](https://github.com/hypercore-one/nomctl.git).
10990

110-
### Zenon CLI for .NET
91+
``` powershell
92+
git clone https://github.com/hypercore-one/nomctl.git
93+
```
11194

112-
Open a new [PowerShell administrative shell](https://www.howtogeek.com/742916/how-to-open-windows-powershell-as-an-admin-in-windows-10/) and change directory to **repos**.
95+
Change directory to the **nomctl** directory.
11396

11497
``` powershell
115-
cd $ENV:USERPROFILE/repos
98+
cd nomctl
11699
```
117100

118-
Create a clone of the [KingGorrin znn-cli-csharp repository](https://github.com/KingGorrin/znn_cli_csharp.git).
101+
Compile the **nomctl** code.
119102

120103
``` powershell
121-
git clone https://github.com/KingGorrin/znn_cli_csharp.git
104+
go build -o build/nomctl.exe
122105
```
123106

124-
Change directory to the **znn_cli_csharp** directory.
107+
Change directory to the parent directory.
125108

126109
``` powershell
127-
cd znn_cli_csharp
110+
cd ..
128111
```
129112

130-
Compile the **znn_cli_csharp** code
113+
## Running
114+
115+
Generate **devnet** configuration.
131116

132117
``` powershell
133-
dotnet build ./src/ZenonCli/ZenonCli.csproj
118+
./nomctl/build/nomctl generate-devnet --data ./devnet --genesis-block=z1qqjnwjjpnue8xmmpanz6csze6tcmtzzdtfsww7/40000/400000
134119
```
135120

136-
Change directory to the binaries directory.
121+
> Replace the genesis-block address if you want to use another address for you devnet.
122+
123+
Run the node with **devnet** configuration.
137124

138125
``` powershell
139-
cd ./bin/ZenonCli/net6.0/
126+
./go-zenon/build/znnd --data ./devnet
140127
```
141128

129+
## Explorer
130+
131+
While keeping the shell with the node running it is now possible to connect the **Zenon Explorer** to the node.
132+
133+
Open a web browser and go to https://explorer.zenon.network and connect the **Zenon Explorer** to http://127.0.0.1:35997
134+
135+
Search for the address **z1qqjnwjjpnue8xmmpanz6csze6tcmtzzdtfsww7**
136+
137+
> Try the Firefox or Brave browser if the Zenon Explorer does not want to connect. Google Chrome can throw a mixed content error when connecting to an insecure destination.
138+
142139
## Clean up
143140

144141
Execute the following commands in order to undo all the installation files of this tutorial.
145142

146143
``` powershell
147-
del $ENV:AppData\znn\wallet\Alice
148-
del $ENV:AppData\znn\wallet\Bob
149144
rm $ENV:USERPROFILE/repos -r -force
150-
choco uninstall dotnet-sdk -y
151145
choco uninstall mingw -y
152146
choco uninstall go -y
153147
choco uninstall git -y

0 commit comments

Comments
 (0)