Docs
La Recherche⌘ K
  • Accueil
  • À propos de The Graph
  • Réseaux pris en charge
  • Contrats du Protocole
  • Subgraphs
    • Substreams
      • Token API
        • AI Suite
          • Indexing
            • Resources
              Archived > Scaling with Arbitrum

              14 minutes

              Guide des outils de transfert L2

              The Graph a facilité le passage à L2 sur Arbitrum One. Pour chaque participant au protocole, il existe un ensemble d’outils de transfert L2 permettant de rendre le transfert vers L2 transparent pour tous les participants du réseau. Ces outils vous obligeront à suivre un ensemble d’étapes spécifiques en fonction de ce que vous transférez.

              Some frequent questions about these tools are answered in the L2 Transfer Tools FAQ. The FAQs contain in-depth explanations of how to use the tools, how they work, and things to keep in mind when using them.

              How to transfer your Subgraph to Arbitrum (L2)

              How to Transfer Subgraphs To Arbitrum One

              Benefits of transferring your Subgraphs

              La communauté et les développeurs du Graph se sont préparés (https://forum.thegraph.com/t/gip-0031-arbitrum-grt-bridge/3305⁠) à passer à Arbitrum au cours de l’année écoulée. Arbitrum, une blockchain de couche 2 ou “L2”, hérite de la sécurité d’Ethereum mais offre des frais de gaz considérablement réduits.

              When you publish or upgrade your Subgraph to The Graph Network, you’re interacting with smart contracts on the protocol and this requires paying for gas using ETH. By moving your Subgraphs to Arbitrum, any future updates to your Subgraph will require much lower gas fees. The lower fees, and the fact that curation bonding curves on L2 are flat, also make it easier for other Curators to curate on your Subgraph, increasing the rewards for Indexers on your Subgraph. This lower-cost environment also makes it cheaper for Indexers to index and serve your Subgraph. Indexing rewards will be increasing on Arbitrum and decreasing on Ethereum mainnet over the coming months, so more and more Indexers will be transferring their stake and setting up their operations on L2.

              Understanding what happens with signal, your L1 Subgraph and query URLs

              Transferring a Subgraph to Arbitrum uses the Arbitrum GRT bridge, which in turn uses the native Arbitrum bridge, to send the Subgraph to L2. The “transfer” will deprecate the Subgraph on mainnet and send the information to re-create the Subgraph on L2 using the bridge. It will also include the Subgraph owner’s signaled GRT, which must be more than zero for the bridge to accept the transfer.

              When you choose to transfer the Subgraph, this will convert all of the Subgraph’s curation signal to GRT. This is equivalent to “deprecating” the Subgraph on mainnet. The GRT corresponding to your curation will be sent to L2 together with the Subgraph, where they will be used to mint signal on your behalf.

              Other Curators can choose whether to withdraw their fraction of GRT, or also transfer it to L2 to mint signal on the same Subgraph. If a Subgraph owner does not transfer their Subgraph to L2 and manually deprecates it via a contract call, then Curators will be notified and will be able to withdraw their curation.

              As soon as the Subgraph is transferred, since all curation is converted to GRT, Indexers will no longer receive rewards for indexing the Subgraph. However, there will be Indexers that will 1) keep serving transferred Subgraphs for 24 hours, and 2) immediately start indexing the Subgraph on L2. Since these Indexers already have the Subgraph indexed, there should be no need to wait for the Subgraph to sync, and it will be possible to query the L2 Subgraph almost immediately.

              Queries to the L2 Subgraph will need to be done to a different URL (on arbitrum-gateway.thegraph.com), but the L1 URL will continue working for at least 48 hours. After that, the L1 gateway will forward queries to the L2 gateway (for some time), but this will add latency so it is recommended to switch all your queries to the new URL as soon as possible.

              Choisir son portefeuille L2

              When you published your Subgraph on mainnet, you used a connected wallet to create the Subgraph, and this wallet owns the NFT that represents this Subgraph and allows you to publish updates.

              When transferring the Subgraph to Arbitrum, you can choose a different wallet that will own this Subgraph NFT on L2.

              Si vous utilisez un portefeuille “normal” comme MetaMask (un Externally Owned Account ou EOA, c’est-à-dire un portefeuille qui n’est pas un smart contract), cette étape est facultative et il est recommandé de conserver la même adresse de propriétaire que dans L1.portefeuille.

              If you’re using a smart contract wallet, like a multisig (e.g. a Safe), then choosing a different L2 wallet address is mandatory, as it is most likely that this account only exists on mainnet and you will not be able to make transactions on Arbitrum using this wallet. If you want to keep using a smart contract wallet or multisig, create a new wallet on Arbitrum and use its address as the L2 owner of your Subgraph.

              It is very important to use a wallet address that you control, and that can make transactions on Arbitrum. Otherwise, the Subgraph will be lost and cannot be recovered.

              Préparer le transfert : faire le pont avec quelques EPF

              Transferring the Subgraph involves sending a transaction through the bridge, and then executing another transaction on Arbitrum. The first transaction uses ETH on mainnet, and includes some ETH to pay for gas when the message is received on L2. However, if this gas is insufficient, you will have to retry the transaction and pay for the gas directly on L2 (this is “Step 3: Confirming the transfer” below). This step must be executed within 7 days of starting the transfer. Moreover, the second transaction (“Step 4: Finishing the transfer on L2”) will be done directly on Arbitrum. For these reasons, you will need some ETH on an Arbitrum wallet. If you’re using a multisig or smart contract account, the ETH will need to be in the regular (EOA) wallet that you are using to execute the transactions, not on the multisig wallet itself.

              Vous pouvez acheter de l’ETH sur certains échanges et le retirer directement sur Arbitrum, ou vous pouvez utiliser le pont Arbitrum pour envoyer de l’ETH d’un portefeuille du mainnet vers L2 : bridge.arbitrum.io⁠. Étant donné que les frais de gaz sur Arbitrum sont moins élevés, vous ne devriez avoir besoin que d’une petite quantité. Il est recommandé de commencer par un seuil bas (0,par exemple 01 ETH) pour que votre transaction soit approuvée.

              Finding the Subgraph Transfer Tool

              You can find the L2 Transfer Tool when you’re looking at your Subgraph’s page on Subgraph Studio:

              outil de transfert

              It is also available on Explorer if you’re connected with the wallet that owns a Subgraph and on that Subgraph’s page on Explorer:

              Transfert vers L2

              En cliquant sur le bouton Transférer vers L2, vous ouvrirez l’outil de transfert qui vous permettra de lancer la procédure de transfert.

              Étape 1 : Démarrer le transfert

              Before starting the transfer, you must decide which address will own the Subgraph on L2 (see “Choosing your L2 wallet” above), and it is strongly recommend having some ETH for gas already bridged on Arbitrum (see “Preparing for the transfer: bridging some ETH” above).

              Also please note transferring the Subgraph requires having a nonzero amount of signal on the Subgraph with the same account that owns the Subgraph; if you haven’t signaled on the Subgraph you will have to add a bit of curation (adding a small amount like 1 GRT would suffice).

              After opening the Transfer Tool, you will be able to input the L2 wallet address into the “Receiving wallet address” field - make sure you’ve entered the correct address here. Clicking on Transfer Subgraph will prompt you to execute the transaction on your wallet (note some ETH value is included to pay for L2 gas); this will initiate the transfer and deprecate your L1 Subgraph (see “Understanding what happens with signal, your L1 Subgraph and query URLs” above for more details on what goes on behind the scenes).

              If you execute this step, make sure you proceed until completing step 3 in less than 7 days, or the Subgraph and your signal GRT will be lost. This is due to how L1-L2 messaging works on Arbitrum: messages that are sent through the bridge are “retry-able tickets” that must be executed within 7 days, and the initial execution might need a retry if there are spikes in the gas price on Arbitrum.

              Démarrer le transfert vers la L2

              Step 2: Waiting for the Subgraph to get to L2

              After you start the transfer, the message that sends your L1 Subgraph to L2 must propagate through the Arbitrum bridge. This takes approximately 20 minutes (the bridge waits for the mainnet block containing the transaction to be “safe” from potential chain reorgs).

              Une fois ce temps d’attente terminé, le réseau Arbitrum tentera d’exécuter automatiquement le transfert sur les contrats L2.

              Écran d'attente

              Étape 3 : Confirmer le transfert

              In most cases, this step will auto-execute as the L2 gas included in step 1 should be sufficient to execute the transaction that receives the Subgraph on the Arbitrum contracts. In some cases, however, it is possible that a spike in gas prices on Arbitrum causes this auto-execution to fail. In this case, the “ticket” that sends your Subgraph to L2 will be pending and require a retry within 7 days.

              Si c’est le cas, vous devrez vous connecter en utilisant un portefeuille L2 qui contient de l’ETH sur Arbitrum, changer le réseau de votre portefeuille vers Arbitrum, et cliquer sur “Confirmer le transfert” pour retenter la transaction.

              Confirmer le transfert vers L2

              Étape 4 : Terminer le transfert sur L2

              At this point, your Subgraph and GRT have been received on Arbitrum, but the Subgraph is not published yet. You will need to connect using the L2 wallet that you chose as the receiving wallet, switch your wallet network to Arbitrum, and click “Publish Subgraph.”

              Publish the Subgraph
              Wait for the Subgraph to be published

              This will publish the Subgraph so that Indexers that are operating on Arbitrum can start serving it. It will also mint curation signal using the GRT that were transferred from L1.

              Étape 5 : Mise à jour de l’URL de la requête

              Your Subgraph has been successfully transferred to Arbitrum! To query the Subgraph, the new URL will be :

              https://arbitrum-gateway.thegraph.com/api/[api-key]/subgraphs/id/[l2-subgraph-id]\`⁠

              Note that the Subgraph ID on Arbitrum will be a different than the one you had on mainnet, but you can always find it on Explorer or Studio. As mentioned above (see “Understanding what happens with signal, your L1 Subgraph and query URLs”) the old L1 URL will be supported for a short while, but you should switch your queries to the new address as soon as the Subgraph has been synced on L2.

              Comment transférer votre curation vers Arbitrum (L2)

              Understanding what happens to curation on Subgraph transfers to L2

              When the owner of a Subgraph transfers a Subgraph to Arbitrum, all of the Subgraph’s signal is converted to GRT at the same time. This applies to “auto-migrated” signal, i.e. signal that is not specific to a Subgraph version or deployment but that follows the latest version of a Subgraph.

              This conversion from signal to GRT is the same as what would happen if the Subgraph owner deprecated the Subgraph in L1. When the Subgraph is deprecated or transferred, all curation signal is “burned” simultaneously (using the curation bonding curve) and the resulting GRT is held by the GNS smart contract (that is the contract that handles Subgraph upgrades and auto-migrated signal). Each Curator on that Subgraph therefore has a claim to that GRT proportional to the amount of shares they had for the Subgraph.

              A fraction of these GRT corresponding to the Subgraph owner is sent to L2 together with the Subgraph.

              At this point, the curated GRT will not accrue any more query fees, so Curators can choose to withdraw their GRT or transfer it to the same Subgraph on L2, where it can be used to mint new curation signal. There is no rush to do this as the GRT can be help indefinitely and everybody gets an amount proportional to their shares, irrespective of when they do it.

              Choisir son portefeuille L2

              Si vous décidez de transférer votre GRT organisé vers L2, vous pouvez choisir un autre portefeuille qui détiendra le signal de curation sur L2.

              Si vous utilisez un portefeuille « normal » comme Metamask (un compte externe ou EOA, c’est-à-dire un portefeuille qui n’est pas un contrat intelligent), alors ceci est facultatif et il est recommandé de conserver la même adresse de conservateur qu’en L1.

              Si vous utilisez un portefeuille de contrat intelligent, comme un multisig (par exemple un coffre-fort), alors choisir une autre adresse de portefeuille L2 est obligatoire, car il est fort probable que ce compte n’existe que sur le mainnet et que vous ne pourrez pas effectuer de transactions. sur Arbitrum en utilisant ce portefeuille. Si vous souhaitez continuer à utiliser un portefeuille de contrat intelligent ou multisig, créez un nouveau portefeuille sur Arbitrum et utilisez son adresse comme adresse du portefeuille de réception L2.

              Il est très important d’utiliser une adresse de portefeuille que vous contrôlez et qui peut effectuer des transactions sur Arbitrum, sinon la curation sera perdue et ne pourra pas être récupérée.

              Envoi de la curation à L2 : Étape 1

              Avant de commencer le transfert, vous devez décider quelle adresse détiendra la curation sur L2 (voir “Choisir votre portefeuille L2” ci-dessus), et il est recommandé d’avoir des ETH pour le gaz déjà pontés sur Arbitrum au cas où vous auriez besoin de réessayer l’exécution du message sur L2. Vous pouvez acheter de l’ETH sur certaines bourses et le retirer directement sur Arbitrum, ou vous pouvez utiliser le pont Arbitrum pour envoyer de l’ETH depuis un portefeuille du mainnet vers L2 : bridge.arbitrum.io⁠ - étant donné que les frais de gaz sur Arbitrum sont si bas, vous ne devriez avoir besoin que d’un petit montant, par ex. 0,01 ETH sera probablement plus que suffisant.

              If a Subgraph that you curate to has been transferred to L2, you will see a message on Explorer telling you that you’re curating to a transferred Subgraph.

              When looking at the Subgraph page, you can choose to withdraw or transfer the curation. Clicking on “Transfer Signal to Arbitrum” will open the transfer tool.

              Signal de transfert](/img/transferSignalL2TransferTools.png)

              Après avoir ouvert l’outil de transfert, vous serez peut-être invité à ajouter de l’ETH à votre portefeuille si vous n’en avez pas. Vous pourrez ensuite saisir l’adresse du portefeuille L2 dans le champ “Adresse du portefeuille de réception” - assurez-vous d’avoir saisi la bonne adresse ici. En cliquant sur Transfer Signal, vous serez invité à exécuter la transaction sur votre portefeuille (notez qu’une certaine valeur ETH est incluse pour payer le gaz L2) ; cela lancera le transfert.

              Si vous exécutez cette étape, assurez-vous de procéder jusqu’à la complétion de l’étape 3 en moins de 7 jours, sinon vos GRT signalés seront perdus. Cela est dû à la façon dont la messagerie L1-L2 fonctionne sur Arbitrum : les messages qui sont envoyés à travers le pont sont des “tickets à retenter” qui doivent être exécutés dans les 7 jours, et l’exécution initiale peut nécessiter une nouvelle tentative s’il y a des pics dans le prix du gaz sur Arbitrum.

              Envoi de la curation vers L2 : étape 2

              Démarrage du transfert :

              Envoyer un signal à L2

              Une fois que vous avez commencé le transfert, le message qui envoie votre curation L1 à L2 doit se propager à travers le pont Arbitrum. Cela prend environ 20 minutes (le pont attend que le bloc du mainnet contenant la transaction soit “à l’abri” d’une éventuelle réorganisation de la chaîne).

              Une fois ce temps d’attente terminé, le réseau Arbitrum tentera d’exécuter automatiquement le transfert sur les contrats L2.

              Envoi du signal de curation à L2

              Envoi de la curation vers L2 : étape 3

              Dans la plupart des cas, cette étape s’exécutera automatiquement car le gaz L2 inclus dans l’étape 1 devrait être suffisant pour exécuter la transaction qui reçoit la curation sur les contrats Arbitrum. Dans certains cas, cependant, il est possible qu’une flambée des prix du gaz sur Arbitrum fasse échouer cette exécution automatique. Dans ce cas, le « ticket » qui envoie votre curation vers L2 sera en attente et nécessitera une nouvelle tentative sous 7 jours.

              Si c’est le cas, vous devrez vous connecter en utilisant un portefeuille L2 qui contient de l’ETH sur Arbitrum, changer le réseau de votre portefeuille vers Arbitrum, et cliquer sur “Confirmer le transfert” pour retenter la transaction.

              Envoyer un signal à L2

              Retrait de la curation sur L1

              If you prefer not to send your GRT to L2, or you’d rather bridge the GRT manually, you can withdraw your curated GRT on L1. On the banner on the Subgraph page, choose “Withdraw Signal” and confirm the transaction; the GRT will be sent to your Curator address.

              ⁠Edit on GitHub⁠

              FAQ sur les outils de transfert L2
              On this page
              • How to transfer your Subgraph to Arbitrum (L2)
              • Benefits of transferring your Subgraphs
              • Understanding what happens with signal, your L1 Subgraph and query URLs
              • Choisir son portefeuille L2
              • Préparer le transfert : faire le pont avec quelques EPF
              • Finding the Subgraph Transfer Tool
              • Étape 1 : Démarrer le transfert
              • Step 2: Waiting for the Subgraph to get to L2
              • Étape 3 : Confirmer le transfert
              • Étape 4 : Terminer le transfert sur L2
              • Étape 5 : Mise à jour de l’URL de la requête
              • Comment transférer votre curation vers Arbitrum (L2)
              • Understanding what happens to curation on Subgraph transfers to L2
              • Choisir son portefeuille L2
              • Envoi de la curation à L2 : Étape 1
              • Envoi de la curation vers L2 : étape 2
              • Envoi de la curation vers L2 : étape 3
              • Retrait de la curation sur L1
              The GraphStatusTestnetActifs de la MarqueForumSécuritéPolitique de confidentialitéConditions d'utilisation