Documentation ¶
Index ¶
- func CreateKey(keyfile string) (*os.File, internal.PrivateKey, error)
- func FakeMoney() types.Money
- func NewRPCMoney(host, user, pass string) (types.Money, error)
- func SetDevAddr(dev string, addr string) error
- type DataConnection
- type Key
- type Logger
- type Node
- type NodeConnection
- type Server
- type TCPTun
- type TCPTunClient
- type TCPTunServer
- type UnixSocket
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateKey ¶
Creates a new keyfile Args:
keyfile: name of the keyfile
Returns:
file, pirvate key, error
func NewRPCMoney ¶
Represents a money connection to an active bitcoin server
func SetDevAddr ¶
SetDevAddr takes a network interface name and an IP address in string form and sets the device up and assigns it an IP address.
Types ¶
type DataConnection ¶
Represents an object capable of sending and receiving packets.
type Key ¶
type Key struct {
// contains filtered or unexported fields
}
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger is used for logging information about what the node knows about the network, where packets are being sent, and confirmation that the packets are were sent (their receipts). Ideally this is all the information required for an intelligent routing algorithm.
func (Logger) LogBloomFilter ¶
func (lgr Logger) LogBloomFilter(brm *internal.BloomReachabilityMap) error
LogBloomFilter logs the node's conglomerate bloom filter. Should be called every time a new bloom filter is received.
func (Logger) LogPacketReceipt ¶
func (lgr Logger) LogPacketReceipt(packet_hash types.PacketHash) error
LogPacketReceipt logs a packet hash from a received receipt. Should be called every time a receipt is received.
func (Logger) LogRoutingDecision ¶
func (lgr Logger) LogRoutingDecision(dest types.NodeAddress, next types.NodeAddress, packet_size int, amt int64, packet_hash types.PacketHash) error
LogRoutingDecision logs information on a sent packet. Should be called every time a packet is sent.
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
A Node is the highest level abstraction over the network. You receive packets from it and send packets to it, and it takes care of everything else.
func (Node) GetNodeAddress ¶
func (n Node) GetNodeAddress() types.NodeAddress
func (Node) IsReachable ¶
func (n Node) IsReachable(addr types.NodeAddress) bool
type NodeConnection ¶
type NodeConnection interface { DataConnection GetNodeAddress() types.NodeAddress }
NodeConnection is an AutoRoute connection between two AutoRoute nodes. It implements a DataConnection (can send and receive AutoRoute packets) but also has a NodeAddress.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
The server handles creating connections and listening on various ports.
type TCPTunClient ¶
type TCPTunClient struct {
// contains filtered or unexported fields
}
func NewTCPTunClient ¶
func NewTCPTunClient(n NodeConnection, tun TCPTun, dest types.NodeAddress, amt int64, tun_name string) *TCPTunClient
NewTCPTunnel creates and starts a TCP tunneling client. After creating a TCP object, it starts the handshake to the server (exit node) specified by dest and returns a pointer to the TCP object. Then it starts listening on the tun and node connection.
func (*TCPTunClient) Close ¶
func (t *TCPTunClient) Close()
func (*TCPTunClient) Error ¶
func (t *TCPTunClient) Error() chan error
type TCPTunServer ¶
type TCPTunServer struct {
// contains filtered or unexported fields
}
func NewTCPTunServer ¶
func NewTCPTunServer(n NodeConnection, tun TCPTun, amt int64) *TCPTunServer
NewTCPTunServer just constructs and returns a TCPTunServer with the given paramters. Unlike NewTCPTunClient, it does not start listening.
func (*TCPTunServer) Close ¶
func (ts *TCPTunServer) Close()
func (*TCPTunServer) Error ¶
func (ts *TCPTunServer) Error() chan error
func (*TCPTunServer) Listen ¶
func (ts *TCPTunServer) Listen()
Listen() starts listening on the tun and AutoRoute connection
type UnixSocket ¶
type UnixSocket struct {
// contains filtered or unexported fields
}
func NewUnixSocket ¶
func NewUnixSocket(path string, d DataConnection) (*UnixSocket, error)
Creates a unix socket which all packets are sent to /from.
func (*UnixSocket) Close ¶
func (u *UnixSocket) Close()