package main import ( "cwtch.im/cwtch/event" "cwtch.im/cwtch/peer" "git.openprivacy.ca/openprivacy/libricochet-go/connectivity" "git.openprivacy.ca/openprivacy/libricochet-go/log" "os" "path" "time" ) func main() { // System Boilerplate, We need Tor Up and Running log.AddEverythingFromPattern("peer/bob") log.SetLevel(log.LevelDebug) acn, err := connectivity.StartTor(path.Join(".", ".cwtch"), "") if err != nil { log.Errorf("\nError connecting to Tor: %v\n", err) os.Exit(1) } // Set up the Event Buss and Initialize the Peer eventBus := new(event.Manager) eventBus.Initialize() bob := peer.NewCwtchPeer("bob") bob.Init(acn, eventBus) // Add Alice's Onion Here (It changes run to run) bob.PeerWithOnion("upiztu7myymjf2dn4x4czhagp7axlnqjvf5zwfegbhtpkqb6v3vgu5yd") // Send the Message... log.Infof("Waiting for Bob to Connect to Alice...") bob.SendMessageToPeer("upiztu7myymjf2dn4x4czhagp7axlnqjvf5zwfegbhtpkqb6v3vgu5yd", "Hello Alice!!!") // Wait a while... // Everything is run in a goroutine so the main thread has to stay active time.Sleep(time.Second * 100) }