From f9c1bf167962261c9d358ee2a39922afd7503051 Mon Sep 17 00:00:00 2001 From: Revertron Date: Sun, 9 May 2021 16:58:14 +0200 Subject: [PATCH] Added some tests and text in readme. --- README.md | 19 +++++++++++++------ src/commons/mod.rs | 3 +++ src/p2p/network.rs | 1 + 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 289b9cb..2cf4358 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,12 @@ This project represents a minimal blockchain without cryptocurrency, capable of ![Screenshot](img/domains.png) +## How it works? +Every node connects to its siblings and synchronizes the domain database. +This DB consists of cryptographically bound blocks, that contain encrypted domain names, contacts, and some info, if you wish. +There are 10 domain zones available to get domain in: +`.anon`, `.btn`, `.conf`, `.index`, `.merch`, `.mirror`, `.mob`, `.screen`, `.srv`, `.ygg`. +But, `.anon` and `.ygg` are bound to have IP-addresses from Yggdrasil Network only. ## Building and running @@ -68,18 +74,18 @@ wget -O - https://deb.revertron.com/key.txt | sudo apt-key add - ``` echo 'deb http://deb.revertron.com/ debian alfis' | sudo tee /etc/apt/sources.list.d/alfis.list ``` -3. Update packages +3. Update packages and install ALFIS ``` -sudo apt update +sudo apt update && sudo apt install alfis ``` -4. Install ALFIS +4. Enable and start the service ``` -sudo apt install alfis +systemctl enable --now alfis ``` After that configuration is in file `/etc/alfis.conf` and data is saved to `/var/lib/alfis`. If you have some DNS server bound to port 53, it will not properly start. Deal with it on your own. -### GUI version Windows/Linux/MacOS (if you want to create and change domains) +### GUI version Windows/Linux/macOS (if you want to create and change domains) If you want to create and manage your own domains on blockchain, you will need a version with GUI. You can download it from [releases](https://github.com/Revertron/Alfis/releases) section, choose appropriate OS and architecture version. It needs to be without `nogui` suffix. @@ -91,4 +97,5 @@ If you want it to load config from another file you can command it so: `alfis -c ## Roadmap 1. Stabilize blockchain functions (domain transfer, info & contacts in UI), bug hunting and fixing. 2. Change DNS server/proxy to own resource saving implementation (using trust-dns-proto for RR parsing). -3. P2P traffic encryption (ECDH). \ No newline at end of file +3. P2P traffic encryption (ECDH). +4. Web-GUI to manage you node from browser. \ No newline at end of file diff --git a/src/commons/mod.rs b/src/commons/mod.rs index 358a974..2b11ace 100644 --- a/src/commons/mod.rs +++ b/src/commons/mod.rs @@ -176,6 +176,9 @@ mod test { assert!(!check_domain("ab.c-", true)); assert!(!check_domain(".ab.c", true)); assert!(!check_domain("ab.c-", true)); + assert!(check_domain("a.com", true)); + assert!(check_domain("ab.com", true)); + assert!(check_domain("abc.com", true)); assert!(check_domain("777.com", true)); assert!(!check_domain("77.com", true)); assert!(!check_domain("7.com", true)); diff --git a/src/p2p/network.rs b/src/p2p/network.rs index b9466e0..5406aef 100644 --- a/src/p2p/network.rs +++ b/src/p2p/network.rs @@ -71,6 +71,7 @@ impl Network { // Starting peer connections to bootstrap nodes peers.connect_peers(&peers_addrs, &poll.registry(), &mut unique_token, yggdrasil_only); bootstrap_timer = Instant::now(); + last_events_time = Instant::now(); } // Poll Mio for events, blocking until we get an event. poll.poll(&mut events, POLL_TIMEOUT).expect("Error polling sockets");