Closed prekucki closed 5 years ago
extern crate gu_client; List peers: ... System::run(|| { let driver = gu_client::async::Driver::from_addr("10.30.8.179:61622"); driver.auth_app("my-app", Some("token")); Arbiter::spawn( driver.list_peers() .and_then(|p| p.for_each(|peer| Ok(println!("peer_id={}", peer.id))) .map_err(|_| ())) }) .... driver.new_session('hd').name('My funny session').send().and_then(|hub_session| { future::ok(hub_session.clone()).join(hub_session.add_peers(&[....])) }).add_then(|(hub_session, add_peers_result)| { future::ok(hub_session.clone()).join(hub_session.new_blob()) }).and_then(|(hub_session, blob)| { let upload_fut = blob.upload(Path::from('/tmp/bug-mp4')) let install_fut = hub_session.peer('...').new_session('hd').image("http://52.31.143.91/images/ffmepg-linux.tar.gz", "391e962681972d5625fc3574e112a4bdae603550").build(); future::ok(hub_session).join2(upload_fut, install_fut) }).and_then(|(hub_session, upload_result, peer_session|) { .... })
use #52 and #54
You can reuse some code from https://github.com/golemfactory/gumpi
See pull request #99.