Struct Start

Source
pub struct Start {
Show 28 fields pub network: u16, pub prover: bool, pub client: bool, pub validator: bool, pub private_key: Option<String>, pub private_key_file: Option<PathBuf>, pub node: Option<SocketAddr>, pub bft: Option<SocketAddr>, pub peers: Option<String>, pub validators: Option<String>, pub allow_external_peers: bool, pub rotate_external_peers: bool, pub rest: Option<SocketAddr>, pub rest_rps: u32, pub jwt_secret: Option<String>, pub jwt_timestamp: Option<i64>, pub norest: bool, pub nodisplay: bool, pub verbosity: u8, pub log_filter: Option<String>, pub logfile: PathBuf, pub storage: Option<PathBuf>, pub cdn: Option<String>, pub nocdn: bool, pub dev: Option<u16>, pub dev_num_validators: u16, pub no_dev_txs: bool, pub dev_bonded_balances: Option<BondedBalances>,
}
Expand description

Starts the snarkOS node.

Fields§

§network: u16

Specify the network ID of this node [options: 0 = mainnet, 1 = testnet, 2 = canary]

§prover: bool

Start the node as a prover.

§client: bool

Start the node as a client (default).

Client are “full nodes”, i.e, validate and execute all blocks they receive, but they do not participate in AleoBFT consensus.

§validator: bool

Start the node as a validator.

Validators are “full nodes”, like clients, but also participate in AleoBFT.

§private_key: Option<String>

Specify the account private key of the node

§private_key_file: Option<PathBuf>

Specify the path to a file containing the account private key of the node

§node: Option<SocketAddr>

Set the IP address and port used for P2P communication.

§bft: Option<SocketAddr>

Set the IP address and port used for BFT communication. This argument is only allowed for validator nodes.

§peers: Option<String>

Specify the IP address and port of the peer(s) to connect to (as a comma-separated list).

These peers will be set as “trusted”, which means the node will not disconnect from them when performing peer rotation.

Setting peers to “” has the same effect as not setting the flag at all, except when using --dev.

§validators: Option<String>

Specify the IP address and port of the validator(s) to connect to.

§allow_external_peers: bool

Allow untrusted peers (not listed in --peers) to connect.

The flag will be ignored by client and prover nodes, as tis behavior is always enabled for these types of nodes.

§rotate_external_peers: bool

If the flag is set, a client will periodically evict more external peers

§rest: Option<SocketAddr>

Specify the IP address and port for the REST server

§rest_rps: u32

Specify the requests per second (RPS) rate limit per IP for the REST server

§jwt_secret: Option<String>

Specify the JWT secret for the REST server (16B, base64-encoded).

§jwt_timestamp: Option<i64>

Specify the JWT creation timestamp; can be any time in the last 10 years.

§norest: bool

If the flag is set, the node will not initialize the REST server.

§nodisplay: bool

Write log message to stdout instead of showing a terminal UI.

This is useful, for example, for running a node as a service instead of in the foreground or to pipe its output into a file.

§verbosity: u8

Specify the log verbosity of the node. [options: 0 (lowest log level) to 6 (highest level)]

§log_filter: Option<String>

Set a custom log filtering scheme, e.g., “off,snarkos_bft=trace”, to show all log messages of snarkos_bft but nothing else.

§logfile: PathBuf

Specify the path to the file where logs will be stored

§storage: Option<PathBuf>

Specify the path to a directory containing the storage database for the ledger. This flag overrides the default path, even when --dev is set.

§cdn: Option<String>

Enables the node to prefetch initial blocks from a CDN

§nocdn: bool

If the flag is set, the node will not prefetch from a CDN

§dev: Option<u16>

Enables development mode used to set up test networks.

The purpose of this flag is to run multiple nodes on the same machine and in the same working directory. To do this, set the value to a unique ID within the test work. For example if there are four nodes in the network, pass --dev 0 for the first node, --dev 1 for the second, and so forth.

If you do not explicitly set the --peers flag, this will also populate the set of trusted peers, so that the network is fully connected. Additionally, if you do not set the --rest or the --norest flags, it will also set the REST port to 3030 for the first node, 3031 for the second, and so forth.

§dev_num_validators: u16

If development mode is enabled, specify the number of genesis validator.

§no_dev_txs: bool

If development mode is enabled, specify whether node 0 should generate traffic to drive the network.

§dev_bonded_balances: Option<BondedBalances>

If development mode is enabled, specify the custom bonded balances as a JSON object.

Implementations§

Source§

impl Start

Source

pub fn parse(self) -> Result<String>

Starts the snarkOS node.

Trait Implementations§

Source§

impl Args for Start

Source§

fn group_id() -> Option<Id>

Report the ArgGroup::id for this set of arguments
Source§

fn augment_args<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate Self via FromArgMatches::from_arg_matches_mut Read more
Source§

fn augment_args_for_update<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate self via FromArgMatches::update_from_arg_matches_mut Read more
Source§

impl Clone for Start

Source§

fn clone(&self) -> Start

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl CommandFactory for Start

Source§

fn command<'b>() -> Command

Build a Command that can instantiate Self. Read more
Source§

fn command_for_update<'b>() -> Command

Build a Command that can update self. Read more
Source§

impl Debug for Start

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl FromArgMatches for Start

Source§

fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

impl Parser for Start

Source§

fn parse() -> Self

Parse from std::env::args_os(), exit on error.
Source§

fn try_parse() -> Result<Self, Error>

Parse from std::env::args_os(), return Err on error.
Source§

fn parse_from<I, T>(itr: I) -> Self
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Parse from iterator, exit on error.
Source§

fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Parse from iterator, return Err on error.
Source§

fn update_from<I, T>(&mut self, itr: I)
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Update from iterator, exit on error. Read more
Source§

fn try_update_from<I, T>(&mut self, itr: I) -> Result<(), Error>
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Update from iterator, return Err on error.

Auto Trait Implementations§

§

impl Freeze for Start

§

impl RefUnwindSafe for Start

§

impl Send for Start

§

impl Sync for Start

§

impl Unpin for Start

§

impl UnwindSafe for Start

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,