From 842d5c7c7bfa6d731b7ab76f9d9b535688c76c68 Mon Sep 17 00:00:00 2001 From: Kleissner Date: Tue, 16 Mar 2021 14:35:16 +0100 Subject: [PATCH] Add use paragraph to readme --- README.md | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b764282..739544a 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,36 @@ The core library which is needed for any Peernet application. It provides connec Current version: 0.1 (pre-alpha) +## Use + +```go +package main + +import ( + "fmt" + "os" + + "github.com/PeernetOfficial/core" +) + +func init() { + if status, err := core.LoadConfig("Settings.yaml"); err != nil { + fmt.Printf("Error loading config file: %s", err.Error()) + os.Exit(1) + } + + core.InitLog() + core.Init() + core.UserAgent = "Your application/1.0" +} + +func main() { + core.Connect() + + // use functions from core package, for example to find and download files +} +``` + ## Encryption and Hashing functions * Salsa20 is used for encrypting the packets. @@ -37,6 +67,6 @@ The Private Key is required to make any changes to the user's blockchain, includ ## Contributing -Please note that by contributing code, documentation, ideas, snippets, or any other intellectual property you agree that you have all the necessary rights and you agree that we, Peernet, may use it for any purpose. +Please note that by contributing code, documentation, ideas, snippets, or any other intellectual property you agree that you have all the necessary rights and you agree that we, the Peernet organization, may use it for any purpose. © 2021 Peernet