Skip to content

Commit

Permalink
Add Ledger wallet support (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
KingGorrin committed Dec 13, 2023
1 parent ea7eca6 commit 4f79bc9
Show file tree
Hide file tree
Showing 54 changed files with 1,351 additions and 569 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ jobs:
run: dotnet test $env:PROJECT_PATH --no-restore --no-build --verbosity normal
- name: Publish
run: dotnet publish $env:PROJECT_PATH --configuration Release --runtime win-x64 --no-self-contained --no-restore --no-build
- name: Copy Native Libraries
run: Copy lib\hidapi-win\x64\hidapi.dll bin\ZenonCli\release\net6.0\win-x64\publish\
- name: Package into zip
run: |
Compress-Archive -Path bin\ZenonCli\release\net6.0\win-x64\publish\* -DestinationPath .\znn-cli-dotnet-windows-amd64.zip
Expand Down
22 changes: 22 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Code of conduct

We expect Zenon's contributors to act professionally and respectfully, and we expect our social spaces to be safe and dignified environments.

Specifically:

* Respect people, their identities, their culture, and their work.
* Be kind. Be courteous. Be welcoming.
* Listen. Consider and acknowledge people's points before responding.

## Conflict resolution

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.

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.

Be wary of agreement by attrition, where one person argues a point repeatedly until other participants give up in the interests of moving
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.

## Questions

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.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ A .NET based command-line interface (CLI) for interacting with Zenon Alphanet -
## Dependencies

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

## Installation

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

## Contributing

Expand Down
Binary file added docs/assets/screenshots/nanos-znn-app.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/screenshots/nanos-znn-ready.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
47 changes: 47 additions & 0 deletions docs/ledger.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Connect Ledger Nano S to your Zenon Wallet

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.

### 1. Before you start

- You've [initialized](https://support.ledgerwallet.com/hc/en-us/articles/360000613793) your Ledger Nano S.
- The latest firmware is [installed](https://support.ledgerwallet.com/hc/en-us/articles/360002731113).
- Ledger Live is [ready to use](https://support.ledgerwallet.com/hc/en-us/articles/360006395233).

### 2. Install the Zenon app

1. Open the Manager in Ledger Live.
2. Connect and unlock your Ledger Nano S.
3. If asked, allow the manager on your device by pressing the right button.
4. Find **Zenon** in the app catalog.
5. Press the **Install** button of the app.
- An installation window appears.
- Your device will display **Processing**
- The app installation is confirmed.

![nanos-znn-app](/docs/assets/screenshots/nanos-znn-app.png)

### **3. Connect device to your Zenon wallet**

- Open the Zenon application on your Ledger device, the screen will display "Zenon is ready".

![nanos-znn-app](/docs/assets/screenshots/nanos-znn-ready.png)

- The Zenon CLI is available Linux/MacOs/Windows as a downloadable binary from the [releases page](../../../../releases).
- Install the Zenon CLI by extracting the archive to a location on your desktop device.
- Open a command prompt and change directory to the location of the Zenon CLI. For example: `cd ~/znn-cli`.

### **4. Use the Zenon wallet**

- 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.
- To receive, execute the following command: `znn-cli receiveAll -k "Nano S" -u wss://my.hc1node.com:35998`.
- 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`.
- Verify and confirm all transaction details on the ledger device.
- Press both buttons to sign the transaction.

### **5. Contact info**

- Support: Go to the #dev-community channel in our Discord: https://discord.gg/aEW2UZvs
- Name: [{H}yperCore One](https://github.com/hypercore-one)
- Legal Entity: NOM Labz LLC
- URL: [Zenon Network]http://zenon.network
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# Setup Zenon Network devnet with HTLC branch and Zenon CLI for .NET on Ubuntu 22.04+
# Setup Zenon devnet node on Ubuntu 22.04+

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+.

Click the link below to follow the instructions in a Video Tutorial made by 0x3639; otherwise continue reading the instructions.

[Video Tutorial: Zenon Network devnet with HTLC branch and Zenon CLI for .NET on Ubuntu 22.04](https://youtu.be/UC-oX1YjlJ0)
The instructions below are for setting up a Zenon **devnet** node on Ubuntu 22.04+.

## Required software

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

``` bash
sudo add-apt-repository ppa:longsleep/golang-backports
sudo apt update
sudo apt install golang-go
```

### .Net SDK

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.

``` bash
sudo apt-get update && sudo apt-get install -y dotnet6
```

### Make

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

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

### BICH go-zenon
### Zenon node

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).
Create a clone of the **master** branch of the [zenon-network/go-zenon repository](https://github.com/zenon-network/go-zenon.git).

``` bash
git clone -b devnet https://github.com/Big-Inches-Club-House/go-zenon.git
git clone https://github.com/zenon-network/go-zenon.git
```

Change directory to the **go-zenon** directory.
Expand All @@ -98,61 +88,66 @@ Change directory to the **go-zenon** directory.
cd go-zenon
```

Merge the **htlc** branch with the **devnet** branch.

``` bash
git merge origin/htlc
```

Compile the **go-zenon** code.

``` bash
make znnd
```

Configure and run a **devnet** node.
Change directory to the parent directory.

``` bash
./build/znnd --data ./devnet generate-devnet --genesis-block=z1qqjnwjjpnue8xmmpanz6csze6tcmtzzdtfsww7,40000,400000
./build/znnd --data ./devnet
cd ..
```

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

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

Search for the address **z1qqjnwjjpnue8xmmpanz6csze6tcmtzzdtfsww7**
``` bash
git clone https://github.com/hypercore-one/nomctl.git
```

> 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.
Change directory to the **nomctl** directory.

### Zenon CLI for .NET
``` bash
cd nomctl
```

Open a new Bash Shell and change directory to **repos**.
Compile the **nomctl** code.

``` bash
cd ~/repos
make
```

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

``` bash
git clone https://github.com/KingGorrin/znn_cli_csharp.git
cd ..
```

Change directory to the **znn_cli_csharp** directory.
## Running

Generate **devnet** configuration.

``` bash
cd znn_cli_csharp
./nomctl/build/nomctl generate-devnet --data ./devnet --genesis-block=z1qqjnwjjpnue8xmmpanz6csze6tcmtzzdtfsww7/40000/400000
```

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

``` bash
dotnet build --runtime linux-x64 src/ZenonCli/ZenonCli.csproj
./go-zenon/build/znnd --data ./devnet
```

Change directory to the binaries directory.
## Explorer

``` bash
cd ~/repos/znn_cli_csharp/bin/ZenonCli/net6.0/linux-x64
```
While keeping the shell with the node running it is now possible to connect the **Zenon Explorer** to the node.

Open a web browser and go to https://explorer.zenon.network and connect the **Zenon Explorer** to http://127.0.0.1:35997

Search for the address **z1qqjnwjjpnue8xmmpanz6csze6tcmtzzdtfsww7**

> 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.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Setup Zenon Network devnet with HTLC branch and Zenon CLI for .NET on Windows 10+
# Setup Zenon devnet node on Windows 10+

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

## Required software

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

### .Net SDK

We will need DotNet SDK to compile the znn-cli-cscharp code. Execute the following command in PowerShell.

``` powershell
choco install dotnet-sdk -y
```

### GCC compiler

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

### BICH go-zenon
### Zenon node

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).
Create a clone of the **devnet** branch of the [zenon-network/go-zenon repository](https://github.com/zenon-network/go-zenon.git).

``` powershell
git clone -b devnet https://github.com/Big-Inches-Club-House/go-zenon.git
git clone https://github.com/zenon-network/go-zenon.git
```

Change directory to the **go-zenon** directory.
Expand All @@ -79,75 +71,77 @@ Change directory to the **go-zenon** directory.
cd go-zenon
```

Merge the **htlc** branch with the **devnet** branch.

``` powershell
git merge origin/htlc
```

Compile the **go-zenon** code.

``` powershell
go build -o build/libznn.dll -buildmode=c-shared -tags libznn main_libznn.go
go build -o build/znnd.exe main.go
go build -o build/libznn.dll -buildmode=c-shared -tags libznn cmd/libznn/main_libznn.go
go build -o build/znnd.exe cmd/znnd/main.go
```

Configure and run a **devnet** node.
Change directory to the parent directory.

``` powershell
./build/znnd --data ./devnet generate-devnet --genesis-block=z1qqjnwjjpnue8xmmpanz6csze6tcmtzzdtfsww7,40000,400000
./build/znnd --data ./devnet
cd ..
```

Keep the shell open during the duration of this tutorial. It is now possible to connect the **Zenon Explorer** to the node.

Open a web browser and go to https://explorer.zenon.network and connect the **Zenon Explorer** to http://127.0.0.1:35997

Search for the address **z1qqjnwjjpnue8xmmpanz6csze6tcmtzzdtfsww7**
### NoM community controller

> 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.
Create a clone of the **master** branch of the [hypercore-one/nomctl repository](https://github.com/hypercore-one/nomctl.git).

### Zenon CLI for .NET
``` powershell
git clone https://github.com/hypercore-one/nomctl.git
```

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**.
Change directory to the **nomctl** directory.

``` powershell
cd $ENV:USERPROFILE/repos
cd nomctl
```

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

``` powershell
git clone https://github.com/KingGorrin/znn_cli_csharp.git
go build -o build/nomctl.exe
```

Change directory to the **znn_cli_csharp** directory.
Change directory to the parent directory.

``` powershell
cd znn_cli_csharp
cd ..
```

Compile the **znn_cli_csharp** code
## Running

Generate **devnet** configuration.

``` powershell
dotnet build ./src/ZenonCli/ZenonCli.csproj
./nomctl/build/nomctl generate-devnet --data ./devnet --genesis-block=z1qqjnwjjpnue8xmmpanz6csze6tcmtzzdtfsww7/40000/400000
```

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

``` powershell
cd ./bin/ZenonCli/net6.0/
./go-zenon/build/znnd --data ./devnet
```

## Explorer

While keeping the shell with the node running it is now possible to connect the **Zenon Explorer** to the node.

Open a web browser and go to https://explorer.zenon.network and connect the **Zenon Explorer** to http://127.0.0.1:35997

Search for the address **z1qqjnwjjpnue8xmmpanz6csze6tcmtzzdtfsww7**

> 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.
## Clean up

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

``` powershell
del $ENV:AppData\znn\wallet\Alice
del $ENV:AppData\znn\wallet\Bob
rm $ENV:USERPROFILE/repos -r -force
choco uninstall dotnet-sdk -y
choco uninstall mingw -y
choco uninstall go -y
choco uninstall git -y
Expand Down

0 comments on commit 4f79bc9

Please sign in to comment.