go.dedis.ch/onet/v4@v4.0.0-pre1/LIBRARY.md (about) 1 Navigation: [DEDIS](https://github.com/dedis/doc/tree/master/README.md) :: 2 [Onet](README.md) :: 3 Library Overview 4 5 # Library Overview 6 7 This page is to describe the high level view of the cothority framework. In very 8 broad terms, onet allows you to set up the following three elements: 9 - *protocols*: short lived set of messages being passed back and forth between 10 one or more conodes 11 - *services*: define an api usable by client programs and instantiate protocols 12 - *apps*: communicate with the service-api of one or more conodes 13 14 Because onet comes from a research institute, we also provide a set of methods 15 to set up and run *simulations*. 16 17 ## Protocol 18 It is an interface where users of the library must implement the logic of the 19 protocol they want to code. It is a short term entity that is self sufficient, 20 i.e. it does not need external access to any other resources of the Cothority 21 framework. A protocol can be launched from another protocol or by a Service. 22 Look at the `protocols` folder in the repo to get an idea. 23 24 ## Service 25 It is a long term entity that is launched when a Conode is created. It serves 26 different purposes: 27 * serving external client requests, 28 * create/attach protocols with the Overlay, and launch them, 29 * communicate informations to other Services on other Conodes. 30 31 ## App 32 An application in the onet context is a cli-program that interacts with one of 33 more conodes through the use of the api defined by one or more services. It is 34 mostly written in go, but in the cothority-repository you also find libraries 35 for interaction in javascript. 36 37 ## Simulation 38 The onet library allows for multiple levels of simulations: 39 - localhost: 40 - up to 100 nodes 41 - mininet: 42 - up to 300 nodes on a 48-core machine, multiplied by the number of machines 43 available 44 - define max. bandwidth and delay for your network 45 - deterlab: 46 - up to 1000 nodes on a strong machine, multiplied by the number of machines 47 available 48 49 # Terminology 50 51 ## Cothority 52 A collective authority (cothority) is a set of conodes that work together to 53 handle a distributed, decentralized task. 54 55 ## Conode 56 It is the main entity of a Cothority server. When starting a conode, you define 57 which services are available by including them in your `main.go`. 58 59 ## Roster 60 It is a list of conodes denoted by their public key and address. A Roster is 61 identified by its ID which is unique for each list. 62 63 ## Tree 64 A tree is comprised of TreeNodes each of them denoted by their public key and 65 address. It is constructed out of a Roster. 66 67 # Technical details 68 69 ## Network stack 70 71 The network stack is comprised of the Router which handles all incoming and 72 outgoing messages from/to the network. A Router can use different underlying 73 type of connections: TCP which uses regular TCP connections, Local which uses 74 channels and is mainly for testing purposes, and TLS which is still in progress. 75 More should be put into the network stack section. 76 77 ## Overlay 78 It provides an abstraction to communicate over different Trees that the 79 Protocols and Services need. It handles multiple tasks: 80 * the propagations of the Roster and the Trees between different Conodes. 81 * the creation of the Protocols 82 * the dispatching of incoming and outgoing messages to the right Protocol. 83 84 ## TreeNodeInstance 85 It is created by the Overlay, one for each Protocol, being the central point of 86 communication for a Protocol. It offers the latter some common tree methods such 87 as `SendParent`,`SendChild`, `IsRoot` etc. More importantly, it transforms and 88 embeds the message given by the Protocol into its own struct and dispatch it to 89 the Overlay for the sending part; vice versa for the reception part. 90 91 ## ServiceManager 92 It is the main interface between the Conode and the Service. It transforms and 93 embed the message created by the Service into its own format and pass it to the 94 Conode for the sending part; vice versa for the reception part.