github.com/klaytn/klaytn@v1.12.1/datasync/downloader/doc.go (about) 1 // Copyright 2018 The klaytn Authors 2 // Copyright 2015 The go-ethereum Authors 3 // This file is part of the go-ethereum library. 4 // 5 // The go-ethereum library is free software: you can redistribute it and/or modify 6 // it under the terms of the GNU Lesser General Public License as published by 7 // the Free Software Foundation, either version 3 of the License, or 8 // (at your option) any later version. 9 // 10 // The go-ethereum library is distributed in the hope that it will be useful, 11 // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 // GNU Lesser General Public License for more details. 14 // 15 // You should have received a copy of the GNU Lesser General Public License 16 // along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>. 17 // 18 // This file is derived from eth/downloader/downloader.go (2018/06/04). 19 // Modified and improved for the klaytn development. 20 21 /* 22 Package downloader contains the manual full chain synchronisation. 23 24 How downloader works 25 26 The downloader is responsible for synchronizing up-to-date status from the peers connected to it. To do this, 27 it downloads "headers", "bodies", and "receipts" in parallel, merges them through the pipeline, and reflects them in the state trie. 28 29 Source Files 30 31 Downloader related functions and variables are defined in the files listed below. 32 - api.go : Console APIs to get synchronization information. 33 - downloader.go : Functions and variables to sync peer and block. And modules for QoS(Quality of Service). 34 - downloader_test.go : Functions for testing the downloader package. 35 - events.go : Definitions of event types. 36 - metrics.go : Metric variables for packet transmissions and receptions. 37 - modes.go : A definition of type for SyncMode including "FullSync", "FastSync", and "LightSync". 38 - peer.go : Functions that request a packet to a peer, check, and set the network status of a peer. 39 - queue.go : Functions for managing and scheduling received headers, bodies, and receipts. 40 - types.go : Definitions of the types for downloaded packets. 41 */ 42 package downloader