|
| 1 | +syntax = "proto3"; |
| 2 | + |
| 3 | +package graphprotocol.indexer.dips; |
| 4 | + |
| 5 | +service DipsService { |
| 6 | + /** |
| 7 | + * Propose a new _indexing agreement_ to an _indexer_. |
| 8 | + * |
| 9 | + * The _indexer_ can `ACCEPT` or `REJECT` the agreement. |
| 10 | + */ |
| 11 | + rpc SubmitAgreementProposal(SubmitAgreementProposalRequest) returns (SubmitAgreementProposalResponse); |
| 12 | + |
| 13 | + /** |
| 14 | + * Request to cancel an existing _indexing agreement_. |
| 15 | + */ |
| 16 | + rpc CancelAgreement(CancelAgreementRequest) returns (CancelAgreementResponse); |
| 17 | +} |
| 18 | + |
| 19 | +/** |
| 20 | + * A request to propose a new _indexing agreement_ to an _indexer_. |
| 21 | + * |
| 22 | + * See the `DipsService.SubmitAgreementProposal` method. |
| 23 | + */ |
| 24 | +message SubmitAgreementProposalRequest { |
| 25 | + bytes agreementId = 1; /// The ID of the agreement to register. |
| 26 | + reserved 2 to 19; /// Reserved for future use. |
| 27 | + |
| 28 | + Voucher voucher = 20; /// The voucher of the agreement. |
| 29 | + |
| 30 | + bytes signature = 99; /// The signature of the message. |
| 31 | +} |
| 32 | + |
| 33 | +/** |
| 34 | + * A voucher of an _indexing agreement_. |
| 35 | + */ |
| 36 | +message Voucher { |
| 37 | + bytes payer = 1; /// The agreement payer. |
| 38 | + bytes recipient = 2; /// The voucher recipient address. |
| 39 | + bytes service = 3; /// Service address that will initiate the payment collection. |
| 40 | + reserved 4 to 9; /// Reserved for future use. |
| 41 | + |
| 42 | + uint32 durationEpochs = 10; /// The duration of the agreement in epochs. |
| 43 | + reserved 11 to 19; /// Reserved for future use. |
| 44 | + |
| 45 | + bytes maxInitialAmount = 20; /// The maximum amount, in _wei GRT_, that can be collected for the initial subgraph sync. |
| 46 | + bytes minOngoingAmountPerEpoch = 21; /// The maximum amount, in _wei GRT_, that can be collected per epoch (after the initial sync). |
| 47 | + reserved 22 to 29; /// Reserved for future use. |
| 48 | + |
| 49 | + uint32 maxEpochsPerCollection = 30; /// The maximum number of epochs that can be collected at once. |
| 50 | + uint32 minEpochsPerCollection = 31; /// The minimum number of epochs that can be collected at once. |
| 51 | + reserved 32 to 39; /// Reserved for future use. |
| 52 | + |
| 53 | + VoucherMetadata metadata = 50; /// The voucher metadata. |
| 54 | +} |
| 55 | + |
| 56 | + |
| 57 | +/** |
| 58 | + * The indexing agreement voucher metadata. |
| 59 | + */ |
| 60 | +message VoucherMetadata { |
| 61 | + bytes deploymentId = 1; /// The Subgraph deployment ID to index. |
| 62 | + reserved 2 to 19; /// Reserved for future use. |
| 63 | + |
| 64 | + bytes pricePerBlock = 20; /// The amount to pay per indexed block in _wei GRT per block_. |
| 65 | + bytes pricePerEntityPerEpoch = 21; /// The amount to pay per indexed and stored entity in _wei GRT per entity per epoch_. |
| 66 | +} |
| 67 | + |
| 68 | +/** |
| 69 | + * A response to a request to propose a new _indexing agreement_ to an _indexer_. |
| 70 | + * |
| 71 | + * See the `DipsService.SubmitAgreementProposal` method. |
| 72 | + */ |
| 73 | +message SubmitAgreementProposalResponse { |
| 74 | + ProposalResponse response = 1; /// The response to the agreement proposal. |
| 75 | +} |
| 76 | + |
| 77 | +/** |
| 78 | + * The response to an _indexing agreement_ proposal. |
| 79 | + */ |
| 80 | +enum ProposalResponse { |
| 81 | + ACCEPT = 0; /// The agreement proposal was accepted. |
| 82 | + REJECT = 1; /// The agreement proposal was rejected. |
| 83 | +} |
| 84 | + |
| 85 | +/** |
| 86 | + * A request to cancel an existing _indexing agreement_. |
| 87 | + * |
| 88 | + * See the `DipsService.CancelAgreement` method. |
| 89 | + */ |
| 90 | +message CancelAgreementRequest { |
| 91 | + bytes agreementId = 1; /// The ID of the agreement to cancel. |
| 92 | + reserved 2 to 20; /// Reserved for future use. |
| 93 | + |
| 94 | + bytes signature = 99; /// The signature of the message. |
| 95 | +} |
| 96 | + |
| 97 | +/** |
| 98 | + * A response to a request to cancel an existing _indexing agreement_. |
| 99 | + * |
| 100 | + * See the `DipsService.CancelAgreement` method. |
| 101 | + */ |
| 102 | +message CancelAgreementResponse { |
| 103 | + // Empty message |
| 104 | +} |
0 commit comments