Created
October 28, 2021 20:43
-
-
Save thephez/3646382a67353c517185f124197a17df to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Must be executed from within the dapi-grpc repository folder | |
# Requires gRPCurl (https://github.com/fullstorydev/grpcurl) to run | |
BLOCK_HEIGHT=1 | |
TXID=4004d3f9f1b688f2babb1f98ea48e1472be51e29712f942fc379c6e996cdd308 | |
IDENTITY_ID_B64="KVKPajj5rQh5LpoDLZk8dtHFbASadzzPvgLPFm4P9q0=" | |
PUBLIC_KEY_HASHES="Hl3rumcvEF5vBjX6IaZJHUWbjYM=" | |
DATA_CONTRACT_ID="Zgbwte3d6DhC3X1bM3BWgJPWFLAA/Cl3SL5o3lpL+bc=" | |
#DOCUMENT_ID="9ihM7GpC6Em1l5GA3E5tw2HrFvDxFwZea/yoLxMfR6s=" | |
DOCUMENT_TYPE="note" | |
DOCUMENT_QUERY_LIMIT=2 | |
echo "getStatus" | |
echo "---------" | |
grpcurl -plaintext -proto protos/core/v0/core.proto \ | |
seed-1.testnet.networks.dash.org:3010 \ | |
org.dash.platform.dapi.v0.Core/getStatus | |
echo "--------" | |
echo "getBlock" | |
echo "--------" | |
grpcurl -plaintext -proto protos/core/v0/core.proto \ | |
-d '{ | |
"height":'$BLOCK_HEIGHT' | |
}' \ | |
seed-1.testnet.networks.dash.org:3010 \ | |
org.dash.platform.dapi.v0.Core/getBlock | |
echo "--------------" | |
echo "getTransaction" | |
echo "--------------" | |
grpcurl -plaintext -proto protos/core/v0/core.proto \ | |
-d '{ | |
"id":"'$TXID'" | |
}' \ | |
seed-1.testnet.networks.dash.org:3010 \ | |
org.dash.platform.dapi.v0.Core/getTransaction | |
echo "subscribeToTransactionsWithProofs" | |
echo "---------------------------------" | |
grpcurl -proto protos/core/v0/core.proto -plaintext \ | |
-d '{ | |
"from_block_height": 1, | |
"count": 1, | |
"bloom_filter": { | |
"n_hash_funcs": 11, | |
"v_data": "", | |
"n_tweak": 0, | |
"n_flags": 0 | |
} | |
}' \ | |
seed-1.testnet.networks.dash.org:3010 \ | |
org.dash.platform.dapi.v0.Core/subscribeToTransactionsWithProofs | |
echo "getIdentity" | |
echo "-----------" | |
# `id` must be represented in base64 | |
grpcurl -proto protos/platform/v0/platform.proto -plaintext \ | |
-d '{ | |
"id":"'$IDENTITY_ID_B64'" | |
}' \ | |
seed-1.testnet.networks.dash.org:3010 \ | |
org.dash.platform.dapi.v0.Platform/getIdentity | |
echo "getIdentity with proof" | |
echo "----------------------" | |
# `id` must be represented in base64 | |
grpcurl -proto protos/platform/v0/platform.proto -plaintext \ | |
-d '{ | |
"id":"'$IDENTITY_ID_B64'", | |
"prove":true | |
}' \ | |
seed-1.testnet.networks.dash.org:3010 \ | |
org.dash.platform.dapi.v0.Platform/getIdentity | |
echo "------------------------------" | |
echo "getIdentitiesByPublicKeyHashes" | |
echo "------------------------------" | |
# `public_key_hashes` must be represented in base64 | |
grpcurl -proto protos/platform/v0/platform.proto -plaintext \ | |
-d '{ | |
"public_key_hashes":"'$PUBLIC_KEY_HASHES'" | |
}' \ | |
seed-1.testnet.networks.dash.org:3010 \ | |
org.dash.platform.dapi.v0.Platform/getIdentitiesByPublicKeyHashes | |
echo "-----------------------------------------" | |
echo "getIdentitiesByPublicKeyHashes with proof" | |
echo "-----------------------------------------" | |
# `public_key_hashes` must be represented in base64 | |
grpcurl -proto protos/platform/v0/platform.proto -plaintext \ | |
-d '{ | |
"public_key_hashes":"'$PUBLIC_KEY_HASHES'", | |
"prove": true | |
}' \ | |
seed-1.testnet.networks.dash.org:3010 \ | |
org.dash.platform.dapi.v0.Platform/getIdentitiesByPublicKeyHashes | |
echo "-------------------------------" | |
echo "getIdentityIdsByPublicKeyHashes" | |
echo "-------------------------------" | |
# `public_key_hashes` must be represented in base64 | |
grpcurl -proto protos/platform/v0/platform.proto -plaintext \ | |
-d '{ | |
"public_key_hashes":"'$PUBLIC_KEY_HASHES'" | |
}' \ | |
seed-1.testnet.networks.dash.org:3010 \ | |
org.dash.platform.dapi.v0.Platform/getIdentityIdsByPublicKeyHashes | |
echo "------------------------------------------" | |
echo "getIdentityIdsByPublicKeyHashes with proof" | |
echo "------------------------------------------" | |
# `public_key_hashes` must be represented in base64 | |
grpcurl -proto protos/platform/v0/platform.proto -plaintext \ | |
-d '{ | |
"public_key_hashes":"'$PUBLIC_KEY_HASHES'", | |
"prove": true | |
}' \ | |
seed-1.testnet.networks.dash.org:3010 \ | |
org.dash.platform.dapi.v0.Platform/getIdentityIdsByPublicKeyHashes | |
echo "-------------------------------" | |
echo "getDataContract" | |
echo "-------------------------------" | |
# `id` must be represented in base64 | |
grpcurl -proto protos/platform/v0/platform.proto -plaintext \ | |
-d '{ | |
"id":"'$DATA_CONTRACT_ID'" | |
}' \ | |
seed-1.testnet.networks.dash.org:3010 \ | |
org.dash.platform.dapi.v0.Platform/getDataContract | |
echo "--------------------------" | |
echo "getDataContract with proof" | |
echo "--------------------------" | |
# `id` must be represented in base64 | |
grpcurl -proto protos/platform/v0/platform.proto -plaintext \ | |
-d '{ | |
"id":"'$DATA_CONTRACT_ID'", | |
"prove": true | |
}' \ | |
seed-1.testnet.networks.dash.org:3010 \ | |
org.dash.platform.dapi.v0.Platform/getDataContract | |
echo "--------------------------" | |
echo "getDocument" | |
echo "--------------------------" | |
# `id` must be represented in base64 | |
grpcurl -proto protos/platform/v0/platform.proto -plaintext \ | |
-d '{ | |
"data_contract_id":"'$DATA_CONTRACT_ID'", | |
"document_type":"'$DOCUMENT_TYPE'", | |
"limit":'$DOCUMENT_QUERY_LIMIT' | |
}' \ | |
seed-1.testnet.networks.dash.org:3010 \ | |
org.dash.platform.dapi.v0.Platform/getDocuments | |
echo "----------------------" | |
echo "getDocument with proof" | |
echo "----------------------" | |
# `id` must be represented in base64 | |
grpcurl -proto protos/platform/v0/platform.proto -plaintext \ | |
-d '{ | |
"data_contract_id":"'$DATA_CONTRACT_ID'", | |
"document_type":"'$DOCUMENT_TYPE'", | |
"limit":'$DOCUMENT_QUERY_LIMIT', | |
"prove": true | |
}' \ | |
seed-1.testnet.networks.dash.org:3010 \ | |
org.dash.platform.dapi.v0.Platform/getDocuments |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment