Importing & AI generation

Skip the manual wiring: paste an IDL or Rust struct, import SQL, or connect GitHub.

Building a canvas node by node is fine for a small program and tedious for a large one. Four import paths exist so you rarely have to. All of them produce ordinary nodes on the canvas that you can then edit by hand.

Anchor IDL#

The best option if you have one. Open the import dialog from the Program node header, choose the IDL tab, and paste the JSON.

Syncro reads the IDL and:

  • creates an instruction node for every instruction, with its arguments typed;
  • creates account nodes for the accounts each instruction touches;
  • computes the correct 8-byte Anchor discriminators, which is the part that is most tedious and most error-prone to do by hand;
  • wires the instructions to the Program node.

A preview shows exactly what will be created before anything is added, so you can back out if the IDL was not what you expected.

Rust structs#

No IDL, but you have the program source? Paste a struct instead. The import dialog has separate tabs for instruction structs and account structs, and the Account node has its own inline paste box for a single struct.

state.rs
#[account]
pub struct SwapState {
    pub authority: Pubkey,
    pub amount_in: u64,
    pub amount_out: u64,
    pub is_active: bool,
}

Field names and types are read straight out of the declaration, in order — which matters, because Borsh layouts are positional. Discriminators are derived where they can be inferred and left for you to fill in where they cannot.

SQL schema#

For the destination side. The Import SQL Schema button on the Database node turns pasted CREATE TABLE statements into table nodes. Covered on schema & migrations.

GitHub#

Import from GitHub in the toolbar connects a repository through the Syncro GitHub App and pulls the program interface directly from source — no copy and paste.

Program updates#

Once a repository is connected, Syncro watches it. When the program interface changes upstream, an Updates badge appears in the toolbar with the detected changes listed. Review each one and apply or dismiss it.

Applying an update changes your canvas, not your running indexer. It takes effect on your next deploy, like any other edit.

Generate with AI#

The Generate with AI button drafts the parts of the canvas that are code. Describe what you want indexed in plain language and it can:

  • write the body of transform nodes you already placed;
  • design new transforms, destination tables and trigger payloads for you, if you leave auto-create enabled — which it is by default on an empty canvas;
  • wire the nodes it creates together.

Treat AI output as a first draft from someone who has read your canvas but not your intent. It is a fast way to get from an empty editor to something to correct.