2017-01-25 18:51:41 +01:00
|
|
|
// Copyright 2015-2017 Parity Technologies (UK) Ltd.
|
2016-05-26 16:41:03 +02:00
|
|
|
// This file is part of Parity.
|
|
|
|
|
|
|
|
// Parity is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
|
|
|
|
|
|
|
// Parity is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
|
|
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
#![warn(missing_docs)]
|
|
|
|
#![cfg_attr(all(nightly, feature="dev"), feature(plugin))]
|
|
|
|
#![cfg_attr(all(nightly, feature="dev"), plugin(clippy))]
|
|
|
|
|
|
|
|
//! Signer module
|
|
|
|
//!
|
|
|
|
//! This module manages your private keys and accounts/identities
|
|
|
|
//! that can be used within Dapps.
|
|
|
|
//!
|
2016-06-07 17:21:19 +02:00
|
|
|
//! It exposes API (over `WebSockets`) accessed by Signer UIs.
|
|
|
|
//! Each transaction sent by Dapp is broadcasted to Signer UIs
|
2016-05-26 16:41:03 +02:00
|
|
|
//! and their responsibility is to confirm (or confirm and sign)
|
|
|
|
//! the transaction for you.
|
|
|
|
//!
|
2016-05-27 13:03:00 +02:00
|
|
|
//! ```
|
2017-01-11 20:02:27 +01:00
|
|
|
//! extern crate jsonrpc_core;
|
2016-05-27 13:03:00 +02:00
|
|
|
//! extern crate ethcore_signer;
|
2016-05-30 20:23:19 +02:00
|
|
|
//! extern crate ethcore_rpc;
|
2016-05-26 16:41:03 +02:00
|
|
|
//!
|
2016-05-30 20:23:19 +02:00
|
|
|
//! use std::sync::Arc;
|
2017-01-11 20:02:27 +01:00
|
|
|
//! use jsonrpc_core::IoHandler;
|
|
|
|
//! use jsonrpc_core::reactor::RpcEventLoop;
|
2016-05-30 20:23:19 +02:00
|
|
|
//! use ethcore_signer::ServerBuilder;
|
|
|
|
//! use ethcore_rpc::ConfirmationsQueue;
|
2016-05-27 13:03:00 +02:00
|
|
|
//!
|
|
|
|
//! fn main() {
|
2016-05-30 20:23:19 +02:00
|
|
|
//! let queue = Arc::new(ConfirmationsQueue::default());
|
2017-01-11 20:02:27 +01:00
|
|
|
//! let io = Arc::new(IoHandler::new().into());
|
|
|
|
//! let event_loop = RpcEventLoop::spawn();
|
|
|
|
//! let _server = ServerBuilder::new(queue, "/tmp/authcodes".into())
|
|
|
|
//! .start("127.0.0.1:8084".parse().unwrap(), event_loop.handler(io));
|
2016-05-27 13:03:00 +02:00
|
|
|
//! }
|
|
|
|
//! ```
|
2016-05-26 16:41:03 +02:00
|
|
|
|
|
|
|
#[macro_use]
|
|
|
|
extern crate log;
|
|
|
|
extern crate env_logger;
|
2016-06-07 17:21:19 +02:00
|
|
|
extern crate rand;
|
2016-05-26 16:41:03 +02:00
|
|
|
|
2016-05-26 17:46:44 +02:00
|
|
|
extern crate ethcore_util as util;
|
2016-05-27 15:46:07 +02:00
|
|
|
extern crate ethcore_rpc as rpc;
|
2017-01-11 20:02:27 +01:00
|
|
|
extern crate ethcore_io as io;
|
2016-05-27 17:46:15 +02:00
|
|
|
extern crate jsonrpc_core;
|
2016-05-27 13:03:00 +02:00
|
|
|
extern crate ws;
|
2016-10-17 15:53:33 +02:00
|
|
|
|
2016-09-01 10:16:04 +02:00
|
|
|
extern crate ethcore_devtools as devtools;
|
2016-05-26 17:46:44 +02:00
|
|
|
|
2016-06-07 17:21:19 +02:00
|
|
|
mod authcode_store;
|
2016-05-27 13:03:00 +02:00
|
|
|
mod ws_server;
|
2016-06-07 17:21:19 +02:00
|
|
|
|
2016-10-17 15:53:33 +02:00
|
|
|
/// Exported tests for use in signer RPC client testing
|
|
|
|
pub mod tests;
|
2016-06-07 17:21:19 +02:00
|
|
|
pub use authcode_store::*;
|
2016-05-27 13:03:00 +02:00
|
|
|
pub use ws_server::*;
|