getRewards()
:getRewards()
:Disputes
tab.queryFeeCut
and indexingRewardCut
values are delegation parameters that the Indexer may set along with cooldownBlocks to control the distribution of GRT between the indexer and their delegators. See the last steps in Staking in the Protocol for instructions on setting the delegation parameters.Important: Be careful about exposing ports publicly - administration ports should be kept locked down. This includes the the Graph Node JSON-RPC and the indexer management endpoints detailed below.
INDEXER_SERVICE_PORT
INDEXER_AGENT_INDEXER_MANAGEMENT_PORT
terraform.tfvars
in this directory (or modify the one we created in the last step). For each variable where you want to override the default, or where you need to set a value, enter a setting into terraform.tfvars
.~/.kube/config
and set it as your default context.k8s/overlays
to a new directory $dir,
and adjust the bases
entry in $dir/kustomization.yaml
so that it points to the directory k8s/base
.$dir
and adjust any values as indicated in the comments.kubectl apply -k $dir
.docker-compose.yaml
.host.docker.internal
in the docker-compose.yaml
using the included script:NOTE: All runtime configuration variables may be applied either as parameters to the command on startup or using environment variables of the formatCOMPONENT_NAME_VARIABLE_NAME
(ex.INDEXER_AGENT_ETHEREUM
).
@graphprotocol/graph-cli
accessible in the terminal at graph indexer
.graph indexer connect <url>
- Connect to the indexer management API. Typically the connection to the server is opened via port forwarding, so the CLI can be easily operated remotely. (Example: kubectl port-forward pod/<indexer-agent-pod> 8000:8000
)graph indexer rules get [options] <deployment-id< [<key1> ...]
- Get one or more indexing rules using all
as the <deployment-id>
to get all rules, or global
to get the global defaults. An additional argument --merged
can be used to specify that deployment specific rules are merged with the global rule. This is how they are applied in the indexer agent.graph indexer rules set [options] <deployment-id> <key1> <value1> ...
- Set one or more indexing rules.graph indexer rules start [options] <deployment-id>
- Start indexing a subgraph deployment if available and set its decisionBasis
to always
, so the indexer agent will always choose to index it. If the global rule is set to always then all available subgraphs on the network will be indexed.graph indexer rules stop [options] <deployment-id>
- Stop indexing a deployment and set its decisionBasis
to never, so it will skip this deployment when deciding on deployments to index.graph indexer rules maybe [options] <deployment-id>
— Set thedecisionBasis
for a deployment to rules
, so that the indexer agent will use indexing rules to decide whether to index this deployment.table
, yaml
, and json
) using the -output
argument.deployment
and decisionBasis
fields are mandatory, while all other fields are optional. When an indexing rule has rules
as the decisionBasis
, then the indexer agent will compare non-null threshold values on that rule with values fetched from the network for the corresponding deployment. If the subgraph deployment has values above (or below) any of the thresholds it will be chosen for indexing.minStake
of 5 (GRT), any subgraph deployment which has more than 5 (GRT) of stake allocated to it will be indexed. Threshold rules include maxAllocationPercentage
, minSignal
, maxSignal
, minStake
, and minAverageQueryFees
.GraphToken.abi
selected and open in the editor, switch to the Deploy and Run Transactions
section in the Remix interface.Injected Web3
and under Account
select your indexer address.0xc944E90C64B2c07662A292be6244BDf05Cda44a7
) next to At Address
and click the At address
button to apply.approve(spender, amount)
function to approve the Staking contract. Fill in spender
with the Staking contract address (0xF55041E37E12cD407ad00CE2910B8269B01263b9
) and amount
with the tokens to stake (in wei).File Explorer
create a file named Staking.abi with the staking ABI.Staking.abi
selected and open in the editor, switch to the Deploy
and Run Transactions
section in the Remix interface.Injected Web3
and under Account
select your indexer address.0xF55041E37E12cD407ad00CE2910B8269B01263b9
) next to At Address
and click the At address
button to apply.stake()
to stake GRT in the protocol.setOperator()
with the operator address.setDelegationParameters()
. The following example sets the queryFeeCut to distribute 95% of query rebates to the indexer and 5% to delegators, set the indexingRewardCutto distribute 60% of indexing rewards to the indexer and 40% to delegators, and set thecooldownBlocks
period to 500 blocks.graph init
from graph-cli
with two contracts? Or should I manually add another datasource in subgraph.yaml
after running graph init
?graph init
is intended as a basic starting point, from which you can then add more data sources manually.crypto.keccak256
but this won't make it more unique.graph-ts
as per the example below:filter: call
. Call handlers are not supported for the time being.dataSources.source.startBlock
in the subgraph.yaml
file specifies the number of the block that the data source starts indexing from. In most cases, we suggest using the block in which the contract was created: Start blocksmainnet
<api_key>
placeholder with the API key you wish to leverage in the Subgraph Studio.