Skip to main content

submit_post

Function submit_post 

Source
pub async fn submit_post(
    runtime_services: Arc<RuntimeServices>,
    client_id: &ClientId,
    key_locker: &Arc<dyn KeyLocker>,
    post_bundle_manager: Arc<LivePostBundleManager>,
    peer_tracker: Arc<RwLock<PeerTracker>>,
    recent_posts_pen: &Arc<RwLock<RecentPostsPen>>,
    post: &str,
    wait_for_all_submissions: bool,
) -> Result<(Vec<SubmitPostCommitTokenV1>, (EncodedPostV1, Bytes))>
Expand description

Submit a post to the network.

The parse + encode happen in the foreground, then [post_to_locations] is run as a background task that streams each successful server commit back over a channel. With wait_for_all_submissions == true the foreground drains every outcome before returning (so the returned token list and recent-posts pen are fully populated); with false it returns the instant the mandatory User-bucket post secures its first commit and lets the background finish the remaining redundancy and secondary buckets (visible via the PoW job tracker).