github.com/turingchain2020/turingchain@v1.1.21/system/p2p/dht/types/const.go (about)

     1  // Copyright Turing Corp. 2018 All Rights Reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  //Package types dht public types
     6  package types
     7  
     8  import (
     9  	"errors"
    10  	"time"
    11  )
    12  
    13  const (
    14  	//Version P2P client version
    15  	Version = "1.0.0"
    16  	// DHTTypeName p2p插件名称,底层基于libp2p框架, dht结构化网络
    17  	DHTTypeName = "dht"
    18  
    19  	// DefaultP2PPort 默认端口
    20  	DefaultP2PPort = 13803
    21  )
    22  
    23  var (
    24  	// ErrLength err length
    25  	ErrLength = errors.New("length not equal")
    26  	// ErrInvalidMessageType invalid message type err
    27  	ErrInvalidMessageType = errors.New("invalid message type")
    28  	// ErrNotFound not found err
    29  	ErrNotFound = errors.New("not found")
    30  	// ErrInvalidParam invalid param err
    31  	ErrInvalidParam = errors.New("invalid parameter")
    32  	// ErrWrongSignature wrong signature err
    33  	ErrWrongSignature = errors.New("wrong signature")
    34  	// ErrInvalidResponse invalid response error
    35  	ErrInvalidResponse = errors.New("invalid response")
    36  
    37  	// ExpiredTime expired time
    38  	ExpiredTime = time.Hour * 12
    39  	// RefreshInterval refresh interval
    40  	RefreshInterval = time.Hour * 3
    41  )