github.com/aergoio/aergo@v1.3.1/polaris/common/polarisprotocol.go (about)

     1  /*
     2   * @file
     3   * @copyright defined in aergo/LICENSE.txt
     4   */
     5  
     6  package common
     7  
     8  import (
     9  	"github.com/aergoio/aergo/p2p/p2pcommon"
    10  	core "github.com/libp2p/go-libp2p-core"
    11  	"time"
    12  )
    13  
    14  const (
    15  	// port for RPC
    16  	DefaultRPCPort = 8915
    17  	// port for query and register aergosvr
    18  	DefaultSrvPort = 8916
    19  )
    20  
    21  // subprotocol for polaris
    22  const (
    23  	PolarisMapSub  core.ProtocolID = "/polaris/0.1"
    24  	PolarisPingSub core.ProtocolID = "/ping/0.1"
    25  )
    26  const (
    27  	MapQuery p2pcommon.SubProtocol = 0x0100 + iota
    28  	MapResponse
    29  )
    30  
    31  const PolarisConnectionTTL = time.Second * 30
    32  
    33  // Additional messages of polaris response
    34  const (
    35  	TooOldVersionMsg = "too old version"
    36  )
    37