Function tari_wallet_ffi::comms_config_create[][src]

#[no_mangle]pub unsafe extern "C" fn comms_config_create(
    public_address: *const c_char,
    transport_type: *const TariTransportType,
    database_name: *const c_char,
    datastore_path: *const c_char,
    discovery_timeout_in_secs: c_ulonglong,
    error_out: *mut c_int
) -> *mut TariCommsConfig

---------------------------------------------------------------------------------------------/// ----------------------------------- CommsConfig ---------------------------------------------/// Creates a TariCommsConfig. The result from this function is required when initializing a TariWallet.

Arguments

public_address - The public address char array pointer. This is the address that the wallet advertises publicly to peers transport_type - TariTransportType that specifies the type of comms transport to be used. connections are moved to after initial connection. Default if null is 0.0.0.0:7898 which will accept connections from all IP address on port 7898 database_name - The database name char array pointer. This is the unique name of this wallet's database database_path - The database path char array pointer which. This is the folder path where the database files will be created and the application has write access to discovery_timeout_in_secs: specify how long the Discovery Timeout for the wallet is. error_out - Pointer to an int which will be modified to an error code should one occur, may not be null. Functions as an out parameter.

Returns

*mut TariCommsConfig - Returns a pointer to a TariCommsConfig, if any of the parameters are null or a problem is encountered when constructing the NetAddress a ptr::null_mut() is returned

Safety

The comms_config_destroy method must be called when finished with a TariCommsConfig to prevent a memory leak