GraphSync.svg 52.7 KB
Newer Older
1
<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" contentScriptType="application/ecmascript" contentStyleType="text/css" height="1519px" preserveAspectRatio="none" style="width:4936px;height:1519px;" version="1.1" viewBox="0 0 4936 1519" width="4936px" zoomAndPan="magnify"><defs><filter height="300%" id="f4yurevpk0xxf" width="300%" x="-1" y="-1"><feGaussianBlur result="blurOut" stdDeviation="2.0"/><feColorMatrix in="blurOut" result="blurOut2" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .4 0"/><feOffset dx="4.0" dy="4.0" in="blurOut2" result="blurOut3"/><feBlend in="SourceGraphic" in2="blurOut3" mode="normal"/></filter></defs><g><!--cluster go-ipld-format--><polygon fill="#FFFFFF" filter="url(#f4yurevpk0xxf)" points="1324,240.5,1443,240.5,1450,262.9883,1453,262.9883,1453,323.5,1324,323.5,1324,240.5" style="stroke: #000000; stroke-width: 1.5;"/><line style="stroke: #000000; stroke-width: 1.5;" x1="1324" x2="1450" y1="262.9883" y2="262.9883"/><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacingAndGlyphs" textLength="113" x="1328" y="256.0352">go-ipld-format</text><!--cluster go-selector--><polygon fill="#FFFFFF" filter="url(#f4yurevpk0xxf)" points="14,400,104,400,111,422.4883,1658,422.4883,1658,509,14,509,14,400" style="stroke: #000000; stroke-width: 1.5;"/><line style="stroke: #000000; stroke-width: 1.5;" x1="14" x2="111" y1="422.4883" y2="422.4883"/><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacingAndGlyphs" textLength="84" x="18" y="415.5352">go-selector</text><!--cluster go-graphsync--><polygon fill="#FFFFFF" filter="url(#f4yurevpk0xxf)" points="1666,195,1772,195,1779,217.4883,4914,217.4883,4914,1507,1666,1507,1666,195" style="stroke: #000000; stroke-width: 1.5;"/><line style="stroke: #000000; stroke-width: 1.5;" x1="1666" x2="1779" y1="217.4883" y2="217.4883"/><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacingAndGlyphs" textLength="100" x="1670" y="210.5352">go-graphsync</text><!--cluster network--><polygon fill="#FFFFFF" filter="url(#f4yurevpk0xxf)" points="1674,768,1739,768,1746,790.4883,3279,790.4883,3279,1302,1674,1302,1674,768" style="stroke: #000000; stroke-width: 1.5;"/><line style="stroke: #000000; stroke-width: 1.5;" x1="1674" x2="1746" y1="790.4883" y2="790.4883"/><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacingAndGlyphs" textLength="59" x="1678" y="783.5352">network</text><!--cluster requestmanager--><polygon fill="#FFFFFF" filter="url(#f4yurevpk0xxf)" points="1674,540,1796,540,1803,562.4883,2598,562.4883,2598,675,1674,675,1674,540" style="stroke: #000000; stroke-width: 1.5;"/><line style="stroke: #000000; stroke-width: 1.5;" x1="1674" x2="1803" y1="562.4883" y2="562.4883"/><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacingAndGlyphs" textLength="116" x="1678" y="555.5352">requestmanager</text><!--cluster responsemanager--><polygon fill="#FFFFFF" filter="url(#f4yurevpk0xxf)" points="2616,546.5,2749,546.5,2756,568.9883,3345,568.9883,3345,668.5,2616,668.5,2616,546.5" style="stroke: #000000; stroke-width: 1.5;"/><line style="stroke: #000000; stroke-width: 1.5;" x1="2616" x2="2756" y1="568.9883" y2="568.9883"/><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacingAndGlyphs" textLength="127" x="2620" y="562.0352">responsemanager</text><!--cluster message--><polygon fill="#FFFFFF" filter="url(#f4yurevpk0xxf)" points="3287,983,3356,983,3363,1005.4883,4906,1005.4883,4906,1499,3287,1499,3287,983" style="stroke: #000000; stroke-width: 1.5;"/><line style="stroke: #000000; stroke-width: 1.5;" x1="3287" x2="3363" y1="1005.4883" y2="1005.4883"/><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacingAndGlyphs" textLength="63" x="3291" y="998.5352">message</text><!--cluster go-filecoin--><polygon fill="#FFFFFF" filter="url(#f4yurevpk0xxf)" points="1175,16,1262,16,1269,38.4883,1541,38.4883,1541,164,1175,164,1175,16" style="stroke: #000000; stroke-width: 1.5;"/><line style="stroke: #000000; stroke-width: 1.5;" x1="1175" x2="1269" y1="38.4883" y2="38.4883"/><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacingAndGlyphs" textLength="81" x="1179" y="31.5352">go-filecoin</text><!--class Node--><rect fill="#FEFECE" filter="url(#f4yurevpk0xxf)" height="48" id="Node" style="stroke: #A80036; stroke-width: 1.5;" width="63" x="1342.5" y="267.5"/><ellipse cx="1357.5" cy="283.5" fill="#B4A7E5" rx="11" ry="11" style="stroke: #A80036; stroke-width: 1.0;"/><path d="M1353.4277,279.2651 L1353.4277,277.1069 L1360.8071,277.1069 L1360.8071,279.2651 L1358.3418,279.2651 L1358.3418,287.3418 L1360.8071,287.3418 L1360.8071,289.5 L1353.4277,289.5 L1353.4277,287.3418 L1355.8931,287.3418 L1355.8931,279.2651 Z "/><text fill="#000000" font-family="sans-serif" font-size="12" font-style="italic" lengthAdjust="spacingAndGlyphs" textLength="31" x="1371.5" y="288.0352">Node</text><line style="stroke: #A80036; stroke-width: 1.5;" x1="1343.5" x2="1404.5" y1="299.5" y2="299.5"/><line style="stroke: #A80036; stroke-width: 1.5;" x1="1343.5" x2="1404.5" y1="307.5" y2="307.5"/><!--class Selector--><rect fill="#FEFECE" filter="url(#f4yurevpk0xxf)" height="48" id="Selector" style="stroke: #A80036; stroke-width: 1.5;" width="77" x="383.5" y="440"/><ellipse cx="398.5" cy="456" fill="#B4A7E5" rx="11" ry="11" style="stroke: #A80036; stroke-width: 1.0;"/><path d="M394.4277,451.7651 L394.4277,449.6069 L401.8071,449.6069 L401.8071,451.7651 L399.3418,451.7651 L399.3418,459.8418 L401.8071,459.8418 L401.8071,462 L394.4277,462 L394.4277,459.8418 L396.8931,459.8418 L396.8931,451.7651 Z "/><text fill="#000000" font-family="sans-serif" font-size="12" font-style="italic" lengthAdjust="spacingAndGlyphs" textLength="45" x="412.5" y="460.5352">Selector</text><line style="stroke: #A80036; stroke-width: 1.5;" x1="384.5" x2="459.5" y1="472" y2="472"/><line style="stroke: #A80036; stroke-width: 1.5;" x1="384.5" x2="459.5" y1="480" y2="480"/><!--class SelectionResponse--><rect fill="#FEFECE" filter="url(#f4yurevpk0xxf)" height="48" id="SelectionResponse" style="stroke: #A80036; stroke-width: 1.5;" width="138" x="1001" y="440"/><ellipse cx="1016" cy="456" fill="#B4A7E5" rx="11" ry="11" style="stroke: #A80036; stroke-width: 1.0;"/><path d="M1011.9277,451.7651 L1011.9277,449.6069 L1019.3071,449.6069 L1019.3071,451.7651 L1016.8418,451.7651 L1016.8418,459.8418 L1019.3071,459.8418 L1019.3071,462 L1011.9277,462 L1011.9277,459.8418 L1014.3931,459.8418 L1014.3931,451.7651 Z "/><text fill="#000000" font-family="sans-serif" font-size="12" font-style="italic" lengthAdjust="spacingAndGlyphs" textLength="106" x="1030" y="460.5352">SelectionResponse</text><line style="stroke: #A80036; stroke-width: 1.5;" x1="1002" x2="1138" y1="472" y2="472"/><line style="stroke: #A80036; stroke-width: 1.5;" x1="1002" x2="1138" y1="480" y2="480"/><!--class SelectionTraverser--><rect fill="#FEFECE" filter="url(#f4yurevpk0xxf)" height="73.9102" id="SelectionTraverser" style="stroke: #A80036; stroke-width: 1.5;" width="170" x="761" y="427"/><ellipse cx="790.4" cy="443" fill="#B4A7E5" rx="11" ry="11" style="stroke: #A80036; stroke-width: 1.0;"/><path d="M786.3277,438.7651 L786.3277,436.6069 L793.7071,436.6069 L793.7071,438.7651 L791.2418,438.7651 L791.2418,446.8418 L793.7071,446.8418 L793.7071,449 L786.3277,449 L786.3277,446.8418 L788.7931,446.8418 L788.7931,438.7651 Z "/><text fill="#000000" font-family="sans-serif" font-size="12" font-style="italic" lengthAdjust="spacingAndGlyphs" textLength="106" x="807.6" y="447.5352">SelectionTraverser</text><line style="stroke: #A80036; stroke-width: 1.5;" x1="762" x2="930" y1="459" y2="459"/><line style="stroke: #A80036; stroke-width: 1.5;" x1="762" x2="930" y1="467" y2="467"/><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="158" x="767" y="481.6348">Next() SelectionResponse, err</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="44" x="767" y="494.5898">Cancel()</text><!--class GetBlockFunc--><rect fill="#FEFECE" filter="url(#f4yurevpk0xxf)" height="48" id="GetBlockFunc" style="stroke: #A80036; stroke-width: 1.5;" width="230" x="496" y="440"/><ellipse cx="511" cy="456" fill="#B4A7E5" rx="11" ry="11" style="stroke: #A80036; stroke-width: 1.0;"/><path d="M506.9277,451.7651 L506.9277,449.6069 L514.3071,449.6069 L514.3071,451.7651 L511.8418,451.7651 L511.8418,459.8418 L514.3071,459.8418 L514.3071,462 L506.9277,462 L506.9277,459.8418 L509.3931,459.8418 L509.3931,451.7651 Z "/><text fill="#000000" font-family="sans-serif" font-size="12" font-style="italic" lengthAdjust="spacingAndGlyphs" textLength="198" x="525" y="460.5352">GetBlockFunc func(cid) block.Block</text><line style="stroke: #A80036; stroke-width: 1.5;" x1="497" x2="725" y1="472" y2="472"/><line style="stroke: #A80036; stroke-width: 1.5;" x1="497" x2="725" y1="480" y2="480"/><!--class SelectorQuerier--><rect fill="#FEFECE" filter="url(#f4yurevpk0xxf)" height="73.9102" id="SelectorQuerier" style="stroke: #A80036; stroke-width: 1.5;" width="475" x="1174.5" y="427"/><ellipse cx="1363.75" cy="443" fill="#B4A7E5" rx="11" ry="11" style="stroke: #A80036; stroke-width: 1.0;"/><path d="M1359.6777,438.7651 L1359.6777,436.6069 L1367.0571,436.6069 L1367.0571,438.7651 L1364.5918,438.7651 L1364.5918,446.8418 L1367.0571,446.8418 L1367.0571,449 L1359.6777,449 L1359.6777,446.8418 L1362.1431,446.8418 L1362.1431,438.7651 Z "/><text fill="#000000" font-family="sans-serif" font-size="12" font-style="italic" lengthAdjust="spacingAndGlyphs" textLength="88" x="1384.25" y="447.5352">SelectorQuerier</text><line style="stroke: #A80036; stroke-width: 1.5;" x1="1175.5" x2="1648.5" y1="459" y2="459"/><line style="stroke: #A80036; stroke-width: 1.5;" x1="1175.5" x2="1648.5" y1="467" y2="467"/><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="235" x="1180.5" y="481.6348">Select(Selector, root Cid) SelectionTraverser</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="463" x="1180.5" y="494.5898">Validate(Selector, root Cid, incomingResponses SelectionTraverser) SelectionTraverser</text><rect fill="#FEFECE" filter="url(#f4yurevpk0xxf)" height="37.9102" style="stroke: #A80036; stroke-width: 1.5;" width="326" x="22" y="445"/><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacingAndGlyphs" textLength="143" x="113.5" y="458.6016">Package Public Functions</text><line style="stroke: #A80036; stroke-width: 1.5;" x1="23" x2="347" y1="463.1328" y2="463.1328"/><text fill="#000000" font-family="sans-serif" font-size="10" lengthAdjust="spacingAndGlyphs" textLength="314" x="28" y="476.8008">NewSelectorQuerier(getBlockFunc GetBlockFunc) SelectorQuerier</text><!--class GraphSync--><rect fill="#FEFECE" filter="url(#f4yurevpk0xxf)" height="138.6855" id="GraphSync" style="stroke: #A80036; stroke-width: 1.5;" width="460" x="1798" y="222"/><ellipse cx="1993.25" cy="238" fill="#ADD1B2" rx="11" ry="11" style="stroke: #A80036; stroke-width: 1.0;"/><path d="M1996.2231,243.6431 Q1995.6421,243.9419 1995.0029,244.0913 Q1994.3638,244.2407 1993.6582,244.2407 Q1991.1514,244.2407 1989.8315,242.5889 Q1988.5117,240.937 1988.5117,237.8159 Q1988.5117,234.6865 1989.8315,233.0347 Q1991.1514,231.3828 1993.6582,231.3828 Q1994.3638,231.3828 1995.0112,231.5322 Q1995.6587,231.6816 1996.2231,231.9805 L1996.2231,234.7031 Q1995.5923,234.1221 1994.9988,233.8523 Q1994.4053,233.5825 1993.7744,233.5825 Q1992.4297,233.5825 1991.7449,234.6492 Q1991.0601,235.7158 1991.0601,237.8159 Q1991.0601,239.9077 1991.7449,240.9744 Q1992.4297,242.041 1993.7744,242.041 Q1994.4053,242.041 1994.9988,241.7712 Q1995.5923,241.5015 1996.2231,240.9204 Z "/><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacingAndGlyphs" textLength="61" x="2013.75" y="242.5352">GraphSync</text><line style="stroke: #A80036; stroke-width: 1.5;" x1="1799" x2="2257" y1="254" y2="254"/><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="160" x="1804" y="268.6348">network : GraphySyncNetwork</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="185" x="1804" y="281.5898">requestManager : RequestManager</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="200" x="1804" y="294.5449">responseManager: ResponseManager</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="174" x="1804" y="307.5">selectorQuerier: SelectorQuerier</text><line style="stroke: #A80036; stroke-width: 1.5;" x1="1799" x2="2257" y1="313.8203" y2="313.8203"/><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="347" x="1804" y="328.4551">Request(p peer.ID, selector Selector, root Cid) SelectionTraverser</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="448" x="1804" y="341.4102">ReceiveMessage(ctx context.Context, sender peer.ID, incoming GraphSyncMessage)</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="104" x="1804" y="354.3652">ReceiveError(error)</text><rect fill="#FEFECE" filter="url(#f4yurevpk0xxf)" height="37.9102" style="stroke: #A80036; stroke-width: 1.5;" width="490" x="2293" y="272.5"/><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacingAndGlyphs" textLength="135" x="2470.5" y="286.1016">PackagePublicFunctions</text><line style="stroke: #A80036; stroke-width: 1.5;" x1="2294" x2="2782" y1="290.6328" y2="290.6328"/><text fill="#000000" font-family="sans-serif" font-size="10" lengthAdjust="spacingAndGlyphs" textLength="478" x="2299" y="304.3008">New(ctx context.Context, network GraphSyncNetwork, selectorQuerier SelectorQuerier) GraphSync</text><!--class Receiver--><rect fill="#FEFECE" filter="url(#f4yurevpk0xxf)" height="73.9102" id="Receiver" style="stroke: #A80036; stroke-width: 1.5;" width="460" x="2460" y="801.5"/><ellipse cx="2661.25" cy="817.5" fill="#B4A7E5" rx="11" ry="11" style="stroke: #A80036; stroke-width: 1.0;"/><path d="M2657.1777,813.2651 L2657.1777,811.1069 L2664.5571,811.1069 L2664.5571,813.2651 L2662.0918,813.2651 L2662.0918,821.3418 L2664.5571,821.3418 L2664.5571,823.5 L2657.1777,823.5 L2657.1777,821.3418 L2659.6431,821.3418 L2659.6431,813.2651 Z "/><text fill="#000000" font-family="sans-serif" font-size="12" font-style="italic" lengthAdjust="spacingAndGlyphs" textLength="49" x="2681.75" y="822.0352">Receiver</text><line style="stroke: #A80036; stroke-width: 1.5;" x1="2461" x2="2919" y1="833.5" y2="833.5"/><line style="stroke: #A80036; stroke-width: 1.5;" x1="2461" x2="2919" y1="841.5" y2="841.5"/><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="448" x="2466" y="856.1348">ReceiveMessage(ctx context.Context, sender peer.ID, incoming GraphSyncMessage)</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="104" x="2466" y="869.0898">ReceiveError(error)</text><!--class GraphSyncNetwork--><rect fill="#FEFECE" filter="url(#f4yurevpk0xxf)" height="86.8652" id="GraphSyncNetwork" style="stroke: #A80036; stroke-width: 1.5;" width="411" x="1682.5" y="795"/><ellipse cx="1829.25" cy="811" fill="#B4A7E5" rx="11" ry="11" style="stroke: #A80036; stroke-width: 1.0;"/><path d="M1825.1777,806.7651 L1825.1777,804.6069 L1832.5571,804.6069 L1832.5571,806.7651 L1830.0918,806.7651 L1830.0918,814.8418 L1832.5571,814.8418 L1832.5571,817 L1825.1777,817 L1825.1777,814.8418 L1827.6431,814.8418 L1827.6431,806.7651 Z "/><text fill="#000000" font-family="sans-serif" font-size="12" font-style="italic" lengthAdjust="spacingAndGlyphs" textLength="109" x="1849.75" y="815.5352">GraphSyncNetwork</text><line style="stroke: #A80036; stroke-width: 1.5;" x1="1683.5" x2="2092.5" y1="827" y2="827"/><line style="stroke: #A80036; stroke-width: 1.5;" x1="1683.5" x2="2092.5" y1="835" y2="835"/><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="399" x="1688.5" y="849.6348">SendMessage(ctx context.Context, receiver peer.Id, m GraphSyncMessage)</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="161" x="1688.5" y="862.5898">SetDelegate(receiver Receiver)</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="372" x="1688.5" y="875.5449">NewMessageSender(context.Context, peer.ID) (MessageSender, error)</text><!--class MessageSender--><rect fill="#FEFECE" filter="url(#f4yurevpk0xxf)" height="86.8652" id="MessageSender" style="stroke: #A80036; stroke-width: 1.5;" width="296" x="2129" y="795"/><ellipse cx="2227.75" cy="811" fill="#B4A7E5" rx="11" ry="11" style="stroke: #A80036; stroke-width: 1.0;"/><path d="M2223.6777,806.7651 L2223.6777,804.6069 L2231.0571,804.6069 L2231.0571,806.7651 L2228.5918,806.7651 L2228.5918,814.8418 L2231.0571,814.8418 L2231.0571,817 L2223.6777,817 L2223.6777,814.8418 L2226.1431,814.8418 L2226.1431,806.7651 Z "/><text fill="#000000" font-family="sans-serif" font-size="12" font-style="italic" lengthAdjust="spacingAndGlyphs" textLength="90" x="2248.25" y="815.5352">MessageSender</text><line style="stroke: #A80036; stroke-width: 1.5;" x1="2130" x2="2424" y1="827" y2="827"/><line style="stroke: #A80036; stroke-width: 1.5;" x1="2130" x2="2424" y1="835" y2="835"/><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="284" x="2135" y="849.6348">SendMsg(context.Context, GraphSyncMessage) error</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="69" x="2135" y="862.5898">Close() error</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="68" x="2135" y="875.5449">Reset() error</text><!--class libP2PGraphSyncNetwork--><rect fill="#FEFECE" filter="url(#f4yurevpk0xxf)" height="48" id="libP2PGraphSyncNetwork" style="stroke: #A80036; stroke-width: 1.5;" width="177" x="3024.5" y="1246"/><ellipse cx="3039.5" cy="1262" fill="#ADD1B2" rx="11" ry="11" style="stroke: #A80036; stroke-width: 1.0;"/><path d="M3042.4731,1267.6431 Q3041.8921,1267.9419 3041.2529,1268.0913 Q3040.6138,1268.2407 3039.9082,1268.2407 Q3037.4014,1268.2407 3036.0815,1266.5889 Q3034.7617,1264.937 3034.7617,1261.8159 Q3034.7617,1258.6865 3036.0815,1257.0347 Q3037.4014,1255.3828 3039.9082,1255.3828 Q3040.6138,1255.3828 3041.2612,1255.5322 Q3041.9087,1255.6816 3042.4731,1255.9805 L3042.4731,1258.7031 Q3041.8423,1258.1221 3041.2488,1257.8523 Q3040.6553,1257.5825 3040.0244,1257.5825 Q3038.6797,1257.5825 3037.9949,1258.6492 Q3037.3101,1259.7158 3037.3101,1261.8159 Q3037.3101,1263.9077 3037.9949,1264.9744 Q3038.6797,1266.041 3040.0244,1266.041 Q3040.6553,1266.041 3041.2488,1265.7712 Q3041.8423,1265.5015 3042.4731,1264.9204 Z "/><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacingAndGlyphs" textLength="145" x="3053.5" y="1266.5352">libP2PGraphSyncNetwork</text><line style="stroke: #A80036; stroke-width: 1.5;" x1="3025.5" x2="3200.5" y1="1278" y2="1278"/><line style="stroke: #A80036; stroke-width: 1.5;" x1="3025.5" x2="3200.5" y1="1286" y2="1286"/><rect fill="#FEFECE" filter="url(#f4yurevpk0xxf)" height="61.4648" style="stroke: #A80036; stroke-width: 1.5;" width="316" x="2955" y="808"/><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacingAndGlyphs" textLength="143" x="3041.5" y="821.6016">Package Public Functions</text><line style="stroke: #A80036; stroke-width: 1.5;" x1="2956" x2="3270" y1="826.1328" y2="826.1328"/><text fill="#000000" font-family="sans-serif" font-size="10" lengthAdjust="spacingAndGlyphs" textLength="201" x="2961" y="839.8008">NewLibP2PNetwork(host libp2pHost.Host,</text><text fill="#000000" font-family="sans-serif" font-size="10" lengthAdjust="spacingAndGlyphs" textLength="304" x="2961" y="851.5781">decodeSelectionResponseFunc: DecodeSelectionResponseFunc,</text><text fill="#000000" font-family="sans-serif" font-size="10" lengthAdjust="spacingAndGlyphs" textLength="296" x="2961" y="863.3555">decodeSelectorFunc: DecodeSelectorFunc) GraphSyncNetwork</text><!--class RequestManager--><rect fill="#FEFECE" filter="url(#f4yurevpk0xxf)" height="99.8203" id="RequestManager" style="stroke: #A80036; stroke-width: 1.5;" width="385" x="2204.5" y="567"/><ellipse cx="2344.25" cy="583" fill="#ADD1B2" rx="11" ry="11" style="stroke: #A80036; stroke-width: 1.0;"/><path d="M2347.2231,588.6431 Q2346.6421,588.9419 2346.0029,589.0913 Q2345.3638,589.2407 2344.6582,589.2407 Q2342.1514,589.2407 2340.8315,587.5889 Q2339.5117,585.937 2339.5117,582.8159 Q2339.5117,579.6865 2340.8315,578.0347 Q2342.1514,576.3828 2344.6582,576.3828 Q2345.3638,576.3828 2346.0112,576.5322 Q2346.6587,576.6816 2347.2231,576.9805 L2347.2231,579.7031 Q2346.5923,579.1221 2345.9988,578.8523 Q2345.4053,578.5825 2344.7744,578.5825 Q2343.4297,578.5825 2342.7449,579.6492 Q2342.0601,580.7158 2342.0601,582.8159 Q2342.0601,584.9077 2342.7449,585.9744 Q2343.4297,587.041 2344.7744,587.041 Q2345.4053,587.041 2345.9988,586.7712 Q2346.5923,586.5015 2347.2231,585.9204 Z "/><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacingAndGlyphs" textLength="97" x="2364.75" y="587.5352">RequestManager</text><line style="stroke: #A80036; stroke-width: 1.5;" x1="2205.5" x2="2588.5" y1="599" y2="599"/><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="154" x="2210.5" y="613.6348">network : GraphSyncNetwork</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="174" x="2210.5" y="626.5898">selectorQuerier: SelectorQuerier</text><line style="stroke: #A80036; stroke-width: 1.5;" x1="2205.5" x2="2588.5" y1="632.9102" y2="632.9102"/><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="373" x="2210.5" y="647.5449">SendRequest(p peer.ID, selector Selector, root Cid) SelectionTraverser</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="285" x="2210.5" y="660.5">ProcessResponses(responses []GraphSyncResponse)</text><path d="M1682.5,589 L1682.5,644.9316 L2169.5,644.9316 L2169.5,599 L2159.5,589 L1682.5,589 " fill="#FBFB77" filter="url(#f4yurevpk0xxf)" style="stroke: #A80036; stroke-width: 1.0;"/><path d="M2159.5,589 L2159.5,599 L2169.5,599 L2159.5,589 " fill="#FBFB77" style="stroke: #A80036; stroke-width: 1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="339" x="1688.5" y="606.5684">The ResponseManager uses Validate from go-selector</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="466" x="1688.5" y="621.8789">to filter incoming Responses based on whether they are valid and produce</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="277" x="1688.5" y="637.1895">a traverser that only returns valid responses</text><!--class ResponseManager--><rect fill="#FEFECE" filter="url(#f4yurevpk0xxf)" height="86.8652" id="ResponseManager" style="stroke: #A80036; stroke-width: 1.5;" width="330" x="3007" y="573.5"/><ellipse cx="3114.75" cy="589.5" fill="#ADD1B2" rx="11" ry="11" style="stroke: #A80036; stroke-width: 1.0;"/><path d="M3117.7231,595.1431 Q3117.1421,595.4419 3116.5029,595.5913 Q3115.8638,595.7407 3115.1582,595.7407 Q3112.6514,595.7407 3111.3315,594.0889 Q3110.0117,592.437 3110.0117,589.3159 Q3110.0117,586.1865 3111.3315,584.5347 Q3112.6514,582.8828 3115.1582,582.8828 Q3115.8638,582.8828 3116.5112,583.0322 Q3117.1587,583.1816 3117.7231,583.4805 L3117.7231,586.2031 Q3117.0923,585.6221 3116.4988,585.3523 Q3115.9053,585.0825 3115.2744,585.0825 Q3113.9297,585.0825 3113.2449,586.1492 Q3112.5601,587.2158 3112.5601,589.3159 Q3112.5601,591.4077 3113.2449,592.4744 Q3113.9297,593.541 3115.2744,593.541 Q3115.9053,593.541 3116.4988,593.2712 Q3117.0923,593.0015 3117.7231,592.4204 Z "/><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacingAndGlyphs" textLength="106" x="3135.25" y="594.0352">ResponseManager</text><line style="stroke: #A80036; stroke-width: 1.5;" x1="3008" x2="3336" y1="605.5" y2="605.5"/><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="160" x="3013" y="620.1348">network : GraphySyncNetwork</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="174" x="3013" y="633.0898">selectorQuerier: SelectorQuerier</text><line style="stroke: #A80036; stroke-width: 1.5;" x1="3008" x2="3336" y1="639.4102" y2="639.4102"/><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="318" x="3013" y="654.0449">ProcessRequests(p peer.ID, requests []GraphSyncRequests)</text><path d="M2624.5,573.5 L2624.5,660.0527 L2971.5,660.0527 L2971.5,583.5 L2961.5,573.5 L2624.5,573.5 " fill="#FBFB77" filter="url(#f4yurevpk0xxf)" style="stroke: #A80036; stroke-width: 1.0;"/><path d="M2961.5,573.5 L2961.5,583.5 L2971.5,583.5 L2961.5,573.5 " fill="#FBFB77" style="stroke: #A80036; stroke-width: 1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="326" x="2630.5" y="591.0684">The ResponseManager uses Select from go-selector</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="313" x="2630.5" y="606.3789">to translate the raw bytes into a selector and then</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="284" x="2630.5" y="621.6895">traverse the graph to produce a list of blocks</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="0" x="2634.5" y="637"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="284" x="2630.5" y="652.3105">Question: how to know if response is partial?</text><!--class DecodeSelectionResponseFunc--><rect fill="#FEFECE" filter="url(#f4yurevpk0xxf)" height="48" id="DecodeSelectionResponseFunc" style="stroke: #A80036; stroke-width: 1.5;" width="387" x="4510.5" y="1042.5"/><ellipse cx="4525.5" cy="1058.5" fill="#B4A7E5" rx="11" ry="11" style="stroke: #A80036; stroke-width: 1.0;"/><path d="M4521.4277,1054.2651 L4521.4277,1052.1069 L4528.8071,1052.1069 L4528.8071,1054.2651 L4526.3418,1054.2651 L4526.3418,1062.3418 L4528.8071,1062.3418 L4528.8071,1064.5 L4521.4277,1064.5 L4521.4277,1062.3418 L4523.8931,1062.3418 L4523.8931,1054.2651 Z "/><text fill="#000000" font-family="sans-serif" font-size="12" font-style="italic" lengthAdjust="spacingAndGlyphs" textLength="355" x="4539.5" y="1063.0352">DecodeSelectionResponseFunc func([]byte) SelectionResponse</text><line style="stroke: #A80036; stroke-width: 1.5;" x1="4511.5" x2="4896.5" y1="1074.5" y2="1074.5"/><line style="stroke: #A80036; stroke-width: 1.5;" x1="4511.5" x2="4896.5" y1="1082.5" y2="1082.5"/><!--class DecodeSelectorFunc--><rect fill="#FEFECE" filter="url(#f4yurevpk0xxf)" height="48" id="DecodeSelectorFunc" style="stroke: #A80036; stroke-width: 1.5;" width="265" x="4210.5" y="1042.5"/><ellipse cx="4225.5" cy="1058.5" fill="#B4A7E5" rx="11" ry="11" style="stroke: #A80036; stroke-width: 1.0;"/><path d="M4221.4277,1054.2651 L4221.4277,1052.1069 L4228.8071,1052.1069 L4228.8071,1054.2651 L4226.3418,1054.2651 L4226.3418,1062.3418 L4228.8071,1062.3418 L4228.8071,1064.5 L4221.4277,1064.5 L4221.4277,1062.3418 L4223.8931,1062.3418 L4223.8931,1054.2651 Z "/><text fill="#000000" font-family="sans-serif" font-size="12" font-style="italic" lengthAdjust="spacingAndGlyphs" textLength="233" x="4239.5" y="1063.0352">DecodeSelectorFunc func([]byte) Selector</text><line style="stroke: #A80036; stroke-width: 1.5;" x1="4211.5" x2="4474.5" y1="1074.5" y2="1074.5"/><line style="stroke: #A80036; stroke-width: 1.5;" x1="4211.5" x2="4474.5" y1="1082.5" y2="1082.5"/><rect fill="#FEFECE" filter="url(#f4yurevpk0xxf)" height="96.7969" style="stroke: #A80036; stroke-width: 1.5;" width="346" x="3295" y="1018"/><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacingAndGlyphs" textLength="143" x="3396.5" y="1031.6016">Package Public Functions</text><line style="stroke: #A80036; stroke-width: 1.5;" x1="3296" x2="3640" y1="1036.1328" y2="1036.1328"/><text fill="#000000" font-family="sans-serif" font-size="10" lengthAdjust="spacingAndGlyphs" textLength="177" x="3301" y="1049.8008">func FromPBReader(pbr ggio.Reader,</text><text fill="#000000" font-family="sans-serif" font-size="10" lengthAdjust="spacingAndGlyphs" textLength="304" x="3301" y="1061.5781">decodeSelectionResponseFunc: DecodeSelectionResponseFunc,</text><text fill="#000000" font-family="sans-serif" font-size="10" lengthAdjust="spacingAndGlyphs" textLength="334" x="3301" y="1073.3555">decodeSelectorFunc: DecodeSelectorFunc) (GraphSyncMessage, error)</text><text fill="#000000" font-family="sans-serif" font-size="10" lengthAdjust="spacingAndGlyphs" textLength="124" x="3301" y="1085.1328">func FromNet(r io.Reader,</text><text fill="#000000" font-family="sans-serif" font-size="10" lengthAdjust="spacingAndGlyphs" textLength="304" x="3301" y="1096.9102">decodeSelectionResponseFunc: DecodeSelectionResponseFunc,</text><text fill="#000000" font-family="sans-serif" font-size="10" lengthAdjust="spacingAndGlyphs" textLength="334" x="3301" y="1108.6875">decodeSelectorFunc: DecodeSelectorFunc) (GraphSyncMessage, error)</text><!--class GraphSyncRequest--><rect fill="#FEFECE" filter="url(#f4yurevpk0xxf)" height="112.7754" id="GraphSyncRequest" style="stroke: #A80036; stroke-width: 1.5;" width="140" x="4035" y="1010"/><ellipse cx="4050" cy="1026" fill="#B4A7E5" rx="11" ry="11" style="stroke: #A80036; stroke-width: 1.0;"/><path d="M4045.9277,1021.7651 L4045.9277,1019.6069 L4053.3071,1019.6069 L4053.3071,1021.7651 L4050.8418,1021.7651 L4050.8418,1029.8418 L4053.3071,1029.8418 L4053.3071,1032 L4045.9277,1032 L4045.9277,1029.8418 L4048.3931,1029.8418 L4048.3931,1021.7651 Z "/><text fill="#000000" font-family="sans-serif" font-size="12" font-style="italic" lengthAdjust="spacingAndGlyphs" textLength="108" x="4064" y="1030.5352">GraphSyncRequest</text><line style="stroke: #A80036; stroke-width: 1.5;" x1="4036" x2="4174" y1="1042" y2="1042"/><line style="stroke: #A80036; stroke-width: 1.5;" x1="4036" x2="4174" y1="1050" y2="1050"/><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="97" x="4041" y="1064.6348">Selector() Selector</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="66" x="4041" y="1077.5898">Root()     Cid</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="89" x="4041" y="1090.5449">Priority() Priority</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="54" x="4041" y="1103.5">ID()       int</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="80" x="4041" y="1116.4551">IsCancel() bool</text><!--class GraphSyncResponse--><rect fill="#FEFECE" filter="url(#f4yurevpk0xxf)" height="73.9102" id="GraphSyncResponse" style="stroke: #A80036; stroke-width: 1.5;" width="149" x="3850.5" y="1029.5"/><ellipse cx="3865.5" cy="1045.5" fill="#B4A7E5" rx="11" ry="11" style="stroke: #A80036; stroke-width: 1.0;"/><path d="M3861.4277,1041.2651 L3861.4277,1039.1069 L3868.8071,1039.1069 L3868.8071,1041.2651 L3866.3418,1041.2651 L3866.3418,1049.3418 L3868.8071,1049.3418 L3868.8071,1051.5 L3861.4277,1051.5 L3861.4277,1049.3418 L3863.8931,1049.3418 L3863.8931,1041.2651 Z "/><text fill="#000000" font-family="sans-serif" font-size="12" font-style="italic" lengthAdjust="spacingAndGlyphs" textLength="117" x="3879.5" y="1050.0352">GraphSyncResponse</text><line style="stroke: #A80036; stroke-width: 1.5;" x1="3851.5" x2="3998.5" y1="1061.5" y2="1061.5"/><line style="stroke: #A80036; stroke-width: 1.5;" x1="3851.5" x2="3998.5" y1="1069.5" y2="1069.5"/><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="79" x="3856.5" y="1084.1348">RequestID() int</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="135" x="3856.5" y="1097.0898">Status() GraphSyncStatus</text><!--class GraphSyncMessage--><rect fill="#FEFECE" filter="url(#f4yurevpk0xxf)" height="73.9102" id="GraphSyncMessage" style="stroke: #A80036; stroke-width: 1.5;" width="205" x="3822.5" y="1417"/><ellipse cx="3865.4" cy="1433" fill="#B4A7E5" rx="11" ry="11" style="stroke: #A80036; stroke-width: 1.0;"/><path d="M3861.3277,1428.7651 L3861.3277,1426.6069 L3868.7071,1426.6069 L3868.7071,1428.7651 L3866.2418,1428.7651 L3866.2418,1436.8418 L3868.7071,1436.8418 L3868.7071,1439 L3861.3277,1439 L3861.3277,1436.8418 L3863.7931,1436.8418 L3863.7931,1428.7651 Z "/><text fill="#000000" font-family="sans-serif" font-size="12" font-style="italic" lengthAdjust="spacingAndGlyphs" textLength="111" x="3885.6" y="1437.5352">GraphSyncMessage</text><line style="stroke: #A80036; stroke-width: 1.5;" x1="3823.5" x2="4026.5" y1="1449" y2="1449"/><line style="stroke: #A80036; stroke-width: 1.5;" x1="3823.5" x2="4026.5" y1="1457" y2="1457"/><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="175" x="3828.5" y="1471.6348">Requests() : []GraphSyncRequest</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="193" x="3828.5" y="1484.5898">Responses() : []GraphSyncResponse</text><!--class Exportable--><rect fill="#FEFECE" filter="url(#f4yurevpk0xxf)" height="73.9102" id="Exportable" style="stroke: #A80036; stroke-width: 1.5;" width="139" x="3676.5" y="1029.5"/><ellipse cx="3711.3" cy="1045.5" fill="#B4A7E5" rx="11" ry="11" style="stroke: #A80036; stroke-width: 1.0;"/><path d="M3707.2277,1041.2651 L3707.2277,1039.1069 L3714.6071,1039.1069 L3714.6071,1041.2651 L3712.1418,1041.2651 L3712.1418,1049.3418 L3714.6071,1049.3418 L3714.6071,1051.5 L3707.2277,1051.5 L3707.2277,1049.3418 L3709.6931,1049.3418 L3709.6931,1041.2651 Z "/><text fill="#000000" font-family="sans-serif" font-size="12" font-style="italic" lengthAdjust="spacingAndGlyphs" textLength="63" x="3729.7" y="1050.0352">Exportable</text><line style="stroke: #A80036; stroke-width: 1.5;" x1="3677.5" x2="3814.5" y1="1061.5" y2="1061.5"/><line style="stroke: #A80036; stroke-width: 1.5;" x1="3677.5" x2="3814.5" y1="1069.5" y2="1069.5"/><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="51" x="3682.5" y="1084.1348">ToProto()</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="127" x="3682.5" y="1097.0898">ToNet(w io.Writer) error</text><!--class go-filecoin--><rect fill="#FEFECE" filter="url(#f4yurevpk0xxf)" height="112.7754" id="go-filecoin" style="stroke: #A80036; stroke-width: 1.5;" width="349" x="1183.5" y="43"/><ellipse cx="1323.25" cy="59" fill="#ADD1B2" rx="11" ry="11" style="stroke: #A80036; stroke-width: 1.0;"/><path d="M1326.2231,64.6431 Q1325.6421,64.9419 1325.0029,65.0913 Q1324.3638,65.2407 1323.6582,65.2407 Q1321.1514,65.2407 1319.8315,63.5889 Q1318.5117,61.937 1318.5117,58.8159 Q1318.5117,55.6865 1319.8315,54.0347 Q1321.1514,52.3828 1323.6582,52.3828 Q1324.3638,52.3828 1325.0112,52.5322 Q1325.6587,52.6816 1326.2231,52.9805 L1326.2231,55.7031 Q1325.5923,55.1221 1324.9988,54.8523 Q1324.4053,54.5825 1323.7744,54.5825 Q1322.4297,54.5825 1321.7449,55.6492 Q1321.0601,56.7158 1321.0601,58.8159 Q1321.0601,60.9077 1321.7449,61.9744 Q1322.4297,63.041 1323.7744,63.041 Q1324.4053,63.041 1324.9988,62.7712 Q1325.5923,62.5015 1326.2231,61.9204 Z "/><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacingAndGlyphs" textLength="61" x="1343.75" y="63.5352">go-filecoin</text><line style="stroke: #A80036; stroke-width: 1.5;" x1="1184.5" x2="1531.5" y1="75" y2="75"/><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="124" x="1189.5" y="89.6348">graphSync : GraphSync</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="174" x="1189.5" y="102.5898">selectorQuerier: SelectorQuerier</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="117" x="1189.5" y="115.5449">host: libp2pHost.Host</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="337" x="1189.5" y="128.5">decodeSelectionResponseFunc: DecodeSelectionResponseFunc</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="223" x="1189.5" y="141.4551">decodeSelectorFunc: DecodeSelectorFunc</text><line style="stroke: #A80036; stroke-width: 1.5;" x1="1184.5" x2="1531.5" y1="147.7754" y2="147.7754"/><path d="M832.5,279 L832.5,304.3105 L1099.5,304.3105 L1099.5,289 L1089.5,279 L832.5,279 " fill="#FBFB77" filter="url(#f4yurevpk0xxf)" style="stroke: #A80036; stroke-width: 1.0;"/><path d="M1089.5,279 L1089.5,289 L1099.5,289 L1089.5,279 " fill="#FBFB77" style="stroke: #A80036; stroke-width: 1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="246" x="838.5" y="296.5684">Is this the right name for this package?</text><!--link GMN5 to go-selector--><path d="M966,304.1843 C966,323.169 966,360.355 966,394.0824 C966,395.1364 966,396.187 966,397.2336 C966,397.7569 966,398.2791 966,398.8003 C966,399.0609 966,399.3212 966,399.5813 " fill="none" id="GMN5-go-selector" style="stroke: #A80036; stroke-width: 1.0; stroke-dasharray: 7.0,7.0;"/><!--link Node to Selector--><path d="M1323.3466,308.4475 C1271.9877,324.8563 1189.9094,348.9658 1117,361 C901.2623,396.6089 844.28,379.1699 626,392 C609.6707,392.9598 493.7378,392.9031 479,400 C461.1705,408.5858 446.4819,425.5248 436.4831,439.8201 " fill="none" id="Node-Selector" style="stroke: #A80036; stroke-width: 1.0;"/><polygon fill="none" points="1321.2175,301.7792,1342.4016,302.261,1325.5407,315.095,1321.2175,301.7792" style="stroke: #A80036; stroke-width: 1.0;"/><!--link Node to SelectionResponse--><path d="M1375.3204,335.7924 C1373.4106,356.0438 1367.2592,378.4843 1351,392 C1334.4096,405.791 1177.3552,392.8516 1157,400 C1133.2933,408.3254 1110.5677,425.4703 1094.2914,439.9207 " fill="none" id="Node-SelectionResponse" style="stroke: #A80036; stroke-width: 1.0;"/><polygon fill="none" points="1368.3322,335.3239,1376.0136,315.5756,1382.324,335.8038,1368.3322,335.3239" style="stroke: #A80036; stroke-width: 1.0;"/><!--link GraphSync to SelectorQuerier--><path d="M1785.1761,359.4986 C1703.1869,382.4582 1614.7402,407.2262 1544.5406,426.8843 " fill="none" id="GraphSync-SelectorQuerier" style="stroke: #A80036; stroke-width: 1.0;"/><polygon fill="#A80036" points="1797.7483,355.9779,1790.8919,353.7441,1786.1929,359.2139,1793.0493,361.4477,1797.7483,355.9779" style="stroke: #A80036; stroke-width: 1.0;"/><!--link Receiver to GraphSync--><path d="M2822.1647,795.8297 C2859.2959,785.2407 2899.9333,774.9465 2938,768 C2989.4461,758.612 3407,780.7956 3407,728.5 C3407,464 3407,464 3407,464 C3407,337.8133 2400.102,383.8427 2276,361 C2270.0633,359.9073 2264.0631,358.7365 2258.0225,357.499 " fill="none" id="Receiver-GraphSync" style="stroke: #A80036; stroke-width: 1.0;"/><polygon fill="none" points="2823.9695,802.5948,2802.8101,801.4636,2820.0566,789.1527,2823.9695,802.5948" style="stroke: #A80036; stroke-width: 1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="71" x="3408" y="622.0684">receiver for</text><!--link GraphSyncNetwork to libP2PGraphSyncNetwork--><path d="M2113.4734,881.3506 C2227.3166,892.8411 2482,865.1149 2482,943.5 C2482,943.5 2482,943.5 2482,1184.5 C2482,1238.5657 2850.4666,1259.9286 3024.2648,1266.9979 " fill="none" id="GraphSyncNetwork-libP2PGraphSyncNetwork" style="stroke: #A80036; stroke-width: 1.0;"/><polygon fill="none" points="2112.5124,888.2845,2093.6356,878.6581,2114.3953,874.4117,2112.5124,888.2845" style="stroke: #A80036; stroke-width: 1.0;"/><!--link goGraphSyncNetworkPF to libP2PGraphSyncNetwork--><path d="M3113,869.2829 C3113,890.2108 3113,918.526 3113,943.5 C3113,943.5 3113,943.5 3113,1184.5 C3113,1205.1328 3113,1228.5664 3113,1245.6764 " fill="none" id="goGraphSyncNetworkPF-libP2PGraphSyncNetwork" style="stroke: #A80036; stroke-width: 1.0; stroke-dasharray: 7.0,7.0;"/><!--link SelectorQuerier to RequestManager--><path d="M1604.4231,501.0451 C1622.4978,503.9675 1640.5699,506.6798 1658,509 C1779.1375,525.1251 1809.9963,524.9705 1932,532 C1988.6007,535.2612 2131.3408,529.2146 2187,540 C2213.9045,545.2134 2241.9346,553.4042 2268.425,562.5346 " fill="none" id="SelectorQuerier-RequestManager" style="stroke: #A80036; stroke-width: 1.0;"/><polygon fill="#A80036" points="2280.8845,566.9352,2276.5591,561.1653,2269.5695,562.9388,2273.8949,568.7087,2280.8845,566.9352" style="stroke: #A80036; stroke-width: 1.0;"/><!--link RequestManager to GraphSyncNetwork--><path d="M2269.7122,672.3915 C2182.6155,710.2931 2068.7598,759.8393 1988.1292,794.9271 " fill="none" id="RequestManager-GraphSyncNetwork" style="stroke: #A80036; stroke-width: 1.0;"/><polygon fill="#A80036" points="2281.8181,667.1234,2274.7204,665.8498,2270.8148,671.9118,2277.9126,673.1853,2281.8181,667.1234" style="stroke: #A80036; stroke-width: 1.0;"/><!--link GraphSync to RequestManager--><path d="M2117.2108,370.1941 C2186.6017,431.4048 2280.7788,514.4797 2340.2233,566.9165 " fill="none" id="GraphSync-RequestManager" style="stroke: #A80036; stroke-width: 1.0;"/><polygon fill="#A80036" points="2107.1598,361.3279,2109.0133,368.2967,2116.1589,369.2662,2114.3054,362.2973,2107.1598,361.3279" style="stroke: #A80036; stroke-width: 1.0;"/><!--link SelectorQuerier to ResponseManager--><path d="M1602.719,501.0088 C1621.3573,503.9868 1640.0174,506.72 1658,509 C1800.3362,527.0468 1836.6369,526.3173 1980,532 C2036.0133,534.2203 2934.0949,528.6927 2989,540 C3018.1142,545.9959 3048.38,556.6901 3075.7176,568.2368 " fill="none" id="SelectorQuerier-ResponseManager" style="stroke: #A80036; stroke-width: 1.0;"/><polygon fill="#A80036" points="3087.6485,573.4064,3083.7334,567.3506,3076.6377,568.6354,3080.5528,574.6912,3087.6485,573.4064" style="stroke: #A80036; stroke-width: 1.0;"/><!--link ResponseManager to GraphSyncNetwork--><path d="M3035.0941,664.2113 C3019.6761,668.3837 3004.0884,672.112 2989,675 C2854.2092,700.7994 2817.5829,683.6101 2681,697 C2427.3659,721.8651 2361.0081,713.7459 2112,768 C2079.3353,775.117 2044.6141,784.908 2012.5051,794.9297 " fill="none" id="ResponseManager-GraphSyncNetwork" style="stroke: #A80036; stroke-width: 1.0;"/><polygon fill="#A80036" points="3047.9907,660.6107,3041.1361,658.3714,3036.4327,663.8375,3043.2873,666.0768,3047.9907,660.6107" style="stroke: #A80036; stroke-width: 1.0;"/><!--link GraphSync to ResponseManager--><path d="M2271.0603,359.6857 C2272.7124,360.126 2274.3591,360.5642 2276,361 C2591.775,444.868 2679.0823,436.5657 2989,540 C3017.7723,549.6027 3048.3877,561.7022 3076.1792,573.4472 " fill="none" id="GraphSync-ResponseManager" style="stroke: #A80036; stroke-width: 1.0;"/><polygon fill="#A80036" points="2258.2985,356.2694,2263.06,361.685,2269.8903,359.3726,2265.1288,353.9571,2258.2985,356.2694" style="stroke: #A80036; stroke-width: 1.0;"/><!--link goGraphSyncMessagePF to libP2PGraphSyncNetwork--><path d="M3382.9687,1115.2433 C3310.9701,1156.5158 3210.8099,1213.9315 3154.9378,1245.9596 " fill="none" id="goGraphSyncMessagePF-libP2PGraphSyncNetwork" style="stroke: #A80036; stroke-width: 1.0; stroke-dasharray: 7.0,7.0;"/><!--link Exportable to GraphSyncMessage--><path d="M3782.332,1103.5775 C3799.8004,1125.3192 3817,1154.3752 3817,1184.5 C3817,1184.5 3817,1184.5 3817,1355.5 C3817,1374.0431 3825.7988,1390.0255 3838.3736,1403.3984 " fill="none" id="Exportable-GraphSyncMessage" style="stroke: #A80036; stroke-width: 1.0;"/><polygon fill="none" points="3843.1376,1398.2688,3853.2629,1416.8828,3833.7397,1408.6457,3843.1376,1398.2688" style="stroke: #A80036; stroke-width: 1.0;"/><!--link GraphSyncRequest to GraphSyncMessage--><path d="M4053.8254,1123.1528 C4042.0978,1141.4383 4033,1162.6613 4033,1184.5 C4033,1184.5 4033,1184.5 4033,1355.5 C4033,1376.4103 4021.8112,1394.0644 4006.6364,1408.3922 " fill="none" id="GraphSyncRequest-GraphSyncMessage" style="stroke: #A80036; stroke-width: 1.0;"/><polygon fill="#A80036" points="3996.7371,1416.8828,4003.8955,1416.0127,4005.8456,1409.0703,3998.6872,1409.9404,3996.7371,1416.8828" style="stroke: #A80036; stroke-width: 1.0;"/><!--link GraphSyncResponse to GraphSyncMessage--><path d="M3925,1103.7018 C3925,1126.9308 3925,1157.4583 3925,1184.5 C3925,1184.5 3925,1184.5 3925,1355.5 C3925,1371.1071 3925,1388.1051 3925,1403.5188 " fill="none" id="GraphSyncResponse-GraphSyncMessage" style="stroke: #A80036; stroke-width: 1.0;"/><polygon fill="#A80036" points="3925,1416.5814,3929,1410.5814,3925,1404.5814,3921,1410.5814,3925,1416.5814" style="stroke: #A80036; stroke-width: 1.0;"/><!--link go-filecoin to GraphSync--><path d="M1545.6594,153.277 C1623.8905,175.6955 1715.509,201.9503 1797.7594,225.5206 " fill="none" id="go-filecoin-GraphSync" style="stroke: #A80036; stroke-width: 1.0;"/><polygon fill="#A80036" points="1532.7224,149.5697,1537.3883,155.0678,1544.2581,152.8755,1539.5922,147.3774,1532.7224,149.5697" style="stroke: #A80036; stroke-width: 1.0;"/><!--link go-filecoin to goGraphsyncPf--><path d="M1532.7054,104.7518 C1718.9901,113.3388 2021.5927,135.8936 2276,195 C2356.2669,213.6484 2445.4658,250.0838 2496.3379,272.4594 " fill="none" id="go-filecoin-goGraphsyncPf" style="stroke: #A80036; stroke-width: 1.0; stroke-dasharray: 7.0,7.0;"/><!--link go-filecoin to goGraphSyncNetworkPF--><path d="M1532.9203,101.5289 C2032.6191,108.0778 3435.529,132.0116 3511,195 C3544.7724,223.1866 3533,247.5107 3533,291.5 C3533,291.5 3533,291.5 3533,728.5 C3533,784.7494 3390.2428,812.7999 3271.1855,826.4128 " fill="none" id="go-filecoin-goGraphSyncNetworkPF" style="stroke: #A80036; stroke-width: 1.0; stroke-dasharray: 7.0,7.0;"/><!--link go-filecoin to Selector--><path d="M1183.3464,113.496 C1074.6778,126.2453 933.5411,150.2507 815,195 C651.3397,256.7817 613.3015,287.9073 479,400 C464.8354,411.8222 451.0195,427.2073 440.5377,439.93 " fill="none" id="go-filecoin-Selector" style="stroke: #A80036; stroke-width: 1.0; stroke-dasharray: 7.0,7.0;"/><!--link go-filecoin to SelectorQuerier--><path d="M1323.7909,168.3005 C1320.5953,177.1093 1317.8611,186.145 1316,195 C1300.8249,267.2002 1288.9691,292.3524 1316,361 C1325.9861,386.3606 1345.4846,409.1689 1364.315,426.8373 " fill="none" id="go-filecoin-SelectorQuerier" style="stroke: #A80036; stroke-width: 1.0;"/><polygon fill="#A80036" points="1328.5732,156.0407,1322.6662,160.1769,1324.2123,167.2203,1330.1193,163.0841,1328.5732,156.0407" style="stroke: #A80036; stroke-width: 1.0;"/><!--link go-filecoin to goSelectorPF--><path d="M1183.1841,107.8857 C973.11,119.9498 634.3549,146.3066 518,195 C376.0857,254.3898 245.9501,393.6138 201.3318,444.7346 " fill="none" id="go-filecoin-goSelectorPF" style="stroke: #A80036; stroke-width: 1.0; stroke-dasharray: 7.0,7.0;"/><!--
2 3
@startuml "GraphSync"

4 5 6 7 8

package "go-ipld-format" {
  interface Node
}

9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
note top of "go-selector"
  Is this the right name for this package?
end note

package "go-selector" {

  interface Selector {
  }
  
  interface SelectionResponse {
  }
  
  interface SelectionTraverser {
    Next() SelectionResponse, err
    Cancel()
  }

  interface "GetBlockFunc func(cid) block.Block" as GetBlockFunc

28
  interface SelectorQuerier {
29 30
    Select(Selector, root Cid) SelectionTraverser
    Validate(Selector, root Cid, incomingResponses SelectionTraverser) SelectionTraverser
31
  }
32 33 34 35

  object "Package Public Functions" as goSelectorPF {
    NewSelectorQuerier(getBlockFunc GetBlockFunc) SelectorQuerier
  }
36 37 38

  Node <|- - Selector
  Node <|- - SelectionResponse
39 40 41
}

package "go-graphsync" {
42
  
43 44 45 46
    class GraphSync {
      network : GraphySyncNetwork
      requestManager : RequestManager
      responseManager: ResponseManager
47
      selectorQuerier: SelectorQuerier
48

49
      Request(p peer.ID, selector Selector, root Cid) SelectionTraverser
50 51 52 53
      ReceiveMessage(ctx context.Context, sender peer.ID, incoming GraphSyncMessage)
      ReceiveError(error)
    }
  
54
  GraphSync *- - SelectorQuerier
55 56

  package network {
57
    
58 59 60 61 62 63 64 65
    interface Receiver {
      ReceiveMessage(ctx context.Context, sender peer.ID, incoming GraphSyncMessage)
      ReceiveError(error)
    }

    interface GraphSyncNetwork {
      SendMessage(ctx context.Context, receiver peer.Id, m GraphSyncMessage)
      SetDelegate(receiver Receiver)
66 67 68 69 70 71 72
      NewMessageSender(context.Context, peer.ID) (MessageSender, error)
    }
    
    interface MessageSender {
	    SendMsg(context.Context, GraphSyncMessage) error
	    Close() error
	    Reset() error
73 74 75 76 77 78
    }

    Receiver <|- - GraphSync : receiver for

    class libP2PGraphSyncNetwork {
    }
79

80 81 82
    GraphSyncNetwork <|- - libP2PGraphSyncNetwork
    
    object "Package Public Functions" as goGraphSyncNetworkPF {
83 84
      NewLibP2PNetwork(host libp2pHost.Host,
      decodeSelectionResponseFunc: DecodeSelectionResponseFunc,
85
      decodeSelectorFunc: DecodeSelectorFunc) GraphSyncNetwork
86 87 88 89 90 91 92
    }
    goGraphSyncNetworkPF .. libP2PGraphSyncNetwork 
  }

  package requestmanager {
  class RequestManager {
    network : GraphSyncNetwork
93 94
    selectorQuerier: SelectorQuerier

95
    SendRequest(p peer.ID, selector Selector, root Cid) SelectionTraverser
96 97
    ProcessResponses(responses []GraphSyncResponse)
  }
98
  SelectorQuerier - -* RequestManager
99 100 101 102 103 104 105 106 107 108 109 110
  RequestManager *- - GraphSyncNetwork
  GraphSync *- - RequestManager
  note as requestManager
    The ResponseManager uses Validate from go-selector
    to filter incoming Responses based on whether they are valid and produce
    a traverser that only returns valid responses
  end note
  }

  package responsemanager {
  class ResponseManager {
    network : GraphySyncNetwork
111
    selectorQuerier: SelectorQuerier
112 113
    ProcessRequests(p peer.ID, requests []GraphSyncRequests)
  }
114
  SelectorQuerier - -* ResponseManager
115 116 117 118 119 120 121 122 123 124 125
  ResponseManager *- - GraphSyncNetwork
  GraphSync *- - ResponseManager
  note as responseManagerNote
    The ResponseManager uses Select from go-selector
    to translate the raw bytes into a selector and then
    traverse the graph to produce a list of blocks

    Question: how to know if response is partial?
  end note
  }
  package message {
126 127 128
    interface "DecodeSelectionResponseFunc func([]byte) SelectionResponse" as DecodeSelectionResponseFunc
  interface "DecodeSelectorFunc func([]byte) Selector" as DecodeSelectorFunc

129
    object "Package Public Functions" as goGraphSyncMessagePF {
130 131
      func FromPBReader(pbr ggio.Reader,
      decodeSelectionResponseFunc: DecodeSelectionResponseFunc,
132
      decodeSelectorFunc: DecodeSelectorFunc) (GraphSyncMessage, error)
133 134 135
      func FromNet(r io.Reader,
      decodeSelectionResponseFunc: DecodeSelectionResponseFunc,
      decodeSelectorFunc: DecodeSelectorFunc) (GraphSyncMessage, error)
136 137 138
    }
    goGraphSyncMessagePF .. libP2PGraphSyncNetwork

139 140
    interface GraphSyncRequest {
      Selector() Selector
141
      Root()     Cid
142 143 144
      Priority() Priority
      ID()       int
      IsCancel() bool
145 146
    }

147 148 149
    interface GraphSyncResponse {
      RequestID() int
      Status() GraphSyncStatus
150 151 152 153 154 155 156 157
    }

    interface GraphSyncMessage {
      Requests() : []GraphSyncRequest
      Responses() : []GraphSyncResponse
    }

    interface Exportable {
158
      ToProto()
159
      ToNet(w io.Writer) error
160 161 162 163 164 165 166 167 168
	  }

    Exportable - -|> GraphSyncMessage
    GraphSyncRequest - -* GraphSyncMessage
    GraphSyncResponse - -* GraphSyncMessage
    
  }

  object "PackagePublicFunctions" as goGraphsyncPf {
hannahhoward's avatar
hannahhoward committed
169
    New(ctx context.Context, network GraphSyncNetwork, selectorQuerier SelectorQuerier) GraphSync
170 171 172 173 174 175 176
  }

}

package "go-filecoin" {
  class "go-filecoin" {
    graphSync : GraphSync
177
    selectorQuerier: SelectorQuerier
178
    host: libp2pHost.Host
179 180
    decodeSelectionResponseFunc: DecodeSelectionResponseFunc
    decodeSelectorFunc: DecodeSelectorFunc
181 182 183 184 185 186
  }

  "go-filecoin" *- - GraphSync
  "go-filecoin" .. goGraphsyncPf
  "go-filecoin" .. goGraphSyncNetworkPF
  "go-filecoin" .. Selector
187 188 189
  "go-filecoin" *- - SelectorQuerier
  "go-filecoin" .. goSelectorPF

190 191 192 193 194 195 196 197 198 199 200 201 202 203 204
}

@enduml

PlantUML version 1.2018.12(Sun Oct 21 03:15:15 PDT 2018)
(GPL source distribution)
Java Runtime: Java(TM) SE Runtime Environment
JVM: Java HotSpot(TM) 64-Bit Server VM
Java Version: 1.8.0_92-b14
Operating System: Mac OS X
OS Version: 10.13.2
Default Encoding: UTF-8
Language: en
Country: US
--></g></svg>