GraphSync.svg 51.4 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:4595px;height:1519px;" version="1.1" viewBox="0 0 4595 1519" width="4595px" zoomAndPan="magnify"><defs><filter height="300%" id="f9pss3pb5gy4d" 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(#f9pss3pb5gy4d)" points="67,253.5,186,253.5,193,275.9883,196,275.9883,196,336.5,67,336.5,67,253.5" style="stroke: #000000; stroke-width: 1.5;"/><line style="stroke: #000000; stroke-width: 1.5;" x1="67" x2="193" y1="275.9883" y2="275.9883"/><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacingAndGlyphs" textLength="113" x="71" y="269.0352">go-ipld-format</text><!--cluster go-selector--><polygon fill="#FFFFFF" filter="url(#f9pss3pb5gy4d)" points="14,413,104,413,111,435.4883,1668,435.4883,1668,522,14,522,14,413" style="stroke: #000000; stroke-width: 1.5;"/><line style="stroke: #000000; stroke-width: 1.5;" x1="14" x2="111" y1="435.4883" y2="435.4883"/><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacingAndGlyphs" textLength="84" x="18" y="428.5352">go-selector</text><!--cluster go-graphsync--><polygon fill="#FFFFFF" filter="url(#f9pss3pb5gy4d)" points="1676,208,1782,208,1789,230.4883,4573,230.4883,4573,1507,1676,1507,1676,208" style="stroke: #000000; stroke-width: 1.5;"/><line style="stroke: #000000; stroke-width: 1.5;" x1="1676" x2="1789" y1="230.4883" y2="230.4883"/><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacingAndGlyphs" textLength="100" x="1680" y="223.5352">go-graphsync</text><!--cluster network--><polygon fill="#FFFFFF" filter="url(#f9pss3pb5gy4d)" points="1684,781,1749,781,1756,803.4883,2966,803.4883,2966,1302,1684,1302,1684,781" style="stroke: #000000; stroke-width: 1.5;"/><line style="stroke: #000000; stroke-width: 1.5;" x1="1684" x2="1756" y1="803.4883" y2="803.4883"/><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacingAndGlyphs" textLength="59" x="1688" y="796.5352">network</text><!--cluster requestmanager--><polygon fill="#FFFFFF" filter="url(#f9pss3pb5gy4d)" points="1684,553,1806,553,1813,575.4883,2645,575.4883,2645,688,1684,688,1684,553" style="stroke: #000000; stroke-width: 1.5;"/><line style="stroke: #000000; stroke-width: 1.5;" x1="1684" x2="1813" y1="575.4883" y2="575.4883"/><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacingAndGlyphs" textLength="116" x="1688" y="568.5352">requestmanager</text><!--cluster responsemanager--><polygon fill="#FFFFFF" filter="url(#f9pss3pb5gy4d)" points="2664,559.5,2797,559.5,2804,581.9883,3393,581.9883,3393,681.5,2664,681.5,2664,559.5" style="stroke: #000000; stroke-width: 1.5;"/><line style="stroke: #000000; stroke-width: 1.5;" x1="2664" x2="2804" y1="581.9883" y2="581.9883"/><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacingAndGlyphs" textLength="127" x="2668" y="575.0352">responsemanager</text><!--cluster message--><polygon fill="#FFFFFF" filter="url(#f9pss3pb5gy4d)" points="2974,983,3043,983,3050,1005.4883,4565,1005.4883,4565,1499,2974,1499,2974,983" style="stroke: #000000; stroke-width: 1.5;"/><line style="stroke: #000000; stroke-width: 1.5;" x1="2974" x2="3050" y1="1005.4883" y2="1005.4883"/><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacingAndGlyphs" textLength="63" x="2978" y="998.5352">message</text><!--cluster go-filecoin--><polygon fill="#FFFFFF" filter="url(#f9pss3pb5gy4d)" points="1334,16,1421,16,1428,38.4883,1700,38.4883,1700,177,1334,177,1334,16" style="stroke: #000000; stroke-width: 1.5;"/><line style="stroke: #000000; stroke-width: 1.5;" x1="1334" x2="1428" y1="38.4883" y2="38.4883"/><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacingAndGlyphs" textLength="81" x="1338" y="31.5352">go-filecoin</text><!--class Node--><rect fill="#FEFECE" filter="url(#f9pss3pb5gy4d)" height="48" id="Node" style="stroke: #A80036; stroke-width: 1.5;" width="63" x="93.5" y="280.5"/><ellipse cx="108.5" cy="296.5" fill="#B4A7E5" rx="11" ry="11" style="stroke: #A80036; stroke-width: 1.0;"/><path d="M104.4277,292.2651 L104.4277,290.1069 L111.8071,290.1069 L111.8071,292.2651 L109.3418,292.2651 L109.3418,300.3418 L111.8071,300.3418 L111.8071,302.5 L104.4277,302.5 L104.4277,300.3418 L106.8931,300.3418 L106.8931,292.2651 Z "/><text fill="#000000" font-family="sans-serif" font-size="12" font-style="italic" lengthAdjust="spacingAndGlyphs" textLength="31" x="122.5" y="301.0352">Node</text><line style="stroke: #A80036; stroke-width: 1.5;" x1="94.5" x2="155.5" y1="312.5" y2="312.5"/><line style="stroke: #A80036; stroke-width: 1.5;" x1="94.5" x2="155.5" y1="320.5" y2="320.5"/><!--class Selector--><rect fill="#FEFECE" filter="url(#f9pss3pb5gy4d)" height="48" id="Selector" style="stroke: #A80036; stroke-width: 1.5;" width="77" x="195.5" y="453"/><ellipse cx="210.5" cy="469" fill="#B4A7E5" rx="11" ry="11" style="stroke: #A80036; stroke-width: 1.0;"/><path d="M206.4277,464.7651 L206.4277,462.6069 L213.8071,462.6069 L213.8071,464.7651 L211.3418,464.7651 L211.3418,472.8418 L213.8071,472.8418 L213.8071,475 L206.4277,475 L206.4277,472.8418 L208.8931,472.8418 L208.8931,464.7651 Z "/><text fill="#000000" font-family="sans-serif" font-size="12" font-style="italic" lengthAdjust="spacingAndGlyphs" textLength="45" x="224.5" y="473.5352">Selector</text><line style="stroke: #A80036; stroke-width: 1.5;" x1="196.5" x2="271.5" y1="485" y2="485"/><line style="stroke: #A80036; stroke-width: 1.5;" x1="196.5" x2="271.5" y1="493" y2="493"/><!--class SelectionResponse--><rect fill="#FEFECE" filter="url(#f9pss3pb5gy4d)" height="48" id="SelectionResponse" style="stroke: #A80036; stroke-width: 1.5;" width="138" x="22" y="453"/><ellipse cx="37" cy="469" fill="#B4A7E5" rx="11" ry="11" style="stroke: #A80036; stroke-width: 1.0;"/><path d="M32.9277,464.7651 L32.9277,462.6069 L40.3071,462.6069 L40.3071,464.7651 L37.8418,464.7651 L37.8418,472.8418 L40.3071,472.8418 L40.3071,475 L32.9277,475 L32.9277,472.8418 L35.3931,472.8418 L35.3931,464.7651 Z "/><text fill="#000000" font-family="sans-serif" font-size="12" font-style="italic" lengthAdjust="spacingAndGlyphs" textLength="106" x="51" y="473.5352">SelectionResponse</text><line style="stroke: #A80036; stroke-width: 1.5;" x1="23" x2="159" y1="485" y2="485"/><line style="stroke: #A80036; stroke-width: 1.5;" x1="23" x2="159" y1="493" y2="493"/><!--class SelectionTraverser--><rect fill="#FEFECE" filter="url(#f9pss3pb5gy4d)" height="73.9102" id="SelectionTraverser" style="stroke: #A80036; stroke-width: 1.5;" width="170" x="573" y="440"/><ellipse cx="602.4" cy="456" fill="#B4A7E5" rx="11" ry="11" style="stroke: #A80036; stroke-width: 1.0;"/><path d="M598.3277,451.7651 L598.3277,449.6069 L605.7071,449.6069 L605.7071,451.7651 L603.2418,451.7651 L603.2418,459.8418 L605.7071,459.8418 L605.7071,462 L598.3277,462 L598.3277,459.8418 L600.7931,459.8418 L600.7931,451.7651 Z "/><text fill="#000000" font-family="sans-serif" font-size="12" font-style="italic" lengthAdjust="spacingAndGlyphs" textLength="106" x="619.6" y="460.5352">SelectionTraverser</text><line style="stroke: #A80036; stroke-width: 1.5;" x1="574" x2="742" y1="472" y2="472"/><line style="stroke: #A80036; stroke-width: 1.5;" x1="574" x2="742" y1="480" y2="480"/><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="158" x="579" y="494.6348">Next() SelectionResponse, err</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="44" x="579" y="507.5898">Cancel()</text><!--class GetBlockFunc--><rect fill="#FEFECE" filter="url(#f9pss3pb5gy4d)" height="48" id="GetBlockFunc" style="stroke: #A80036; stroke-width: 1.5;" width="230" x="308" y="453"/><ellipse cx="323" cy="469" fill="#B4A7E5" rx="11" ry="11" style="stroke: #A80036; stroke-width: 1.0;"/><path d="M318.9277,464.7651 L318.9277,462.6069 L326.3071,462.6069 L326.3071,464.7651 L323.8418,464.7651 L323.8418,472.8418 L326.3071,472.8418 L326.3071,475 L318.9277,475 L318.9277,472.8418 L321.3931,472.8418 L321.3931,464.7651 Z "/><text fill="#000000" font-family="sans-serif" font-size="12" font-style="italic" lengthAdjust="spacingAndGlyphs" textLength="198" x="337" y="473.5352">GetBlockFunc func(cid) block.Block</text><line style="stroke: #A80036; stroke-width: 1.5;" x1="309" x2="537" y1="485" y2="485"/><line style="stroke: #A80036; stroke-width: 1.5;" x1="309" x2="537" y1="493" y2="493"/><!--class SelectorQuerier--><rect fill="#FEFECE" filter="url(#f9pss3pb5gy4d)" height="73.9102" id="SelectorQuerier" style="stroke: #A80036; stroke-width: 1.5;" width="485" x="1174.5" y="440"/><ellipse cx="1368.75" cy="456" fill="#B4A7E5" rx="11" ry="11" style="stroke: #A80036; stroke-width: 1.0;"/><path d="M1364.6777,451.7651 L1364.6777,449.6069 L1372.0571,449.6069 L1372.0571,451.7651 L1369.5918,451.7651 L1369.5918,459.8418 L1372.0571,459.8418 L1372.0571,462 L1364.6777,462 L1364.6777,459.8418 L1367.1431,459.8418 L1367.1431,451.7651 Z "/><text fill="#000000" font-family="sans-serif" font-size="12" font-style="italic" lengthAdjust="spacingAndGlyphs" textLength="88" x="1389.25" y="460.5352">SelectorQuerier</text><line style="stroke: #A80036; stroke-width: 1.5;" x1="1175.5" x2="1658.5" y1="472" y2="472"/><line style="stroke: #A80036; stroke-width: 1.5;" x1="1175.5" x2="1658.5" y1="480" y2="480"/><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="245" x="1180.5" y="494.6348">Select(Selector, root Node) SelectionTraverser</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="473" x="1180.5" y="507.5898">Validate(Selector, root Node, incomingResponses SelectionTraverser) SelectionTraverser</text><rect fill="#FEFECE" filter="url(#f9pss3pb5gy4d)" height="37.9102" style="stroke: #A80036; stroke-width: 1.5;" width="326" x="778" y="458"/><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacingAndGlyphs" textLength="143" x="869.5" y="471.6016">Package Public Functions</text><line style="stroke: #A80036; stroke-width: 1.5;" x1="779" x2="1103" y1="476.1328" y2="476.1328"/><text fill="#000000" font-family="sans-serif" font-size="10" lengthAdjust="spacingAndGlyphs" textLength="314" x="784" y="489.8008">NewSelectorQuerier(getBlockFunc GetBlockFunc) SelectorQuerier</text><!--class GraphSync--><rect fill="#FEFECE" filter="url(#f9pss3pb5gy4d)" height="138.6855" id="GraphSync" style="stroke: #A80036; stroke-width: 1.5;" width="460" x="1841" y="235"/><ellipse cx="2036.25" cy="251" fill="#ADD1B2" rx="11" ry="11" style="stroke: #A80036; stroke-width: 1.0;"/><path d="M2039.2231,256.6431 Q2038.6421,256.9419 2038.0029,257.0913 Q2037.3638,257.2407 2036.6582,257.2407 Q2034.1514,257.2407 2032.8315,255.5889 Q2031.5117,253.937 2031.5117,250.8159 Q2031.5117,247.6865 2032.8315,246.0347 Q2034.1514,244.3828 2036.6582,244.3828 Q2037.3638,244.3828 2038.0112,244.5322 Q2038.6587,244.6816 2039.2231,244.9805 L2039.2231,247.7031 Q2038.5923,247.1221 2037.9988,246.8523 Q2037.4053,246.5825 2036.7744,246.5825 Q2035.4297,246.5825 2034.7449,247.6492 Q2034.0601,248.7158 2034.0601,250.8159 Q2034.0601,252.9077 2034.7449,253.9744 Q2035.4297,255.041 2036.7744,255.041 Q2037.4053,255.041 2037.9988,254.7712 Q2038.5923,254.5015 2039.2231,253.9204 Z "/><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacingAndGlyphs" textLength="61" x="2056.75" y="255.5352">GraphSync</text><line style="stroke: #A80036; stroke-width: 1.5;" x1="1842" x2="2300" y1="267" y2="267"/><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="160" x="1847" y="281.6348">network : GraphySyncNetwork</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="185" x="1847" y="294.5898">requestManager : RequestManager</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="200" x="1847" y="307.5449">responseManager: ResponseManager</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="174" x="1847" y="320.5">selectorQuerier: SelectorQuerier</text><line style="stroke: #A80036; stroke-width: 1.5;" x1="1842" x2="2300" y1="326.8203" y2="326.8203"/><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="357" x="1847" y="341.4551">Request(p peer.ID, selector Selector, root Node) SelectionTraverser</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="448" x="1847" y="354.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="1847" y="367.3652">ReceiveError(error)</text><rect fill="#FEFECE" filter="url(#f9pss3pb5gy4d)" height="37.9102" style="stroke: #A80036; stroke-width: 1.5;" width="467" x="2336.5" y="285.5"/><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacingAndGlyphs" textLength="135" x="2502.5" y="299.1016">PackagePublicFunctions</text><line style="stroke: #A80036; stroke-width: 1.5;" x1="2337.5" x2="2802.5" y1="303.6328" y2="303.6328"/><text fill="#000000" font-family="sans-serif" font-size="10" lengthAdjust="spacingAndGlyphs" textLength="455" x="2342.5" y="317.3008">New(ctx context.Context, network GraphSyncNetwork, getBlockFunc GetBlockFunc) GraphSync</text><!--class Receiver--><rect fill="#FEFECE" filter="url(#f9pss3pb5gy4d)" height="73.9102" id="Receiver" style="stroke: #A80036; stroke-width: 1.5;" width="460" x="2139" y="808"/><ellipse cx="2340.25" cy="824" fill="#B4A7E5" rx="11" ry="11" style="stroke: #A80036; stroke-width: 1.0;"/><path d="M2336.1777,819.7651 L2336.1777,817.6069 L2343.5571,817.6069 L2343.5571,819.7651 L2341.0918,819.7651 L2341.0918,827.8418 L2343.5571,827.8418 L2343.5571,830 L2336.1777,830 L2336.1777,827.8418 L2338.6431,827.8418 L2338.6431,819.7651 Z "/><text fill="#000000" font-family="sans-serif" font-size="12" font-style="italic" lengthAdjust="spacingAndGlyphs" textLength="49" x="2360.75" y="828.5352">Receiver</text><line style="stroke: #A80036; stroke-width: 1.5;" x1="2140" x2="2598" y1="840" y2="840"/><line style="stroke: #A80036; stroke-width: 1.5;" x1="2140" x2="2598" y1="848" y2="848"/><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="448" x="2145" y="862.6348">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="2145" y="875.5898">ReceiveError(error)</text><!--class GraphSyncNetwork--><rect fill="#FEFECE" filter="url(#f9pss3pb5gy4d)" height="73.9102" id="GraphSyncNetwork" style="stroke: #A80036; stroke-width: 1.5;" width="411" x="1692.5" y="808"/><ellipse cx="1839.25" cy="824" fill="#B4A7E5" rx="11" ry="11" style="stroke: #A80036; stroke-width: 1.0;"/><path d="M1835.1777,819.7651 L1835.1777,817.6069 L1842.5571,817.6069 L1842.5571,819.7651 L1840.0918,819.7651 L1840.0918,827.8418 L1842.5571,827.8418 L1842.5571,830 L1835.1777,830 L1835.1777,827.8418 L1837.6431,827.8418 L1837.6431,819.7651 Z "/><text fill="#000000" font-family="sans-serif" font-size="12" font-style="italic" lengthAdjust="spacingAndGlyphs" textLength="109" x="1859.75" y="828.5352">GraphSyncNetwork</text><line style="stroke: #A80036; stroke-width: 1.5;" x1="1693.5" x2="2102.5" y1="840" y2="840"/><line style="stroke: #A80036; stroke-width: 1.5;" x1="1693.5" x2="2102.5" y1="848" y2="848"/><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="399" x="1698.5" y="862.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="1698.5" y="875.5898">SetDelegate(receiver Receiver)</text><!--class libP2PGraphSyncNetwork--><rect fill="#FEFECE" filter="url(#f9pss3pb5gy4d)" height="48" id="libP2PGraphSyncNetwork" style="stroke: #A80036; stroke-width: 1.5;" width="177" x="2707.5" y="1246"/><ellipse cx="2722.5" cy="1262" fill="#ADD1B2" rx="11" ry="11" style="stroke: #A80036; stroke-width: 1.0;"/><path d="M2725.4731,1267.6431 Q2724.8921,1267.9419 2724.2529,1268.0913 Q2723.6138,1268.2407 2722.9082,1268.2407 Q2720.4014,1268.2407 2719.0815,1266.5889 Q2717.7617,1264.937 2717.7617,1261.8159 Q2717.7617,1258.6865 2719.0815,1257.0347 Q2720.4014,1255.3828 2722.9082,1255.3828 Q2723.6138,1255.3828 2724.2612,1255.5322 Q2724.9087,1255.6816 2725.4731,1255.9805 L2725.4731,1258.7031 Q2724.8423,1258.1221 2724.2488,1257.8523 Q2723.6553,1257.5825 2723.0244,1257.5825 Q2721.6797,1257.5825 2720.9949,1258.6492 Q2720.3101,1259.7158 2720.3101,1261.8159 Q2720.3101,1263.9077 2720.9949,1264.9744 Q2721.6797,1266.041 2723.0244,1266.041 Q2723.6553,1266.041 2724.2488,1265.7712 Q2724.8423,1265.5015 2725.4731,1264.9204 Z "/><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacingAndGlyphs" textLength="145" x="2736.5" y="1266.5352">libP2PGraphSyncNetwork</text><line style="stroke: #A80036; stroke-width: 1.5;" x1="2708.5" x2="2883.5" y1="1278" y2="1278"/><line style="stroke: #A80036; stroke-width: 1.5;" x1="2708.5" x2="2883.5" y1="1286" y2="1286"/><rect fill="#FEFECE" filter="url(#f9pss3pb5gy4d)" height="73.2422" style="stroke: #A80036; stroke-width: 1.5;" width="324" x="2634" y="808.5"/><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacingAndGlyphs" textLength="143" x="2724.5" y="822.1016">Package Public Functions</text><line style="stroke: #A80036; stroke-width: 1.5;" x1="2635" x2="2957" y1="826.6328" y2="826.6328"/><text fill="#000000" font-family="sans-serif" font-size="10" lengthAdjust="spacingAndGlyphs" textLength="201" x="2640" y="840.3008">NewLibP2PNetwork(host libp2pHost.Host,</text><text fill="#000000" font-family="sans-serif" font-size="10" lengthAdjust="spacingAndGlyphs" textLength="304" x="2640" y="852.0781">decodeSelectionResponseFunc: DecodeSelectionResponseFunc,</text><text fill="#000000" font-family="sans-serif" font-size="10" lengthAdjust="spacingAndGlyphs" textLength="202" x="2640" y="863.8555">decodeSelectorFunc: DecodeSelectorFunc,</text><text fill="#000000" font-family="sans-serif" font-size="10" lengthAdjust="spacingAndGlyphs" textLength="312" x="2640" y="875.6328">decodeRootNodeFunc: DecodeRootNodeFunc) GraphSyncNetwork</text><!--class RequestManager--><rect fill="#FEFECE" filter="url(#f9pss3pb5gy4d)" height="99.8203" id="RequestManager" style="stroke: #A80036; stroke-width: 1.5;" width="422" x="2215" y="580"/><ellipse cx="2373.25" cy="596" fill="#ADD1B2" rx="11" ry="11" style="stroke: #A80036; stroke-width: 1.0;"/><path d="M2376.2231,601.6431 Q2375.6421,601.9419 2375.0029,602.0913 Q2374.3638,602.2407 2373.6582,602.2407 Q2371.1514,602.2407 2369.8315,600.5889 Q2368.5117,598.937 2368.5117,595.8159 Q2368.5117,592.6865 2369.8315,591.0347 Q2371.1514,589.3828 2373.6582,589.3828 Q2374.3638,589.3828 2375.0112,589.5322 Q2375.6587,589.6816 2376.2231,589.9805 L2376.2231,592.7031 Q2375.5923,592.1221 2374.9988,591.8523 Q2374.4053,591.5825 2373.7744,591.5825 Q2372.4297,591.5825 2371.7449,592.6492 Q2371.0601,593.7158 2371.0601,595.8159 Q2371.0601,597.9077 2371.7449,598.9744 Q2372.4297,600.041 2373.7744,600.041 Q2374.4053,600.041 2374.9988,599.7712 Q2375.5923,599.5015 2376.2231,598.9204 Z "/><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacingAndGlyphs" textLength="97" x="2393.75" y="600.5352">RequestManager</text><line style="stroke: #A80036; stroke-width: 1.5;" x1="2216" x2="2636" y1="612" y2="612"/><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="154" x="2221" y="626.6348">network : GraphSyncNetwork</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="174" x="2221" y="639.5898">selectorQuerier: SelectorQuerier</text><line style="stroke: #A80036; stroke-width: 1.5;" x1="2216" x2="2636" y1="645.9102" y2="645.9102"/><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="410" x="2221" y="660.5449">SendRequest(p peer.ID, selector Selector, node rootNode) SelectionTraverser</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="285" x="2221" y="673.5">ProcessResponses(responses []GraphSyncResponse)</text><path d="M1692.5,602 L1692.5,657.9316 L2179.5,657.9316 L2179.5,612 L2169.5,602 L1692.5,602 " fill="#FBFB77" filter="url(#f9pss3pb5gy4d)" style="stroke: #A80036; stroke-width: 1.0;"/><path d="M2169.5,602 L2169.5,612 L2179.5,612 L2169.5,602 " fill="#FBFB77" style="stroke: #A80036; stroke-width: 1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="339" x="1698.5" y="619.5684">The ResponseManager uses Validate from go-selector</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="466" x="1698.5" y="634.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="1698.5" y="650.1895">a traverser that only returns valid responses</text><!--class ResponseManager--><rect fill="#FEFECE" filter="url(#f9pss3pb5gy4d)" height="86.8652" id="ResponseManager" style="stroke: #A80036; stroke-width: 1.5;" width="330" x="3055" y="586.5"/><ellipse cx="3162.75" cy="602.5" fill="#ADD1B2" rx="11" ry="11" style="stroke: #A80036; stroke-width: 1.0;"/><path d="M3165.7231,608.1431 Q3165.1421,608.4419 3164.5029,608.5913 Q3163.8638,608.7407 3163.1582,608.7407 Q3160.6514,608.7407 3159.3315,607.0889 Q3158.0117,605.437 3158.0117,602.3159 Q3158.0117,599.1865 3159.3315,597.5347 Q3160.6514,595.8828 3163.1582,595.8828 Q3163.8638,595.8828 3164.5112,596.0322 Q3165.1587,596.1816 3165.7231,596.4805 L3165.7231,599.2031 Q3165.0923,598.6221 3164.4988,598.3523 Q3163.9053,598.0825 3163.2744,598.0825 Q3161.9297,598.0825 3161.2449,599.1492 Q3160.5601,600.2158 3160.5601,602.3159 Q3160.5601,604.4077 3161.2449,605.4744 Q3161.9297,606.541 3163.2744,606.541 Q3163.9053,606.541 3164.4988,606.2712 Q3165.0923,606.0015 3165.7231,605.4204 Z "/><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacingAndGlyphs" textLength="106" x="3183.25" y="607.0352">ResponseManager</text><line style="stroke: #A80036; stroke-width: 1.5;" x1="3056" x2="3384" y1="618.5" y2="618.5"/><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="160" x="3061" y="633.1348">network : GraphySyncNetwork</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="174" x="3061" y="646.0898">selectorQuerier: SelectorQuerier</text><line style="stroke: #A80036; stroke-width: 1.5;" x1="3056" x2="3384" y1="652.4102" y2="652.4102"/><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="318" x="3061" y="667.0449">ProcessRequests(p peer.ID, requests []GraphSyncRequests)</text><path d="M2672.5,586.5 L2672.5,673.0527 L3019.5,673.0527 L3019.5,596.5 L3009.5,586.5 L2672.5,586.5 " fill="#FBFB77" filter="url(#f9pss3pb5gy4d)" style="stroke: #A80036; stroke-width: 1.0;"/><path d="M3009.5,586.5 L3009.5,596.5 L3019.5,596.5 L3009.5,586.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="2678.5" y="604.0684">The ResponseManager uses Select from go-selector</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="313" x="2678.5" y="619.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="2678.5" y="634.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="2682.5" y="650"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="284" x="2678.5" y="665.3105">Question: how to know if response is partial?</text><!--class DecodeSelectionResponseFunc--><rect fill="#FEFECE" filter="url(#f9pss3pb5gy4d)" height="48" id="DecodeSelectionResponseFunc" style="stroke: #A80036; stroke-width: 1.5;" width="387" x="3869.5" y="1042.5"/><ellipse cx="3884.5" cy="1058.5" fill="#B4A7E5" rx="11" ry="11" style="stroke: #A80036; stroke-width: 1.0;"/><path d="M3880.4277,1054.2651 L3880.4277,1052.1069 L3887.8071,1052.1069 L3887.8071,1054.2651 L3885.3418,1054.2651 L3885.3418,1062.3418 L3887.8071,1062.3418 L3887.8071,1064.5 L3880.4277,1064.5 L3880.4277,1062.3418 L3882.8931,1062.3418 L3882.8931,1054.2651 Z "/><text fill="#000000" font-family="sans-serif" font-size="12" font-style="italic" lengthAdjust="spacingAndGlyphs" textLength="355" x="3898.5" y="1063.0352">DecodeSelectionResponseFunc func([]byte) SelectionResponse</text><line style="stroke: #A80036; stroke-width: 1.5;" x1="3870.5" x2="4255.5" y1="1074.5" y2="1074.5"/><line style="stroke: #A80036; stroke-width: 1.5;" x1="3870.5" x2="4255.5" y1="1082.5" y2="1082.5"/><!--class DecodeSelectorFunc--><rect fill="#FEFECE" filter="url(#f9pss3pb5gy4d)" height="48" id="DecodeSelectorFunc" style="stroke: #A80036; stroke-width: 1.5;" width="265" x="4291.5" y="1042.5"/><ellipse cx="4306.5" cy="1058.5" fill="#B4A7E5" rx="11" ry="11" style="stroke: #A80036; stroke-width: 1.0;"/><path d="M4302.4277,1054.2651 L4302.4277,1052.1069 L4309.8071,1052.1069 L4309.8071,1054.2651 L4307.3418,1054.2651 L4307.3418,1062.3418 L4309.8071,1062.3418 L4309.8071,1064.5 L4302.4277,1064.5 L4302.4277,1062.3418 L4304.8931,1062.3418 L4304.8931,1054.2651 Z "/><text fill="#000000" font-family="sans-serif" font-size="12" font-style="italic" lengthAdjust="spacingAndGlyphs" textLength="233" x="4320.5" y="1063.0352">DecodeSelectorFunc func([]byte) Selector</text><line style="stroke: #A80036; stroke-width: 1.5;" x1="4292.5" x2="4555.5" y1="1074.5" y2="1074.5"/><line style="stroke: #A80036; stroke-width: 1.5;" x1="4292.5" x2="4555.5" y1="1082.5" y2="1082.5"/><!--class DecodeRootNodeFunc--><rect fill="#FEFECE" filter="url(#f9pss3pb5gy4d)" height="48" id="DecodeRootNodeFunc" style="stroke: #A80036; stroke-width: 1.5;" width="263" x="3931.5" y="1430"/><ellipse cx="3946.5" cy="1446" fill="#B4A7E5" rx="11" ry="11" style="stroke: #A80036; stroke-width: 1.0;"/><path d="M3942.4277,1441.7651 L3942.4277,1439.6069 L3949.8071,1439.6069 L3949.8071,1441.7651 L3947.3418,1441.7651 L3947.3418,1449.8418 L3949.8071,1449.8418 L3949.8071,1452 L3942.4277,1452 L3942.4277,1449.8418 L3944.8931,1449.8418 L3944.8931,1441.7651 Z "/><text fill="#000000" font-family="sans-serif" font-size="12" font-style="italic" lengthAdjust="spacingAndGlyphs" textLength="231" x="3960.5" y="1450.5352">DecodeRootNodeFunc func([]byte) Node</text><line style="stroke: #A80036; stroke-width: 1.5;" x1="3932.5" x2="4193.5" y1="1462" y2="1462"/><line style="stroke: #A80036; stroke-width: 1.5;" x1="3932.5" x2="4193.5" y1="1470" y2="1470"/><rect fill="#FEFECE" filter="url(#f9pss3pb5gy4d)" height="73.2422" style="stroke: #A80036; stroke-width: 1.5;" width="362" x="2982" y="1030"/><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacingAndGlyphs" textLength="143" x="3091.5" y="1043.6016">Package Public Functions</text><line style="stroke: #A80036; stroke-width: 1.5;" x1="2983" x2="3343" y1="1048.1328" y2="1048.1328"/><text fill="#000000" font-family="sans-serif" font-size="10" lengthAdjust="spacingAndGlyphs" textLength="177" x="2988" y="1061.8008">func FromPBReader(pbr ggio.Reader,</text><text fill="#000000" font-family="sans-serif" font-size="10" lengthAdjust="spacingAndGlyphs" textLength="304" x="2988" y="1073.5781">decodeSelectionResponseFunc: DecodeSelectionResponseFunc,</text><text fill="#000000" font-family="sans-serif" font-size="10" lengthAdjust="spacingAndGlyphs" textLength="202" x="2988" y="1085.3555">decodeSelectorFunc: DecodeSelectorFunc,</text><text fill="#000000" font-family="sans-serif" font-size="10" lengthAdjust="spacingAndGlyphs" textLength="350" x="2988" y="1097.1328">decodeRootNodeFunc: DecodeRootNodeFunc) (GraphSyncMessage, error)</text><!--class GraphSyncRequest--><rect fill="#FEFECE" filter="url(#f9pss3pb5gy4d)" height="112.7754" id="GraphSyncRequest" style="stroke: #A80036; stroke-width: 1.5;" width="140" x="3694" y="1010"/><ellipse cx="3709" cy="1026" fill="#B4A7E5" rx="11" ry="11" style="stroke: #A80036; stroke-width: 1.0;"/><path d="M3704.9277,1021.7651 L3704.9277,1019.6069 L3712.3071,1019.6069 L3712.3071,1021.7651 L3709.8418,1021.7651 L3709.8418,1029.8418 L3712.3071,1029.8418 L3712.3071,1032 L3704.9277,1032 L3704.9277,1029.8418 L3707.3931,1029.8418 L3707.3931,1021.7651 Z "/><text fill="#000000" font-family="sans-serif" font-size="12" font-style="italic" lengthAdjust="spacingAndGlyphs" textLength="108" x="3723" y="1030.5352">GraphSyncRequest</text><line style="stroke: #A80036; stroke-width: 1.5;" x1="3695" x2="3833" y1="1042" y2="1042"/><line style="stroke: #A80036; stroke-width: 1.5;" x1="3695" x2="3833" y1="1050" y2="1050"/><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="97" x="3700" y="1064.6348">Selector() Selector</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="76" x="3700" y="1077.5898">Root()     Node</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="89" x="3700" y="1090.5449">Priority() Priority</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="54" x="3700" y="1103.5">ID()       int</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="80" x="3700" y="1116.4551">IsCancel() bool</text><!--class GraphSyncResponse--><rect fill="#FEFECE" filter="url(#f9pss3pb5gy4d)" height="73.9102" id="GraphSyncResponse" style="stroke: #A80036; stroke-width: 1.5;" width="149" x="3509.5" y="1029.5"/><ellipse cx="3524.5" cy="1045.5" fill="#B4A7E5" rx="11" ry="11" style="stroke: #A80036; stroke-width: 1.0;"/><path d="M3520.4277,1041.2651 L3520.4277,1039.1069 L3527.8071,1039.1069 L3527.8071,1041.2651 L3525.3418,1041.2651 L3525.3418,1049.3418 L3527.8071,1049.3418 L3527.8071,1051.5 L3520.4277,1051.5 L3520.4277,1049.3418 L3522.8931,1049.3418 L3522.8931,1041.2651 Z "/><text fill="#000000" font-family="sans-serif" font-size="12" font-style="italic" lengthAdjust="spacingAndGlyphs" textLength="117" x="3538.5" y="1050.0352">GraphSyncResponse</text><line style="stroke: #A80036; stroke-width: 1.5;" x1="3510.5" x2="3657.5" y1="1061.5" y2="1061.5"/><line style="stroke: #A80036; stroke-width: 1.5;" x1="3510.5" x2="3657.5" y1="1069.5" y2="1069.5"/><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="79" x="3515.5" y="1084.1348">RequestID() int</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="135" x="3515.5" y="1097.0898">Status() GraphSyncStatus</text><!--class GraphSyncMessage--><rect fill="#FEFECE" filter="url(#f9pss3pb5gy4d)" height="73.9102" id="GraphSyncMessage" style="stroke: #A80036; stroke-width: 1.5;" width="205" x="3481.5" y="1417"/><ellipse cx="3524.4" cy="1433" fill="#B4A7E5" rx="11" ry="11" style="stroke: #A80036; stroke-width: 1.0;"/><path d="M3520.3277,1428.7651 L3520.3277,1426.6069 L3527.7071,1426.6069 L3527.7071,1428.7651 L3525.2418,1428.7651 L3525.2418,1436.8418 L3527.7071,1436.8418 L3527.7071,1439 L3520.3277,1439 L3520.3277,1436.8418 L3522.7931,1436.8418 L3522.7931,1428.7651 Z "/><text fill="#000000" font-family="sans-serif" font-size="12" font-style="italic" lengthAdjust="spacingAndGlyphs" textLength="111" x="3544.6" y="1437.5352">GraphSyncMessage</text><line style="stroke: #A80036; stroke-width: 1.5;" x1="3482.5" x2="3685.5" y1="1449" y2="1449"/><line style="stroke: #A80036; stroke-width: 1.5;" x1="3482.5" x2="3685.5" y1="1457" y2="1457"/><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="175" x="3487.5" y="1471.6348">Requests() : []GraphSyncRequest</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="193" x="3487.5" y="1484.5898">Responses() : []GraphSyncResponse</text><!--class Exportable--><rect fill="#FEFECE" filter="url(#f9pss3pb5gy4d)" height="60.9551" id="Exportable" style="stroke: #A80036; stroke-width: 1.5;" width="95" x="3379.5" y="1036"/><ellipse cx="3394.5" cy="1052" fill="#B4A7E5" rx="11" ry="11" style="stroke: #A80036; stroke-width: 1.0;"/><path d="M3390.4277,1047.7651 L3390.4277,1045.6069 L3397.8071,1045.6069 L3397.8071,1047.7651 L3395.3418,1047.7651 L3395.3418,1055.8418 L3397.8071,1055.8418 L3397.8071,1058 L3390.4277,1058 L3390.4277,1055.8418 L3392.8931,1055.8418 L3392.8931,1047.7651 Z "/><text fill="#000000" font-family="sans-serif" font-size="12" font-style="italic" lengthAdjust="spacingAndGlyphs" textLength="63" x="3408.5" y="1056.5352">Exportable</text><line style="stroke: #A80036; stroke-width: 1.5;" x1="3380.5" x2="3473.5" y1="1068" y2="1068"/><line style="stroke: #A80036; stroke-width: 1.5;" x1="3380.5" x2="3473.5" y1="1076" y2="1076"/><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="51" x="3385.5" y="1090.6348">ToProto()</text><!--class go-filecoin--><rect fill="#FEFECE" filter="url(#f9pss3pb5gy4d)" height="125.7305" id="go-filecoin" style="stroke: #A80036; stroke-width: 1.5;" width="349" x="1342.5" y="43"/><ellipse cx="1482.25" cy="59" fill="#ADD1B2" rx="11" ry="11" style="stroke: #A80036; stroke-width: 1.0;"/><path d="M1485.2231,64.6431 Q1484.6421,64.9419 1484.0029,65.0913 Q1483.3638,65.2407 1482.6582,65.2407 Q1480.1514,65.2407 1478.8315,63.5889 Q1477.5117,61.937 1477.5117,58.8159 Q1477.5117,55.6865 1478.8315,54.0347 Q1480.1514,52.3828 1482.6582,52.3828 Q1483.3638,52.3828 1484.0112,52.5322 Q1484.6587,52.6816 1485.2231,52.9805 L1485.2231,55.7031 Q1484.5923,55.1221 1483.9988,54.8523 Q1483.4053,54.5825 1482.7744,54.5825 Q1481.4297,54.5825 1480.7449,55.6492 Q1480.0601,56.7158 1480.0601,58.8159 Q1480.0601,60.9077 1480.7449,61.9744 Q1481.4297,63.041 1482.7744,63.041 Q1483.4053,63.041 1483.9988,62.7712 Q1484.5923,62.5015 1485.2231,61.9204 Z "/><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacingAndGlyphs" textLength="61" x="1502.75" y="63.5352">go-filecoin</text><line style="stroke: #A80036; stroke-width: 1.5;" x1="1343.5" x2="1690.5" y1="75" y2="75"/><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="124" x="1348.5" y="89.6348">graphSync : GraphSync</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="174" x="1348.5" y="102.5898">selectorQuerier: SelectorQuerier</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="117" x="1348.5" y="115.5449">host: libp2pHost.Host</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="337" x="1348.5" y="128.5">decodeSelectionResponseFunc: DecodeSelectionResponseFunc</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="223" x="1348.5" y="141.4551">decodeSelectorFunc: DecodeSelectorFunc</text><text fill="#000000" font-family="sans-serif" font-size="11" lengthAdjust="spacingAndGlyphs" textLength="243" x="1348.5" y="154.4102">decodeRootNodeFunc: DecodeRootNodeFunc</text><line style="stroke: #A80036; stroke-width: 1.5;" x1="1343.5" x2="1690.5" y1="160.7305" y2="160.7305"/><path d="M1005.5,292 L1005.5,317.3105 L1272.5,317.3105 L1272.5,302 L1262.5,292 L1005.5,292 " fill="#FBFB77" filter="url(#f9pss3pb5gy4d)" style="stroke: #A80036; stroke-width: 1.0;"/><path d="M1262.5,292 L1262.5,302 L1272.5,302 L1262.5,292 " fill="#FBFB77" style="stroke: #A80036; stroke-width: 1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="246" x="1011.5" y="309.5684">Is this the right name for this package?</text><!--link GMN5 to go-selector--><path d="M1139,317.1843 C1139,336.169 1139,373.355 1139,407.0824 C1139,408.1364 1139,409.187 1139,410.2336 C1139,410.7569 1139,411.2791 1139,411.8003 C1139,412.0609 1139,412.3212 1139,412.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="M151.1749,345.9236 C172.2673,379.3037 201.1984,425.0893 218.6924,452.7747 " fill="none" id="Node-Selector" style="stroke: #A80036; stroke-width: 1.0;"/><polygon fill="none" points="145.1518,349.4959,140.3859,328.8492,156.9871,342.0174,145.1518,349.4959" style="stroke: #A80036; stroke-width: 1.0;"/><!--link Node to SelectionResponse--><path d="M116.2815,348.7334 C109.7575,381.8334 101.0801,425.8583 95.7748,452.7747 " fill="none" id="Node-SelectionResponse" style="stroke: #A80036; stroke-width: 1.0;"/><polygon fill="none" points="109.4652,347.118,120.2007,328.8492,123.2009,349.8253,109.4652,347.118" style="stroke: #A80036; stroke-width: 1.0;"/><!--link GraphSync to SelectorQuerier--><path d="M1828.073,368.5748 C1736.8184,392.6442 1636.1924,419.1855 1557.3394,439.9839 " fill="none" id="GraphSync-SelectorQuerier" style="stroke: #A80036; stroke-width: 1.0;"/><polygon fill="#A80036" points="1840.884,365.1957,1834.0623,362.8582,1829.2808,368.2562,1836.1026,370.5937,1840.884,365.1957" style="stroke: #A80036; stroke-width: 1.0;"/><!--link Receiver to GraphSync--><path d="M2511.7365,802.8342 C2545.9408,794.2163 2582.5427,786.2016 2617,781 C2663.0851,774.043 3455,788.1072 3455,741.5 C3455,477 3455,477 3455,477 C3455,350.26 2443.6507,396.918 2319,374 C2313.0631,372.9084 2307.0627,371.7387 2301.0219,370.5022 " fill="none" id="Receiver-GraphSync" style="stroke: #A80036; stroke-width: 1.0;"/><polygon fill="none" points="2513.0245,809.7313,2491.9089,807.9613,2509.5196,796.1772,2513.0245,809.7313" style="stroke: #A80036; stroke-width: 1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="71" x="3456" y="635.0684">receiver for</text><!--link GraphSyncNetwork to libP2PGraphSyncNetwork--><path d="M2117.6647,885.9972 C2223.5876,907.331 2328,931.4234 2328,943.5 C2328,943.5 2328,943.5 2328,1184.5 C2328,1222.6485 2571.7445,1250.2652 2707.4226,1262.6828 " fill="none" id="GraphSyncNetwork-libP2PGraphSyncNetwork" style="stroke: #A80036; stroke-width: 1.0;"/><polygon fill="none" points="2116.136,892.8302,2097.8939,882.0493,2118.8774,879.1012,2116.136,892.8302" style="stroke: #A80036; stroke-width: 1.0;"/><!--link goGraphSyncNetworkPF to libP2PGraphSyncNetwork--><path d="M2796,881.9517 C2796,900.4355 2796,923.1502 2796,943.5 C2796,943.5 2796,943.5 2796,1184.5 C2796,1205.1328 2796,1228.5664 2796,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="M1613.3451,514.0485 C1631.7848,516.9701 1650.2207,519.6814 1668,522 C1791.8152,538.1468 1823.3395,537.8819 1948,545 C2003.2719,548.156 2142.5152,543.1843 2197,553 C2226.5279,558.3196 2257.4336,566.6782 2286.6419,575.9621 " fill="none" id="SelectorQuerier-RequestManager" style="stroke: #A80036; stroke-width: 1.0;"/><polygon fill="#A80036" points="2299.0468,579.9914,2294.576,574.3335,2287.6338,576.2842,2292.1046,581.9421,2299.0468,579.9914" style="stroke: #A80036; stroke-width: 1.0;"/><!--link RequestManager to GraphSyncNetwork--><path d="M2290.9352,684.998 C2196.2859,723.5389 2072.3294,774.0136 1989.1768,807.8731 " fill="none" id="RequestManager-GraphSyncNetwork" style="stroke: #A80036; stroke-width: 1.0;"/><polygon fill="#A80036" points="2303.2066,680.0011,2296.1411,678.5593,2292.0927,684.5268,2299.1582,685.9686,2303.2066,680.0011" style="stroke: #A80036; stroke-width: 1.0;"/><!--link GraphSync to RequestManager--><path d="M2156.8261,383.1941 C2223.5843,444.4048 2314.1883,527.4797 2371.3774,579.9165 " fill="none" id="GraphSync-RequestManager" style="stroke: #A80036; stroke-width: 1.0;"/><polygon fill="#A80036" points="2147.1564,374.3279,2148.8755,381.3311,2156.0012,382.4377,2154.2821,375.4345,2147.1564,374.3279" style="stroke: #A80036; stroke-width: 1.0;"/><!--link SelectorQuerier to ResponseManager--><path d="M1611.6084,514.0076 C1630.6228,516.9858 1649.658,519.7194 1668,522 C1813.0191,540.0313 1849.9745,539.3246 1996,545 C2053.7914,547.2461 2980.3523,541.341 3037,553 C3066.1149,558.9923 3096.381,569.6854 3123.7186,581.2321 " fill="none" id="SelectorQuerier-ResponseManager" style="stroke: #A80036; stroke-width: 1.0;"/><polygon fill="#A80036" points="3135.6494,586.4018,3131.7344,580.346,3124.6387,581.6307,3128.5537,587.6865,3135.6494,586.4018" style="stroke: #A80036; stroke-width: 1.0;"/><!--link ResponseManager to GraphSyncNetwork--><path d="M3083.9614,677.0261 C3068.2622,681.2838 3052.373,685.0822 3037,688 C2896.0713,714.7486 2857.8156,696.5803 2715,710 C2450.7262,734.8325 2382.2135,728.5957 2122,781 C2086.6133,788.1265 2048.6744,798.0628 2014.2641,807.9836 " fill="none" id="ResponseManager-GraphSyncNetwork" style="stroke: #A80036; stroke-width: 1.0;"/><polygon fill="#A80036" points="3096.4976,673.5209,3089.6421,671.2843,3084.9408,676.7522,3091.7963,678.9888,3096.4976,673.5209" style="stroke: #A80036; stroke-width: 1.0;"/><!--link GraphSync to ResponseManager--><path d="M2314.0593,372.6896 C2315.7117,373.1287 2317.3588,373.5655 2319,374 C2636.9278,458.1598 2724.9518,449.1399 3037,553 C3065.7802,562.579 3096.398,574.6711 3124.1893,586.4166 " fill="none" id="GraphSync-ResponseManager" style="stroke: #A80036; stroke-width: 1.0;"/><polygon fill="#A80036" points="2301.2951,369.2823,2306.0605,374.6945,2312.8891,372.3773,2308.1238,366.9651,2301.2951,369.2823" style="stroke: #A80036; stroke-width: 1.0;"/><!--link goGraphSyncMessagePF to libP2PGraphSyncNetwork--><path d="M3096.9639,1103.1168 C3022.361,1144.4837 2903.0711,1210.6295 2839.3876,1245.9417 " fill="none" id="goGraphSyncMessagePF-libP2PGraphSyncNetwork" style="stroke: #A80036; stroke-width: 1.0; stroke-dasharray: 7.0,7.0;"/><!--link Exportable to GraphSyncMessage--><path d="M3452.7936,1097.4085 C3469.0557,1120.0506 3487,1152.3247 3487,1184.5 C3487,1184.5 3487,1184.5 3487,1355.5 C3487,1373.4611 3495.2892,1389.3385 3507.0213,1402.8156 " fill="none" id="Exportable-GraphSyncMessage" style="stroke: #A80036; stroke-width: 1.0;"/><polygon fill="none" points="3512.0989,1397.9908,3521.4717,1416.9949,3502.2936,1407.9837,3512.0989,1397.9908" style="stroke: #A80036; stroke-width: 1.0;"/><!--link GraphSyncRequest to GraphSyncMessage--><path d="M3712.8254,1123.1528 C3701.0978,1141.4383 3692,1162.6613 3692,1184.5 C3692,1184.5 3692,1184.5 3692,1355.5 C3692,1376.4103 3680.8112,1394.0644 3665.6364,1408.3922 " fill="none" id="GraphSyncRequest-GraphSyncMessage" style="stroke: #A80036; stroke-width: 1.0;"/><polygon fill="#A80036" points="3655.7371,1416.8828,3662.8955,1416.0127,3664.8456,1409.0703,3657.6872,1409.9404,3655.7371,1416.8828" style="stroke: #A80036; stroke-width: 1.0;"/><!--link GraphSyncResponse to GraphSyncMessage--><path d="M3584,1103.7018 C3584,1126.9308 3584,1157.4583 3584,1184.5 C3584,1184.5 3584,1184.5 3584,1355.5 C3584,1371.1071 3584,1388.1051 3584,1403.5188 " fill="none" id="GraphSyncResponse-GraphSyncMessage" style="stroke: #A80036; stroke-width: 1.0;"/><polygon fill="#A80036" points="3584,1416.5814,3588,1410.5814,3584,1404.5814,3580,1410.5814,3584,1416.5814" style="stroke: #A80036; stroke-width: 1.0;"/><!--link go-filecoin to GraphSync--><path d="M1704.041,173.0174 C1759.6174,192.9306 1820.6138,214.7858 1876.6441,234.8616 " fill="none" id="go-filecoin-GraphSync" style="stroke: #A80036; stroke-width: 1.0;"/><polygon fill="#A80036" points="1691.5287,168.5342,1695.8278,174.3237,1702.8254,172.582,1698.5263,166.7925,1691.5287,168.5342" style="stroke: #A80036; stroke-width: 1.0;"/><!--link go-filecoin to goGraphsyncPf--><path d="M1691.7203,116.0782 C1855.711,128.3797 2106.8452,154.557 2319,208 C2395.5091,227.2731 2480.3897,263.155 2529.2456,285.3175 " 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="M1691.8952,109.0396 C2173.461,118.1604 3488.0142,148.4181 3559,208 C3592.6936,236.2808 3581,260.5107 3581,304.5 C3581,304.5 3581,304.5 3581,741.5 C3581,758.5764 3573.7543,764.4025 3559,773 C3508.4176,802.475 3166.7493,825.4531 2958.1463,836.936 " 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="M1342.4257,129.4356 C1223.8167,146.9774 1063.8623,173.805 925,208 C637.0378,278.911 537.7203,249.9501 290,413 C274.2145,423.3901 260.2145,439.3901 250.1609,452.7925 " 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="M1496.4933,182.0797 C1475.3183,260.6392 1443.1599,379.9467 1427.0044,439.8837 " fill="none" id="go-filecoin-SelectorQuerier" style="stroke: #A80036; stroke-width: 1.0;"/><polygon fill="#A80036" points="1499.923,169.3556,1494.4993,174.1078,1496.8,180.9421,1502.2237,176.1898,1499.923,169.3556" style="stroke: #A80036; stroke-width: 1.0;"/><!--link go-filecoin to goSelectorPF--><path d="M1342.2652,118.5473 C1207.7434,131.9435 1036.798,158.3403 988,208 C919.7155,277.4903 930.7737,408.755 937.7936,457.8389 " fill="none" id="go-filecoin-goSelectorPF" style="stroke: #A80036; stroke-width: 1.0; stroke-dasharray: 7.0,7.0;"/><!--link DecodeSelectionResponseFunc to DecodeSelectorFunc--><!--link DecodeSelectionResponseFunc to DecodeRootNodeFunc--><!--
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 29
  interface SelectorQuerier {
    Select(Selector, root Node) SelectionTraverser
30 31
    Validate(Selector, root Node, incomingResponses SelectionTraverser) SelectionTraverser
  }
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 50 51 52 53

      Request(p peer.ID, selector Selector, root Node) SelectionTraverser
      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 66 67 68 69 70 71
    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)
    }

    Receiver <|- - GraphSync : receiver for

    class libP2PGraphSyncNetwork {
    }
72

73 74 75
    GraphSyncNetwork <|- - libP2PGraphSyncNetwork
    
    object "Package Public Functions" as goGraphSyncNetworkPF {
76 77 78 79
      NewLibP2PNetwork(host libp2pHost.Host,
      decodeSelectionResponseFunc: DecodeSelectionResponseFunc,
      decodeSelectorFunc: DecodeSelectorFunc,
      decodeRootNodeFunc: DecodeRootNodeFunc) GraphSyncNetwork
80 81 82 83 84 85 86
    }
    goGraphSyncNetworkPF .. libP2PGraphSyncNetwork 
  }

  package requestmanager {
  class RequestManager {
    network : GraphSyncNetwork
87 88
    selectorQuerier: SelectorQuerier

89 90 91
    SendRequest(p peer.ID, selector Selector, node rootNode) SelectionTraverser
    ProcessResponses(responses []GraphSyncResponse)
  }
92
  SelectorQuerier - -* RequestManager
93 94 95 96 97 98 99 100 101 102 103 104
  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
105
    selectorQuerier: SelectorQuerier
106 107
    ProcessRequests(p peer.ID, requests []GraphSyncRequests)
  }
108
  SelectorQuerier - -* ResponseManager
109 110 111 112 113 114 115 116 117 118 119
  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 {
120 121 122 123
    interface "DecodeSelectionResponseFunc func([]byte) SelectionResponse" as DecodeSelectionResponseFunc
  interface "DecodeSelectorFunc func([]byte) Selector" as DecodeSelectorFunc
  interface "DecodeRootNodeFunc func([]byte) Node" as DecodeRootNodeFunc

124
    object "Package Public Functions" as goGraphSyncMessagePF {
125 126 127 128
      func FromPBReader(pbr ggio.Reader,
      decodeSelectionResponseFunc: DecodeSelectionResponseFunc,
      decodeSelectorFunc: DecodeSelectorFunc,
      decodeRootNodeFunc: DecodeRootNodeFunc) (GraphSyncMessage, error)
129 130 131
    }
    goGraphSyncMessagePF .. libP2PGraphSyncNetwork

132 133 134 135 136 137
    interface GraphSyncRequest {
      Selector() Selector
      Root()     Node
      Priority() Priority
      ID()       int
      IsCancel() bool
138 139
    }

140 141 142
    interface GraphSyncResponse {
      RequestID() int
      Status() GraphSyncStatus
143 144 145 146 147 148 149 150
    }

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

    interface Exportable {
151
      ToProto()
152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168
	  }

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

  object "PackagePublicFunctions" as goGraphsyncPf {
    New(ctx context.Context, network GraphSyncNetwork, getBlockFunc GetBlockFunc) GraphSync
  }

}

package "go-filecoin" {
  class "go-filecoin" {
    graphSync : GraphSync
169
    selectorQuerier: SelectorQuerier
170
    host: libp2pHost.Host
171 172 173
    decodeSelectionResponseFunc: DecodeSelectionResponseFunc
    decodeSelectorFunc: DecodeSelectorFunc
    decodeRootNodeFunc: DecodeRootNodeFunc
174 175 176 177 178 179
  }

  "go-filecoin" *- - GraphSync
  "go-filecoin" .. goGraphsyncPf
  "go-filecoin" .. goGraphSyncNetworkPF
  "go-filecoin" .. Selector
180 181 182
  "go-filecoin" *- - SelectorQuerier
  "go-filecoin" .. goSelectorPF

183 184 185 186 187 188 189 190 191 192 193 194 195 196 197
}

@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>