Lazzeruz 3bfd50a3d9 Dev init
Just some name changes, put in a stand in emission amount, and started copying the algo from Karlsen. Not release worthy yet. Therefore Dev branch exists now.

Also, for now this is for research purposes only. I got no clue what to build on top of Kaspa yet.
Help would be appreciated for ideas and implementations.
2023-12-09 20:46:33 +01:00

28 lines
892 B
Go

package common
import (
peerpkg "github.com/zoomy-network/zoomyd/app/protocol/peer"
routerpkg "github.com/zoomy-network/zoomyd/infrastructure/network/netadapter/router"
"time"
"github.com/pkg/errors"
)
// DefaultTimeout is the default duration to wait for enqueuing/dequeuing
// to/from routes.
const DefaultTimeout = 120 * time.Second
// ErrPeerWithSameIDExists signifies that a peer with the same ID already exist.
var ErrPeerWithSameIDExists = errors.New("ready peer with the same ID already exists")
type flowExecuteFunc func(peer *peerpkg.Peer)
// Flow is a a data structure that is used in order to associate a p2p flow to some route in a router.
type Flow struct {
Name string
ExecuteFunc flowExecuteFunc
}
// FlowInitializeFunc is a function that is used in order to initialize a flow
type FlowInitializeFunc func(route *routerpkg.Route, peer *peerpkg.Peer) error