diff --git a/content/eosio/public-apis/community-support.md b/content/eosio/public-apis/community-support.md index ce9a8f3d..1789a0f0 100644 --- a/content/eosio/public-apis/community-support.md +++ b/content/eosio/public-apis/community-support.md @@ -6,7 +6,9 @@ title: Community & Support dfuse has a vibrant community to support you and our own engineers never too far to give you a hand: * [EOSIO Telegram Group](https://t.me/dfuseAPI) -* [EOSIO Community Forums](https://community.dfuse.io/c/dfuse-for-eosio/) (preferred method) +* [Community Edition Telegram Group](https://t.me/dfuseAPI) +* [Ethereum Telegram Group](https://t.me/dfuseETH) +* WeChat Group: search and follow "dfuse API" WeChat Public Account to join We're also very active on social medias with fresh content for blockchain developers on a weekly basis: @@ -15,6 +17,8 @@ We're also very active on social medias with fresh content for blockchain develo * [YouTube](https://www.youtube.com/channel/UCT_wVH42n6jv-IG8C7QsHGg) * [reddit](https://www.reddit.com/user/dfuseio) * [Facebook](https://www.facebook.com/dfuseio) +* WeChat Public Account: dfuse API + If you need to get in touch for sales or media inquiries, you can use this contact us form: diff --git a/content/eosio/public-apis/getting-started/quickstart-javascript.md b/content/eosio/public-apis/getting-started/quickstart-javascript.md index cec3fd41..a7eb84d0 100644 --- a/content/eosio/public-apis/getting-started/quickstart-javascript.md +++ b/content/eosio/public-apis/getting-started/quickstart-javascript.md @@ -128,7 +128,7 @@ to you, you get to choose and pick only what you are interested in. Want to inspect the full set of available fields you can retrieve? - [GraphQL API]({{< ref "/eosio/public-apis/reference/graphql-api" >}}) -- {{< external-link href="https://mainnet.eos.dfuse.io/graphiql/?query=c3Vic2NyaXB0aW9uIHsKICBzZWFyY2hUcmFuc2FjdGlvbnNGb3J3YXJkKHF1ZXJ5OiJyZWNlaXZlcjplb3Npby50b2tlbiBhY3Rpb246dHJhbnNmZXIgLWRhdGEucXVhbnRpdHk6JzAuMDAwMSBFT1MnIikgewogICAgdW5kbyBjdXJzb3IKICAgIHRyYWNlIHsgaWQgbWF0Y2hpbmdBY3Rpb25zIHsganNvbiB9IH0KICB9Cn0=" title="GraphiQL, online query editor with completion and docs">}} +- {{< external-link href="https://testnet.eos.dfuse.io/graphiql/?query=c3Vic2NyaXB0aW9uIHsKICBzZWFyY2hUcmFuc2FjdGlvbnNGb3J3YXJkKHF1ZXJ5OiJyZWNlaXZlcjplb3Npby50b2tlbiBhY3Rpb246dHJhbnNmZXIgLWRhdGEucXVhbnRpdHk6JzAuMDAwMSBFT1MnIikgewogICAgdW5kbyBjdXJzb3IKICAgIHRyYWNlIHsgaWQgbWF0Y2hpbmdBY3Rpb25zIHsganNvbiB9IH0KICB9Cn0=" title="GraphiQL, online query editor with completion and docs">}} {{< /alert >}} {{< tabs "define-query">}} @@ -247,4 +247,4 @@ start index.eosio.thml # Windows - [Try one of our tutorials]({{< ref "/eosio/public-apis/tutorials" >}}) - {{< external-link title="The `@dfuse/client-js` overview document" href="https://github.com/dfuse-io/client-js/blob/master/README.md#dfuse-javascripttypescript-client-library" >}} - {{< external-link title="The `@dfuse/client-js` quick API reference" href="https://github.com/dfuse-io/client-js/blob/master/README.md#api" >}} ({{< external-link title="Full API reference" href="https://dfuse-io.github.io/client-js/" >}}) -- {{< external-link title="GraphiQL, online query editor with completion and docs" href="https://mainnet.eos.dfuse.io/graphiql/?query=c3Vic2NyaXB0aW9uIHsKICBzZWFyY2hUcmFuc2FjdGlvbnNGb3J3YXJkKHF1ZXJ5OiJyZWNlaXZlcjplb3Npby50b2tlbiBhY3Rpb246dHJhbnNmZXIgLWRhdGEucXVhbnRpdHk6JzAuMDAwMSBFT1MnIikgewogICAgdW5kbyBjdXJzb3IKICAgIHRyYWNlIHsgaWQgbWF0Y2hpbmdBY3Rpb25zIHsganNvbiB9IH0KICB9Cn0=" >}} +- {{< external-link title="GraphiQL, online query editor with completion and docs" href="https://testnet.eos.dfuse.io/graphiql/?query=c3Vic2NyaXB0aW9uIHsKICBzZWFyY2hUcmFuc2FjdGlvbnNGb3J3YXJkKHF1ZXJ5OiJyZWNlaXZlcjplb3Npby50b2tlbiBhY3Rpb246dHJhbnNmZXIgLWRhdGEucXVhbnRpdHk6JzAuMDAwMSBFT1MnIikgewogICAgdW5kbyBjdXJzb3IKICAgIHRyYWNlIHsgaWQgbWF0Y2hpbmdBY3Rpb25zIHsganNvbiB9IH0KICB9Cn0=" >}} diff --git a/content/eosio/public-apis/getting-started/quickstart-other-languages.md b/content/eosio/public-apis/getting-started/quickstart-other-languages.md index 4377e7f6..42e47c6f 100644 --- a/content/eosio/public-apis/getting-started/quickstart-other-languages.md +++ b/content/eosio/public-apis/getting-started/quickstart-other-languages.md @@ -101,7 +101,7 @@ to you, as you get to pick and choose only what you are interested in. Want to inspect the full set of available fields you can retrieve? * [GraphQL API Reference]({{< ref "/eosio/public-apis/reference/graphql-api" >}}) -* {{< external-link href="https://mainnet.eos.dfuse.io/graphiql/?query=c3Vic2NyaXB0aW9uIHsKICBzZWFyY2hUcmFuc2FjdGlvbnNGb3J3YXJkKHF1ZXJ5OiJyZWNlaXZlcjplb3Npby50b2tlbiBhY3Rpb246dHJhbnNmZXIgLWRhdGEucXVhbnRpdHk6JzAuMDAwMSBFT1MnIikgewogICAgdW5kbyBjdXJzb3IKICAgIHRyYWNlIHsgaWQgbWF0Y2hpbmdBY3Rpb25zIHsganNvbiB9IH0KICB9Cn0=" title="GraphiQL, online query editor with completion and docs">}} +* {{< external-link href="https://testnet.eos.dfuse.io/graphiql/?query=c3Vic2NyaXB0aW9uIHsKICBzZWFyY2hUcmFuc2FjdGlvbnNGb3J3YXJkKHF1ZXJ5OiJyZWNlaXZlcjplb3Npby50b2tlbiBhY3Rpb246dHJhbnNmZXIgLWRhdGEucXVhbnRpdHk6JzAuMDAwMSBFT1MnIikgewogICAgdW5kbyBjdXJzb3IKICAgIHRyYWNlIHsgaWQgbWF0Y2hpbmdBY3Rpb25zIHsganNvbiB9IH0KICB9Cn0=" title="GraphiQL, online query editor with completion and docs">}} {{< /alert >}} {{< tabs "define-query">}} diff --git a/content/eosio/public-apis/reference/authentication.md b/content/eosio/public-apis/reference/authentication.md index 511c035b..203fc119 100644 --- a/content/eosio/public-apis/reference/authentication.md +++ b/content/eosio/public-apis/reference/authentication.md @@ -13,10 +13,10 @@ To authenticate REST requests, specify an `Authorization: Bearer [JWT token]` he {{< tabs "rest-auth" >}} {{< tab title="curl" lang="bash" >}} -curl -H "Authorization: Bearer YOURTOKENHERE" -u https://mainnet.eos.dfuse.io/v0/state/... [ ... ] +curl -H "Authorization: Bearer YOURTOKENHERE" -u https://testnet.eos.dfuse.io/v0/state/... [ ... ] {{< /tab >}} {{< tab title="eosc" lang="bash" >}} -eosc -H "Authorization: Bearer YOURTOKENHERE" -u https://mainnet.eos.dfuse.io [ ... ] +eosc -H "Authorization: Bearer YOURTOKENHERE" -u https://testnet.eos.dfuse.io [ ... ] {{< /tab >}} {{< /tabs >}} @@ -28,7 +28,7 @@ This example uses the command-line WebSocket {{< tabs "websocket-auth" >}} {{< tab lang="shell" >}} -ws wss://mainnet.eos.dfuse.io/v1/stream?token=YOURTOKENHERE +ws wss://testnet.eos.dfuse.io/v1/stream?token=YOURTOKENHERE {{< /tab >}} {{< /tabs >}} diff --git a/content/eosio/public-apis/reference/rest/get-block_id-by_time.md b/content/eosio/public-apis/reference/rest/get-block_id-by_time.md index a3101ad9..69889a57 100644 --- a/content/eosio/public-apis/reference/rest/get-block_id-by_time.md +++ b/content/eosio/public-apis/reference/rest/get-block_id-by_time.md @@ -13,7 +13,7 @@ Get the block ID produced at a given time. The following example fetches the block ID, time and block number for the timestamp `2019-03-04T10:36:14.6Z`. -{{< example-request id="req-by-time" url="https://mainnet.eos.dfuse.io/v0/block_id/by_time?time=2019-03-04T10:36:14.5Z&comparator=gte" >}} +{{< example-request id="req-by-time" url="https://testnet.eos.dfuse.io/v0/block_id/by_time?time=2019-03-04T10:36:14.5Z&comparator=gte" >}} {{< tabs "block-id-response">}} {{< tab title="Response" lang="json" >}} diff --git a/content/eosio/public-apis/reference/rest/get-search-transactions.md b/content/eosio/public-apis/reference/rest/get-search-transactions.md index ce2e139d..87679e71 100644 --- a/content/eosio/public-apis/reference/rest/get-search-transactions.md +++ b/content/eosio/public-apis/reference/rest/get-search-transactions.md @@ -23,7 +23,7 @@ of this endpoint. Main advantages of using the GraphQL API of this endpoint over Sample request: -{{< example-request id="search-transactions" url="https://mainnet.eos.dfuse.io/v0/search/transactions?start_block=0&block_count=10000&limit=10&sort=desc&q=receiver:eosio.token+action:transfer+data.to:someaccount1" >}} +{{< example-request id="search-transactions" url="https://testnet.eos.dfuse.io/v0/search/transactions?start_block=0&block_count=10000&limit=10&sort=desc&q=receiver:eosio.token+action:transfer+data.to:someaccount1" >}} ## Pagination diff --git a/content/eosio/public-apis/reference/rest/get-state-abi.md b/content/eosio/public-apis/reference/rest/get-state-abi.md index 60842d51..7d4cb5d2 100644 --- a/content/eosio/public-apis/reference/rest/get-state-abi.md +++ b/content/eosio/public-apis/reference/rest/get-state-abi.md @@ -11,7 +11,7 @@ Fetches the ABI for a given contract account, at any block height. Sample request: -{{< example-request id="search-transactions" url="https://mainnet.eos.dfuse.io/v0/state/abi?account=eosio&json=true" >}} +{{< example-request id="search-transactions" url="https://testnet.eos.dfuse.io/v0/state/abi?account=eosio&json=true" >}} ## Requesting past blocks diff --git a/content/eosio/public-apis/reference/rest/get-state-key_accounts.md b/content/eosio/public-apis/reference/rest/get-state-key_accounts.md index 8756299d..ad90437f 100644 --- a/content/eosio/public-apis/reference/rest/get-state-key_accounts.md +++ b/content/eosio/public-apis/reference/rest/get-state-key_accounts.md @@ -13,7 +13,7 @@ Fetches the accounts controlled by the given public key, at any block height. Sample request: -{{< example-request id="search-transactions" url="https://mainnet.eos.dfuse.io/v0/state/key_accounts?public_key=EOS7YNS1swh6QWANkzGgFrjiX8E3u8WK5CK9GMAb6EzKVNZMYhCH3" >}} +{{< example-request id="search-transactions" url="https://testnet.eos.dfuse.io/v0/state/key_accounts?public_key=EOS7YNS1swh6QWANkzGgFrjiX8E3u8WK5CK9GMAb6EzKVNZMYhCH3" >}} {{< alert type="note" >}} This endpoint is a drop-in replacement for the `/v1/history/get_key_accounts` API endpoint from standard `nodeos`. Simply tweak the URL, and add the Bearer token. diff --git a/content/eosio/public-apis/reference/rest/get-state-permission_links.md b/content/eosio/public-apis/reference/rest/get-state-permission_links.md index 87d23c84..45fab815 100644 --- a/content/eosio/public-apis/reference/rest/get-state-permission_links.md +++ b/content/eosio/public-apis/reference/rest/get-state-permission_links.md @@ -12,7 +12,7 @@ Fetches snapshots of any account’s linked authorizations on the blockchain, at Sample request: -{{< example-request id="search-transactions" url="https://mainnet.eos.dfuse.io/v0/state/permission_links?account=eoscanadacom&block_num=10000000" >}} +{{< example-request id="search-transactions" url="https://testnet.eos.dfuse.io/v0/state/permission_links?account=eoscanadacom&block_num=10000000" >}} Fetches snapshots of any account's linked authorizations on the blockchain, at any block height. diff --git a/content/eosio/public-apis/reference/rest/get-state-table-row.md b/content/eosio/public-apis/reference/rest/get-state-table-row.md index bc8c8551..329705ed 100644 --- a/content/eosio/public-apis/reference/rest/get-state-table-row.md +++ b/content/eosio/public-apis/reference/rest/get-state-table-row.md @@ -12,7 +12,7 @@ Fetches a single row from the state of any table, at any block height. Sample request: -{{< example-request id="search-transactions" url="https://mainnet.eos.dfuse.io/v0/state/table/row?account=eosio.token&scope=b1&table=accounts&primary_key=EOS&key_type=symbol_code&block_num=25000000&json=true" >}} +{{< example-request id="search-transactions" url="https://testnet.eos.dfuse.io/v0/state/table/row?account=eosio.token&scope=b1&table=accounts&primary_key=EOS&key_type=symbol_code&block_num=25000000&json=true" >}} ## Requesting past blocks diff --git a/content/eosio/public-apis/reference/rest/get-state-table.md b/content/eosio/public-apis/reference/rest/get-state-table.md index 00267899..1b240c03 100644 --- a/content/eosio/public-apis/reference/rest/get-state-table.md +++ b/content/eosio/public-apis/reference/rest/get-state-table.md @@ -12,7 +12,7 @@ Fetches the state of any table, at any block height. Sample request: -{{< example-request id="search-transactions" url="https://mainnet.eos.dfuse.io/v0/state/table?account=eosio.token&scope=b1&table=accounts&block_num=25000000&json=true" >}} +{{< example-request id="search-transactions" url="https://testnet.eos.dfuse.io/v0/state/table?account=eosio.token&scope=b1&table=accounts&block_num=25000000&json=true" >}} ## Requesting past blocks diff --git a/content/eosio/public-apis/reference/rest/get-state-table_scopes.md b/content/eosio/public-apis/reference/rest/get-state-table_scopes.md index 7ef805ff..b3c0997e 100644 --- a/content/eosio/public-apis/reference/rest/get-state-table_scopes.md +++ b/content/eosio/public-apis/reference/rest/get-state-table_scopes.md @@ -16,7 +16,7 @@ Not to be confused with [/v0/state/tables/scopes]({{< ref "./get-state-tables-sc Sample request: -{{< example-request id="search-transactions" url="https://mainnet.eos.dfuse.io/v0/state/table_scopes?account=eosforumdapp&table=proposal" >}} +{{< example-request id="search-transactions" url="https://testnet.eos.dfuse.io/v0/state/table_scopes?account=eosforumdapp&table=proposal" >}} ## Requesting past blocks diff --git a/content/eosio/public-apis/reference/rest/get-state-tables-accounts.md b/content/eosio/public-apis/reference/rest/get-state-tables-accounts.md index 7c21cac2..9508d6a5 100644 --- a/content/eosio/public-apis/reference/rest/get-state-tables-accounts.md +++ b/content/eosio/public-apis/reference/rest/get-state-tables-accounts.md @@ -16,7 +16,7 @@ The output format is slightly different too. Sample request: -{{< example-request id="search-transactions" url="https://mainnet.eos.dfuse.io/v0/state/tables/accounts?accounts=eosio.token|eosadddddddd|tokenbyeocat|ethsidechain|epraofficial|alibabapoole|hirevibeshvt|oo1122334455|irespotokens|publytoken11|parslseed123|trybenetwork|zkstokensr4u&scope=b1&table=accounts&block_num=25000000&json=true" >}} +{{< example-request id="search-transactions" url="https://testnet.eos.dfuse.io/v0/state/tables/accounts?accounts=eosio.token|eosadddddddd|tokenbyeocat|ethsidechain|epraofficial|alibabapoole|hirevibeshvt|oo1122334455|irespotokens|publytoken11|parslseed123|trybenetwork|zkstokensr4u&scope=b1&table=accounts&block_num=25000000&json=true" >}} ## Requesting past blocks & ABI handling diff --git a/content/eosio/public-apis/reference/rest/get-state-tables-scopes.md b/content/eosio/public-apis/reference/rest/get-state-tables-scopes.md index 52485565..9b4364a8 100644 --- a/content/eosio/public-apis/reference/rest/get-state-tables-scopes.md +++ b/content/eosio/public-apis/reference/rest/get-state-tables-scopes.md @@ -23,7 +23,7 @@ The output format is slightly different too. Sample request: -{{< example-request id="search-transactions" url="https://mainnet.eos.dfuse.io/v0/state/tables/scopes?account=eosio&scopes=eosio.token|eosadddddddd|tokenbyeocat|ethsidechain|epraofficial|alibabapoole|hirevibeshvt|oo1122334455|irespotokens|publytoken11|parslseed123|trybenetwork|zkstokensr4u&table=delband&block_num=25000000&json=true" >}} +{{< example-request id="search-transactions" url="https://testnet.eos.dfuse.io/v0/state/tables/scopes?account=eosio&scopes=eosio.token|eosadddddddd|tokenbyeocat|ethsidechain|epraofficial|alibabapoole|hirevibeshvt|oo1122334455|irespotokens|publytoken11|parslseed123|trybenetwork|zkstokensr4u&table=delband&block_num=25000000&json=true" >}} ## Requesting past blocks & ABI handling diff --git a/content/eosio/public-apis/reference/rest/get-transactions.md b/content/eosio/public-apis/reference/rest/get-transactions.md index e5e38d86..6296feed 100644 --- a/content/eosio/public-apis/reference/rest/get-transactions.md +++ b/content/eosio/public-apis/reference/rest/get-transactions.md @@ -11,7 +11,7 @@ Fetching the transaction lifecycle associated with the provided parameter `:id`. ## Usage -{{< example-request id="search-transactions" url="https://mainnet.eos.dfuse.io/v0/transactions/1d5f57e9392d045ef4d1d19e6976803f06741e11089855b94efcdb42a1a41253" >}} +{{< example-request id="search-transactions" url="https://testnet.eos.dfuse.io/v0/transactions/1d5f57e9392d045ef4d1d19e6976803f06741e11089855b94efcdb42a1a41253" >}} This method returns transaction information regardless of the actual lifecycle state be it deferred, executed, failed or cancelled. This means that deferred @@ -29,13 +29,13 @@ overview of lifecycle related properties that are available in the response. #### Response -Here is a sample response, for transaction id `1d5f57e9392d045ef4d1d19e6976803f06741e11089855b94efcdb42a1a41253` on EOS Mainnet: +Here is a sample response, for transaction id `4844708BA8CBDF30F75B856BAE8A7B15A3898A1CA9F0FB9A5FBA897C1E975A5C` on EOSIO Testnet: {{< tabs "fetch-transaction-example" >}} {{< tab lang="json" >}} { "transaction_status": "executed", - "id": "1d5f57e9392d045ef4d1d19e6976803f06741e11089855b94efcdb42a1a41253", + "id": "4844708BA8CBDF30F75B856BAE8A7B15A3898A1CA9F0FB9A5FBA897C1E975A5C", "transaction": { "expiration": "2019-04-16T14:36:11", ..., @@ -48,7 +48,7 @@ Here is a sample response, for transaction id `1d5f57e9392d045ef4d1d19e6976803f0 ], }, "execution_trace": { - "id": "1d5f57e9392d045ef4d1d19e6976803f06741e11089855b94efcdb42a1a41253", + "id": "4844708BA8CBDF30F75B856BAE8A7B15A3898A1CA9F0FB9A5FBA897C1E975A5C", ..., "receipt": { "status": "executed", diff --git a/content/eosio/public-apis/reference/rest/post-chain-push_transaction.md b/content/eosio/public-apis/reference/rest/post-chain-push_transaction.md index 014ff53d..1f07904e 100644 --- a/content/eosio/public-apis/reference/rest/post-chain-push_transaction.md +++ b/content/eosio/public-apis/reference/rest/post-chain-push_transaction.md @@ -47,8 +47,8 @@ Older version of `cleos` have {{< external-link href="https://github.com/EOSIO/eos/pull/6265" title="an issue addressed in this PR">}} {{< highlight shell >}} -eosc -H "Authorization: Bearer YOURTOKENHERE" -H "X-Eos-Push-Guarantee: irreversible" -u "https://mainnet.eos.dfuse.io" tx push mytx.json -eosc -H "Authorization: Bearer YOURTOKENHERE" -H "X-Eos-Push-Guarantee: handoffs:3" -u "https://mainnet.eos.dfuse.io" transfer sourceaccount destination 5 +eosc -H "Authorization: Bearer YOURTOKENHERE" -H "X-Eos-Push-Guarantee: irreversible" -u "https://testnet.eos.dfuse.io" tx push mytx.json +eosc -H "Authorization: Bearer YOURTOKENHERE" -H "X-Eos-Push-Guarantee: handoffs:3" -u "https://testnet.eos.dfuse.io" transfer sourceaccount destination 5 {{< /highlight >}} You can always use `eosc` to use the feature: diff --git a/content/eosio/public-apis/reference/rest/post-state-abi-bin_to_json.md b/content/eosio/public-apis/reference/rest/post-state-abi-bin_to_json.md index 40f60edb..66f8f8ca 100644 --- a/content/eosio/public-apis/reference/rest/post-state-abi-bin_to_json.md +++ b/content/eosio/public-apis/reference/rest/post-state-abi-bin_to_json.md @@ -17,11 +17,11 @@ Sample request: {{< tab lang="shell" >}} curl -X POST -H "Authorization: Bearer eyJhbGciOiJLTVNFUzI1Ni..." \ -d '{"account":"eosio.token","table":"accounts","block_num":2500000,"hex_rows":["aa2c0b010000000004454f5300000000"]}' \ - "https://mainnet.eos.dfuse.io/v0/state/abi/bin_to_json" + "https://testnet.eos.dfuse.io/v0/state/abi/bin_to_json" {{< /tab >}} {{< tab lang="javascript" >}} -fetch("https://mainnet.eos.dfuse.io/v0/state/abi/bin_to_json", { +fetch("https://testnet.eos.dfuse.io/v0/state/abi/bin_to_json", { method: "POST", body: JSON.stringify({ account: "eosio.token", @@ -45,7 +45,7 @@ headers = { data = '{"account":"eosio.token","table":"accounts","block_num":2500000,"hex_rows":["aa2c0b010000000004454f5300000000"]}' -response = requests.post('https://mainnet.eos.dfuse.io/v0/state/abi/bin_to_json', headers=headers, data=data) +response = requests.post('https://testnet.eos.dfuse.io/v0/state/abi/bin_to_json', headers=headers, data=data) {{< /tab >}} {{< tab lang="go" >}} @@ -61,7 +61,7 @@ import ( func main() { client := &http.Client{} var data = []byte(`{{"account":"eosio.token","table":"accounts","block_num":2500000,"hex_rows":["aa2c0b010000000004454f5300000000"]}}`) - req, err := http.NewRequest("POST", "https://mainnet.eos.dfuse.io/v0/state/abi/bin_to_json", data) + req, err := http.NewRequest("POST", "https://testnet.eos.dfuse.io/v0/state/abi/bin_to_json", data) if err != nil { log.Fatal(err) } diff --git a/content/eosio/public-apis/reference/websocket/req-get-action-traces.md b/content/eosio/public-apis/reference/websocket/req-get-action-traces.md index 17ebcebe..f29708bc 100644 --- a/content/eosio/public-apis/reference/websocket/req-get-action-traces.md +++ b/content/eosio/public-apis/reference/websocket/req-get-action-traces.md @@ -146,7 +146,7 @@ subscription ($cursor: String) { {{< /highlight >}} {{< alert type="note" >}} -Eager to try out the document above? Head down straight to our {{< external-link title="GraphiQL Online Editor" href="https://mainnet.eos.dfuse.io/graphiql/?query=c3Vic2NyaXB0aW9uICgkY3Vyc29yOiBTdHJpbmcpIHsKICBzZWFyY2hUcmFuc2FjdGlvbnNGb3J3YXJkKAogICAgcXVlcnk6ICIoYWNjb3VudDplb3Npby50b2tlbiBPUiBhY2NvdW50OnRoZXRlcnRoZXRlcikgKGFjdGlvbjp0cmFuc2ZlciBPUiBhY3Rpb246aXNzdWUpIiwKICAgIGN1cnNvcjogJGN1cnNvcgogICkgewogICAgdW5kbyBjdXJzb3IKICAgIGJsb2NrIHsgbnVtIGlkIH0KICAgIHRyYWNlIHsKICAgICAgaWQKICAgICAgbWF0Y2hpbmdBY3Rpb25zIHsKICAgICAgICBzZXEKICAgICAgICByZWNlaXZlciBhY2NvdW50IG5hbWUKICAgICAgICBqc29uCiAgICAgICAgZGJPcHMgeyBvcGVyYXRpb24gb2xkSlNPTiB7IG9iamVjdCBlcnJvciB9IG5ld0pTT04geyBvYmplY3QgZXJyb3IgfSB9CiAgICAgICAgZHRyeE9wcyB7IG9wZXJhdGlvbiBwYXllciB0cmFuc2FjdGlvbiB7IGFjdGlvbnMgeyBhY2NvdW50IG5hbWUganNvbiB9IH0gfQogICAgICAgIHJhbU9wcyB7IG9wZXJhdGlvbiBkZWx0YSB1c2FnZSB9CiAgICAgIH0KICAgIH0KICB9Cn0=" >}} and press the play button in the top bar of the page. +Eager to try out the document above? Head down straight to our {{< external-link title="GraphiQL Online Editor" href="https://testnet.eos.dfuse.io/graphiql/?query=c3Vic2NyaXB0aW9uICgkY3Vyc29yOiBTdHJpbmcpIHsKICBzZWFyY2hUcmFuc2FjdGlvbnNGb3J3YXJkKAogICAgcXVlcnk6ICIoYWNjb3VudDplb3Npby50b2tlbiBPUiBhY2NvdW50OnRoZXRlcnRoZXRlcikgKGFjdGlvbjp0cmFuc2ZlciBPUiBhY3Rpb246aXNzdWUpIiwKICAgIGN1cnNvcjogJGN1cnNvcgogICkgewogICAgdW5kbyBjdXJzb3IKICAgIGJsb2NrIHsgbnVtIGlkIH0KICAgIHRyYWNlIHsKICAgICAgaWQKICAgICAgbWF0Y2hpbmdBY3Rpb25zIHsKICAgICAgICBzZXEKICAgICAgICByZWNlaXZlciBhY2NvdW50IG5hbWUKICAgICAgICBqc29uCiAgICAgICAgZGJPcHMgeyBvcGVyYXRpb24gb2xkSlNPTiB7IG9iamVjdCBlcnJvciB9IG5ld0pTT04geyBvYmplY3QgZXJyb3IgfSB9CiAgICAgICAgZHRyeE9wcyB7IG9wZXJhdGlvbiBwYXllciB0cmFuc2FjdGlvbiB7IGFjdGlvbnMgeyBhY2NvdW50IG5hbWUganNvbiB9IH0gfQogICAgICAgIHJhbU9wcyB7IG9wZXJhdGlvbiBkZWx0YSB1c2FnZSB9CiAgICAgIH0KICAgIH0KICB9Cn0=" >}} and press the play button in the top bar of the page. {{}} The `"accounts": "eosio.token|tethertether"` argument in `get_action_traces` becomes the @@ -185,7 +185,7 @@ GraphQL, you have the power to pick and choose the exact field you want to recei drastically shaving bandwidth cost in most usual cases. We will not provide a 1 to 1 mapping list as it would be too much. You can use the -{{< external-link title="GraphiQL Online Editor" href="https://mainnet.eos.dfuse.io/graphiql/?query=c3Vic2NyaXB0aW9uICgkY3Vyc29yOiBTdHJpbmcpIHsKICBzZWFyY2hUcmFuc2FjdGlvbnNGb3J3YXJkKAogICAgcXVlcnk6ICIoYWNjb3VudDplb3Npby50b2tlbiBPUiBhY2NvdW50OnRoZXRlcnRoZXRlcikgKGFjdGlvbjp0cmFuc2ZlciBPUiBhY3Rpb246aXNzdWUpIiwKICAgIGN1cnNvcjogJGN1cnNvciwKICAgIGxpbWl0OiAxLAogICkgewogICAgdW5kbyBjdXJzb3IKICAgIGJsb2NrIHsgbnVtIGlkIH0KICAgIHRyYWNlIHsKICAgICAgaWQKICAgICAgbWF0Y2hpbmdBY3Rpb25zIHsKICAgICAgICBzZXEKICAgICAgICByZWNlaXZlciBhY2NvdW50IG5hbWUKICAgICAgICBqc29uCiAgICAgICAgZGJPcHMgeyBvcGVyYXRpb24gb2xkSlNPTiB7IG9iamVjdCBlcnJvciB9IG5ld0pTT04geyBvYmplY3QgZXJyb3IgfSB9CiAgICAgICAgZHRyeE9wcyB7IG9wZXJhdGlvbiBwYXllciB0cmFuc2FjdGlvbiB7IGFjdGlvbnMgeyBhY2NvdW50IG5hbWUganNvbiB9IH0gfQogICAgICAgIHJhbU9wcyB7IG9wZXJhdGlvbiBkZWx0YSB1c2FnZSB9CiAgICAgIH0KICAgIH0KICB9Cn0=" >}}, link and start from there, then slowly add (or remove) the fields you interested in. +{{< external-link title="GraphiQL Online Editor" href="https://testnet.eos.dfuse.io/graphiql/?query=c3Vic2NyaXB0aW9uICgkY3Vyc29yOiBTdHJpbmcpIHsKICBzZWFyY2hUcmFuc2FjdGlvbnNGb3J3YXJkKAogICAgcXVlcnk6ICIoYWNjb3VudDplb3Npby50b2tlbiBPUiBhY2NvdW50OnRoZXRlcnRoZXRlcikgKGFjdGlvbjp0cmFuc2ZlciBPUiBhY3Rpb246aXNzdWUpIiwKICAgIGN1cnNvcjogJGN1cnNvciwKICAgIGxpbWl0OiAxLAogICkgewogICAgdW5kbyBjdXJzb3IKICAgIGJsb2NrIHsgbnVtIGlkIH0KICAgIHRyYWNlIHsKICAgICAgaWQKICAgICAgbWF0Y2hpbmdBY3Rpb25zIHsKICAgICAgICBzZXEKICAgICAgICByZWNlaXZlciBhY2NvdW50IG5hbWUKICAgICAgICBqc29uCiAgICAgICAgZGJPcHMgeyBvcGVyYXRpb24gb2xkSlNPTiB7IG9iamVjdCBlcnJvciB9IG5ld0pTT04geyBvYmplY3QgZXJyb3IgfSB9CiAgICAgICAgZHRyeE9wcyB7IG9wZXJhdGlvbiBwYXllciB0cmFuc2FjdGlvbiB7IGFjdGlvbnMgeyBhY2NvdW50IG5hbWUganNvbiB9IH0gfQogICAgICAgIHJhbU9wcyB7IG9wZXJhdGlvbiBkZWx0YSB1c2FnZSB9CiAgICAgIH0KICAgIH0KICB9Cn0=" >}}, link and start from there, then slowly add (or remove) the fields you interested in. {{< alert type="note" >}} The link above as a `limit: 1` parameter so the stream stops right after a match so it's easier to inspect the diff --git a/content/eosio/public-apis/reference/websocket/req-get-table-rows.md b/content/eosio/public-apis/reference/websocket/req-get-table-rows.md index f012b700..60b52394 100644 --- a/content/eosio/public-apis/reference/websocket/req-get-table-rows.md +++ b/content/eosio/public-apis/reference/websocket/req-get-table-rows.md @@ -156,9 +156,9 @@ subscription ($cursor: String) { {{< /highlight >}} {{< alert type="note" >}} -Eager to try out the document above? Head down straight to our {{< external-link title="GraphiQL Online Editor" href="https://mainnet.eos.dfuse.io/graphiql/?query=c3Vic2NyaXB0aW9uICgkY3Vyc29yOiBTdHJpbmcpIHsKICBzZWFyY2hUcmFuc2FjdGlvbnNGb3J3YXJkKAogICAgcXVlcnk6ICJyZWNlaXZlcjplb3Npby50b2tlbiBkYi50YWJsZTphY2NvdW50cy9lb3NjYW5hZGFjb20iLAogICAgY3Vyc29yOiAkY3Vyc29yLAogICkgewogICAgdW5kbyBjdXJzb3IKICAgIGJsb2NrIHsgbnVtIGlkIH0KICAgIHRyYWNlIHsKICAgICAgbWF0Y2hpbmdBY3Rpb25zIHsKICAgICAgICBleGVjdXRpb25JbmRleAogICAgICAgIGRiT3BzKGNvZGU6ICJlb3Npby50b2tlbiIsIHRhYmxlOiAiYWNjb3VudHMiKSB7CiAgICAgICAgICBvcGVyYXRpb24KICAgICAgICAgIGtleSB7IGNvZGUgdGFibGUgc2NvcGUga2V5IH0KICAgICAgICAgIG9sZFBheWVyIG5ld1BheWVyCiAgICAgICAgICBvbGRKU09OIHsgb2JqZWN0IGVycm9yIH0KICAgICAgICAgIG5ld0pTT04geyBvYmplY3QgZXJyb3IgfQogICAgICAgIH0KICAgICAgfQogICAgfQogIH0KfQ==" >}} and press the play button in the top bar of the page. +Eager to try out the document above? Head down straight to our {{< external-link title="GraphiQL Online Editor" href="https://testnet.eos.dfuse.io/graphiql/?query=c3Vic2NyaXB0aW9uICgkY3Vyc29yOiBTdHJpbmcpIHsKICBzZWFyY2hUcmFuc2FjdGlvbnNGb3J3YXJkKAogICAgcXVlcnk6ICJyZWNlaXZlcjplb3Npby50b2tlbiBkYi50YWJsZTphY2NvdW50cy9lb3NjYW5hZGFjb20iLAogICAgY3Vyc29yOiAkY3Vyc29yLAogICkgewogICAgdW5kbyBjdXJzb3IKICAgIGJsb2NrIHsgbnVtIGlkIH0KICAgIHRyYWNlIHsKICAgICAgbWF0Y2hpbmdBY3Rpb25zIHsKICAgICAgICBleGVjdXRpb25JbmRleAogICAgICAgIGRiT3BzKGNvZGU6ICJlb3Npby50b2tlbiIsIHRhYmxlOiAiYWNjb3VudHMiKSB7CiAgICAgICAgICBvcGVyYXRpb24KICAgICAgICAgIGtleSB7IGNvZGUgdGFibGUgc2NvcGUga2V5IH0KICAgICAgICAgIG9sZFBheWVyIG5ld1BheWVyCiAgICAgICAgICBvbGRKU09OIHsgb2JqZWN0IGVycm9yIH0KICAgICAgICAgIG5ld0pTT04geyBvYmplY3QgZXJyb3IgfQogICAgICAgIH0KICAgICAgfQogICAgfQogIH0KfQ==" >}} and press the play button in the top bar of the page. -Prefer to leverage rows changes for any scope of the `eosio.token/accounts` table directly? Simply use this query instead: `receiver: eosio.token db.table:accounts` ({{< external-link title="Try it out here!" href="https://mainnet.eos.dfuse.io/graphiql/?query=c3Vic2NyaXB0aW9uICgkY3Vyc29yOiBTdHJpbmcpIHsKICBzZWFyY2hUcmFuc2FjdGlvbnNGb3J3YXJkKAogICAgcXVlcnk6ICJyZWNlaXZlcjplb3Npby50b2tlbiBkYi50YWJsZTphY2NvdW50cyIsCiAgICBjdXJzb3I6ICRjdXJzb3IsCiAgKSB7CiAgICB1bmRvIGN1cnNvcgogICAgYmxvY2sgeyBudW0gaWQgfQogICAgdHJhY2UgewogICAgICBtYXRjaGluZ0FjdGlvbnMgewogICAgICAgIGV4ZWN1dGlvbkluZGV4CiAgICAgICAgZGJPcHMoY29kZTogImVvc2lvLnRva2VuIiwgdGFibGU6ICJhY2NvdW50cyIpIHsKICAgICAgICAgIG9wZXJhdGlvbgogICAgICAgICAga2V5IHsgY29kZSB0YWJsZSBzY29wZSBrZXkgfQogICAgICAgICAgb2xkUGF5ZXIgbmV3UGF5ZXIKICAgICAgICAgIG9sZEpTT04geyBvYmplY3QgZXJyb3IgfQogICAgICAgICAgbmV3SlNPTiB7IG9iamVjdCBlcnJvciB9CiAgICAgICAgfQogICAgICB9CiAgICB9CiAgfQp9" >}}) +Prefer to leverage rows changes for any scope of the `eosio.token/accounts` table directly? Simply use this query instead: `receiver: eosio.token db.table:accounts` ({{< external-link title="Try it out here!" href="https://testnet.eos.dfuse.io/graphiql/?query=c3Vic2NyaXB0aW9uICgkY3Vyc29yOiBTdHJpbmcpIHsKICBzZWFyY2hUcmFuc2FjdGlvbnNGb3J3YXJkKAogICAgcXVlcnk6ICJyZWNlaXZlcjplb3Npby50b2tlbiBkYi50YWJsZTphY2NvdW50cyIsCiAgICBjdXJzb3I6ICRjdXJzb3IsCiAgKSB7CiAgICB1bmRvIGN1cnNvcgogICAgYmxvY2sgeyBudW0gaWQgfQogICAgdHJhY2UgewogICAgICBtYXRjaGluZ0FjdGlvbnMgewogICAgICAgIGV4ZWN1dGlvbkluZGV4CiAgICAgICAgZGJPcHMoY29kZTogImVvc2lvLnRva2VuIiwgdGFibGU6ICJhY2NvdW50cyIpIHsKICAgICAgICAgIG9wZXJhdGlvbgogICAgICAgICAga2V5IHsgY29kZSB0YWJsZSBzY29wZSBrZXkgfQogICAgICAgICAgb2xkUGF5ZXIgbmV3UGF5ZXIKICAgICAgICAgIG9sZEpTT04geyBvYmplY3QgZXJyb3IgfQogICAgICAgICAgbmV3SlNPTiB7IG9iamVjdCBlcnJvciB9CiAgICAgICAgfQogICAgICB9CiAgICB9CiAgfQp9" >}}) {{}} The `"code": "eosio.token"` argument in `get_table_rows` becomes the `receiver: eosio.token` clause diff --git a/content/eosio/public-apis/tutorials/streaming-transactions.md b/content/eosio/public-apis/tutorials/streaming-transactions.md index 112e9051..4501d843 100644 --- a/content/eosio/public-apis/tutorials/streaming-transactions.md +++ b/content/eosio/public-apis/tutorials/streaming-transactions.md @@ -95,7 +95,7 @@ graphqlClient := pbgraphql.NewGraphQLClient(connection) - dfuse's GraphQL documentation can be found [here]({{< ref "/platform/public-apis/graphql" >}}). - dfuse's GraphQL EOSIO endpoints can be found [here]({{< ref "/eosio/public-apis/reference/graphql-api" >}}). - If you are not familiar with GraphQL, take a look at {{< external-link href="https://graphql.org/learn/" title="Introduction to GraphQL">}}. -- To help you construct your query visually and access our api documentation you can use {{< external-link href="https://mainnet.eos.dfuse.io/graphiql/" title="GraphiQL">}} — a graphical interactive in-browser GraphQL IDE. +- To help you construct your query visually and access our api documentation you can use {{< external-link href="https://testnet.eos.dfuse.io/graphiql/" title="GraphiQL">}} — a graphical interactive in-browser GraphQL IDE. ## Executing a Query {{< tabs "graphql-query" >}} @@ -133,7 +133,7 @@ This query `account:eosio.msig action:propose` will stream transactions containi Take a look at our [Search Query Language specs]({{< ref "/platform/public-apis/search-query-language" >}}) for complete documentation. ## Cursor and Block Numbers Management -Complete API documentation is accessible through {{< external-link href="https://mainnet.eos.dfuse.io/graphiql/" title="GraphiQL">}} +Complete API documentation is accessible through {{< external-link href="https://testnet.eos.dfuse.io/graphiql/" title="GraphiQL">}} - `lowBlockNum` parameter is the lower block number boundary, inclusively. A zero or negative value means a block relative to the head or last irreversible block (depending on if your query contains the `irreversibleOnly` flag). - `cursor` parameter is an opaque data piece that you can pass back to continue your search if it ever becomes disconnected. Retrieve it from the cursor field in the responses of this call. It is safe to use the same cursor in BOTH directions (forward and backward). diff --git a/content/eosio/public-apis/tutorials/writing-on-chain.md b/content/eosio/public-apis/tutorials/writing-on-chain.md index a8b8e369..46f1bd4f 100644 --- a/content/eosio/public-apis/tutorials/writing-on-chain.md +++ b/content/eosio/public-apis/tutorials/writing-on-chain.md @@ -178,7 +178,7 @@ extra environment variables: {{< highlight typescript >}} -export DFUSE_API_NETWORK="" +export DFUSE_API_NETWORK="" export TRANSFER_TO_ACCOUNT="" export TRANSFER_QUANTITY="" {{< /highlight >}} diff --git a/content/platform/public-apis/graphql.md b/content/platform/public-apis/graphql.md index 1d12b1f5..499da81c 100644 --- a/content/platform/public-apis/graphql.md +++ b/content/platform/public-apis/graphql.md @@ -236,7 +236,7 @@ See the {{< external-link title="Apollo Client Introduction" href="https://www.a List available gRPC methods with: {{< highlight shell >}} -grpcurl mainnet.eos.dfuse.io:443 list +grpcurl testnet.eos.dfuse.io:443 list {{< /highlight >}} Stream live search query responses: @@ -244,7 +244,7 @@ Stream live search query responses: {{< highlight shell >}} echo '{"query": "subscription { searchTransactionsForward(limit: 10, query: \"status:executed\") { cursor undo trace { id matchingActions { receiver account name json } } } }"}' \ | grpcurl -H "Authorization: Bearer $DFUSE_TOKEN" -d @ \ - mainnet.eos.dfuse.io:443 dfuse.eosio.v1.GraphQL/Execute + testnet.eos.dfuse.io:443 dfuse.eosio.v1.GraphQL/Execute {{< /highlight >}} For a nice output, install `jq` and pipe the previous command into: @@ -262,7 +262,7 @@ jq -r .data Launch `grpcui`: {{< highlight shell >}} -grpcui -port 6000 mainnet.eos.dfuse.io:443 +grpcui -port 6000 testnet.eos.dfuse.io:443 {{< /highlight >}} ### Using `grpcui` @@ -302,7 +302,7 @@ Search the blockchain forward for transaction execution traces based on the give Always consider the undo field in forward searches, which signal that the matching element was in fact removed from the chain due to a chain reorganization. {{< /alert >}} -{{< external-link title="Try it on GraphiQL" href="https://mainnet.eos.dfuse.io/graphiql/?query=c3Vic2NyaXB0aW9uIHsKICBzZWFyY2hUcmFuc2FjdGlvbnNGb3J3YXJkKHF1ZXJ5OiAicmVjZWl2ZXI6ZW9zaW8udG9rZW4gYWN0aW9uOnRyYW5zZmVyIikgewogICAgY3Vyc29yCiAgICB0cmFjZSB7CiAgICAgIGlkCiAgICAgIGJsb2NrIHsKICAgICAgICBudW0KICAgICAgICB0aW1lc3RhbXAKICAgICAgfQogICAgICBtYXRjaGluZ0FjdGlvbnMgewogICAgICAgIGFjY291bnQKICAgICAgICBuYW1lCiAgICAgICAgZGF0YQogICAgICB9CiAgICB9CiAgfQp9Cg==" >}} +{{< external-link title="Try it on GraphiQL" href="https://testnet.eos.dfuse.io/graphiql/?query=c3Vic2NyaXB0aW9uIHsKICBzZWFyY2hUcmFuc2FjdGlvbnNGb3J3YXJkKHF1ZXJ5OiAicmVjZWl2ZXI6ZW9zaW8udG9rZW4gYWN0aW9uOnRyYW5zZmVyIikgewogICAgY3Vyc29yCiAgICB0cmFjZSB7CiAgICAgIGlkCiAgICAgIGJsb2NrIHsKICAgICAgICBudW0KICAgICAgICB0aW1lc3RhbXAKICAgICAgfQogICAgICBtYXRjaGluZ0FjdGlvbnMgewogICAgICAgIGFjY291bnQKICAgICAgICBuYW1lCiAgICAgICAgZGF0YQogICAgICB9CiAgICB9CiAgfQp9Cg==" >}} *** @@ -314,7 +314,7 @@ Search the blockchain backward for transaction execution traces based on the giv The undo field is not used in a backward search. {{< /alert >}} -{{< external-link title="Try it on GraphiQL" href="https://mainnet.eos.dfuse.io/graphiql/?query=c3Vic2NyaXB0aW9uIHsKICBzZWFyY2hUcmFuc2FjdGlvbnNCYWNrd2FyZChxdWVyeTogInJlY2VpdmVyOmVvc2lvLnRva2VuIGFjdGlvbjp0cmFuc2ZlciIsIGxvd0Jsb2NrTnVtOiAtMzYwKSB7CiAgICBjdXJzb3IKICAgIHRyYWNlIHsKICAgICAgaWQKICAgICAgYmxvY2sgewogICAgICAgIG51bQogICAgICAgIHRpbWVzdGFtcAogICAgICB9CiAgICAgIG1hdGNoaW5nQWN0aW9ucyB7CiAgICAgICAgYWNjb3VudAogICAgICAgIG5hbWUKICAgICAgICBkYXRhCiAgICAgIH0KICAgIH0KICB9Cn0K" >}} +{{< external-link title="Try it on GraphiQL" href="https://testnet.eos.dfuse.io/graphiql/?query=c3Vic2NyaXB0aW9uIHsKICBzZWFyY2hUcmFuc2FjdGlvbnNCYWNrd2FyZChxdWVyeTogInJlY2VpdmVyOmVvc2lvLnRva2VuIGFjdGlvbjp0cmFuc2ZlciIsIGxvd0Jsb2NrTnVtOiAtMzYwKSB7CiAgICBjdXJzb3IKICAgIHRyYWNlIHsKICAgICAgaWQKICAgICAgYmxvY2sgewogICAgICAgIG51bQogICAgICAgIHRpbWVzdGFtcAogICAgICB9CiAgICAgIG1hdGNoaW5nQWN0aW9ucyB7CiAgICAgICAgYWNjb3VudAogICAgICAgIG5hbWUKICAgICAgICBkYXRhCiAgICAgIH0KICAgIH0KICB9Cn0K" >}} #### Queries @@ -326,7 +326,7 @@ Search the blockchain forward for transaction execution traces based on the give Always consider the undo field in forward searches, which signal that the matching element was in fact __REMOVED__ from the chain because of a chain reorganization. {{< /alert >}} -{{< external-link title="Try it on GraphiQL" href="https://mainnet.eos.dfuse.io/graphiql/?query=cXVlcnkgeyAKICBzZWFyY2hUcmFuc2FjdGlvbnNGb3J3YXJkKHF1ZXJ5OiAicmVjZWl2ZXI6ZW9zaW8udG9rZW4gYWN0aW9uOnRyYW5zZmVyIiwgbG93QmxvY2tOdW06IC0zNjAsIGxpbWl0OiAxMCkgeyAKICAgIHJlc3VsdHMgeyAKICAgICAgY3Vyc29yCiAgICAgIHRyYWNlIHsKICAgICAgICBpZAogICAgICAgIG1hdGNoaW5nQWN0aW9ucyB7IAogICAgICAgICAgYWNjb3VudAogICAgICAgICAgbmFtZQogICAgICAgICAgZGF0YQogICAgICAgIH0KICAgICAgfSAKICAgIH0gCiAgfQp9" >}} +{{< external-link title="Try it on GraphiQL" href="https://testnet.eos.dfuse.io/graphiql/?query=cXVlcnkgeyAKICBzZWFyY2hUcmFuc2FjdGlvbnNGb3J3YXJkKHF1ZXJ5OiAicmVjZWl2ZXI6ZW9zaW8udG9rZW4gYWN0aW9uOnRyYW5zZmVyIiwgbG93QmxvY2tOdW06IC0zNjAsIGxpbWl0OiAxMCkgeyAKICAgIHJlc3VsdHMgeyAKICAgICAgY3Vyc29yCiAgICAgIHRyYWNlIHsKICAgICAgICBpZAogICAgICAgIG1hdGNoaW5nQWN0aW9ucyB7IAogICAgICAgICAgYWNjb3VudAogICAgICAgICAgbmFtZQogICAgICAgICAgZGF0YQogICAgICAgIH0KICAgICAgfSAKICAgIH0gCiAgfQp9" >}} *** @@ -334,7 +334,7 @@ Always consider the undo field in forward searches, which signal that the matchi Search the blockchain backward for transaction execution traces based on the given query. When the returned cursor is empty, it means you have reached the end of the specified block range. -{{< external-link title="Try it on GraphiQL" href="https://mainnet.eos.dfuse.io/graphiql/?query=cXVlcnkgeyAKICBzZWFyY2hUcmFuc2FjdGlvbnNCYWNrd2FyZChxdWVyeTogInJlY2VpdmVyOmVvc2lvLnRva2VuIGFjdGlvbjp0cmFuc2ZlciIsIGxpbWl0OiAxMCkgeyAKICAgIHJlc3VsdHMgeyAKICAgICAgY3Vyc29yCiAgICAgIHRyYWNlIHsKICAgICAgICBpZAogICAgICAgIG1hdGNoaW5nQWN0aW9ucyB7IAogICAgICAgICAgYWNjb3VudAogICAgICAgICAgbmFtZQogICAgICAgICAgZGF0YQogICAgICAgIH0KICAgICAgfSAKICAgIH0gCiAgfQp9" >}} +{{< external-link title="Try it on GraphiQL" href="https://testnet.eos.dfuse.io/graphiql/?query=cXVlcnkgeyAKICBzZWFyY2hUcmFuc2FjdGlvbnNCYWNrd2FyZChxdWVyeTogInJlY2VpdmVyOmVvc2lvLnRva2VuIGFjdGlvbjp0cmFuc2ZlciIsIGxpbWl0OiAxMCkgeyAKICAgIHJlc3VsdHMgeyAKICAgICAgY3Vyc29yCiAgICAgIHRyYWNlIHsKICAgICAgICBpZAogICAgICAgIG1hdGNoaW5nQWN0aW9ucyB7IAogICAgICAgICAgYWNjb3VudAogICAgICAgICAgbmFtZQogICAgICAgICAgZGF0YQogICAgICAgIH0KICAgICAgfSAKICAgIH0gCiAgfQp9" >}} *** @@ -342,7 +342,7 @@ Search the blockchain backward for transaction execution traces based on the giv Return the block ID found around the given `time`, based on the comparator provided. -{{< external-link title="Try it on GraphiQL Sample" href="https://mainnet.eos.dfuse.io/graphiql/?query=ewogIGJsb2NrSURCeVRpbWUodGltZTogIjIwMTktMDYtMjRUMDU6MzU6NDVaIiwgY29tcGFyYXRvcjogR1RFKSB7CiAgICBpZAogICAgbnVtCiAgICB0aW1lCiAgfQp9Cg==" >}} +{{< external-link title="Try it on GraphiQL Sample" href="https://testnet.eos.dfuse.io/graphiql/?query=ewogIGJsb2NrSURCeVRpbWUodGltZTogIjIwMTktMDYtMjRUMDU6MzU6NDVaIiwgY29tcGFyYXRvcjogR1RFKSB7CiAgICBpZAogICAgbnVtCiAgICB0aW1lCiAgfQp9Cg==" >}} ## Sample Queries @@ -351,7 +351,7 @@ To get you started, here are a few sample queries and how to read them. ### Streaming Transactions -The following query (try it on {{< external-link href="https://mainnet.eos.dfuse.io/graphiql/?query=c3Vic2NyaXB0aW9uIHsKICBzZWFyY2hUcmFuc2FjdGlvbnNGb3J3YXJkKAogICAgcXVlcnk6InJlY2VpdmVyOmVvc2lvLnRva2VuIGFjY291bnQ6ZW9zaW8udG9rZW4gYWN0aW9uOnRyYW5zZmVyIiwKICAgIGxvd0Jsb2NrTnVtOjAsCiAgICBsaW1pdDoyMCwKICApIHsKICAgIHVuZG8KICAgIGN1cnNvcgogICAgdHJhY2UgewogICAgICBpZAogICAgICBtYXRjaGluZ0FjdGlvbnMgewogICAgICAgIHJlY2VpdmVyCiAgICAgICAgYWNjb3VudAogICAgICAgIG5hbWUKICAgICAgICBqc29uCiAgICAgICAgY3JlYXRvckFjdGlvbiB7CiAgICAgICAgICByZWNlaXZlcgogICAgICAgICAgYWNjb3VudAogICAgICAgICAgbmFtZQogICAgICAgICAganNvbgogICAgICAgIH0KICAgICAgfQogICAgfQogIH0KfQ==" title="GraphiQL">}}): +The following query (try it on {{< external-link href="https://testnet.eos.dfuse.io/graphiql/?query=c3Vic2NyaXB0aW9uIHsKICBzZWFyY2hUcmFuc2FjdGlvbnNGb3J3YXJkKAogICAgcXVlcnk6InJlY2VpdmVyOmVvc2lvLnRva2VuIGFjY291bnQ6ZW9zaW8udG9rZW4gYWN0aW9uOnRyYW5zZmVyIiwKICAgIGxvd0Jsb2NrTnVtOjAsCiAgICBsaW1pdDoyMCwKICApIHsKICAgIHVuZG8KICAgIGN1cnNvcgogICAgdHJhY2UgewogICAgICBpZAogICAgICBtYXRjaGluZ0FjdGlvbnMgewogICAgICAgIHJlY2VpdmVyCiAgICAgICAgYWNjb3VudAogICAgICAgIG5hbWUKICAgICAgICBqc29uCiAgICAgICAgY3JlYXRvckFjdGlvbiB7CiAgICAgICAgICByZWNlaXZlcgogICAgICAgICAgYWNjb3VudAogICAgICAgICAgbmFtZQogICAgICAgICAganNvbgogICAgICAgIH0KICAgICAgfQogICAgfQogIH0KfQ==" title="GraphiQL">}}): * `subscription` prefix - Issues a GraphQL subscription call (streaming results). * `query:"receiver:eosio.token account:eosio.token action:transfer"` - The query utilizing the {{< external-link title="dfuse Search Query Language" href="/platform/public-apis/search-query-language" >}} that you would like responses to match. This query requests responses for `transfer` actions on the `eosio.token` smart contract. @@ -425,7 +425,7 @@ subscription { ### Multiple GraphQL queries in one request: -The following query (try it on {{< external-link title="GraphiQL" href="https://mainnet.eos.dfuse.io/graphiql/?query=ewogIHN0YXJ0OiBibG9ja0lEQnlUaW1lKHRpbWU6ICIyMDE5LTAxLTAxVDAwOjAwOjAwWiIpIHsKICAgIHRpbWUKICAgIG51bQogICAgaWQKICB9CiAgZW5kOiBibG9ja0lEQnlUaW1lKHRpbWU6ICIyMDE5LTAyLTAxVDAwOjAwOjAwWiIpIHsKICAgIHRpbWUKICAgIG51bQogICAgaWQKICB9Cn0K)" >}}): +The following query (try it on {{< external-link title="GraphiQL" href="https://testnet.eos.dfuse.io/graphiql/?query=ewogIHN0YXJ0OiBibG9ja0lEQnlUaW1lKHRpbWU6ICIyMDE5LTAxLTAxVDAwOjAwOjAwWiIpIHsKICAgIHRpbWUKICAgIG51bQogICAgaWQKICB9CiAgZW5kOiBibG9ja0lEQnlUaW1lKHRpbWU6ICIyMDE5LTAyLTAxVDAwOjAwOjAwWiIpIHsKICAgIHRpbWUKICAgIG51bQogICAgaWQKICB9Cn0K)" >}}): * Issues a GraphQL _query_ that retrieves responses for two queries at once * Each querying the block ID and number less than or equal to the date specified in `time`. diff --git a/data/examples.json b/data/examples.json index c1d0b682..0fab568e 100644 --- a/data/examples.json +++ b/data/examples.json @@ -3,14 +3,14 @@ "quickstarts_go_eos_section2": "func getToken(apiKey string) (token string, expiration time.Time, err error) {\n\treqBody := bytes.NewBuffer([]byte(fmt.Sprintf(`{\"api_key\":\"%s\"}`, apiKey)))\n\tresp, err := http.Post(\"https://auth.dfuse.io/v1/auth/issue\", \"application/json\", reqBody)\n\tif err != nil {\n\t\terr = fmt.Errorf(\"unable to obtain token: %s\", err)\n\t\treturn\n\t}\n\n\tif resp.StatusCode != 200 {\n\t\terr = fmt.Errorf(\"unable to obtain token, status not 200, got %d: %s\", resp.StatusCode, reqBody.String())\n\t\treturn\n\t}\n\n\tif body, err := ioutil.ReadAll(resp.Body); err == nil {\n\t\ttoken = gjson.GetBytes(body, \"token\").String()\n\t\texpiration = time.Unix(gjson.GetBytes(body, \"expires_at\").Int(), 0)\n\t}\n\treturn\n}\n", "quickstarts_go_eos_section3": "func createClient(endpoint string) pb.GraphQLClient {\n\tdfuseAPIKey := os.Getenv(\"DFUSE_API_KEY\")\n\tif dfuseAPIKey == \"\" {\n\t\tpanic(\"you must specify a DFUSE_API_KEY environment variable\")\n\t}\n\n\ttoken, _, err := getToken(dfuseAPIKey)\n\tpanicIfError(err)\n\n\tcredential := oauth.NewOauthAccess(&oauth2.Token{AccessToken: token, TokenType: \"Bearer\"})\n\ttransportCreds := credentials.NewClientTLSFromCert(nil, \"\")\n\tconn, err := grpc.Dial(endpoint,\n\t\tgrpc.WithPerRPCCredentials(credential),\n\t\tgrpc.WithTransportCredentials(transportCreds),\n\t)\n\tpanicIfError(err)\n\n\treturn pb.NewGraphQLClient(conn)\n}\n", "quickstarts_go_eos_section4": "const operationEOS = `subscription {\n searchTransactionsForward(query:\"receiver:eosio.token action:transfer -data.quantity:'0.0001 EOS'\") {\n undo cursor\n trace { id matchingActions { json } }\n }\n}`\n\ntype eosioDocument struct {\n\tSearchTransactionsForward struct {\n\t\tCursor string\n\t\tUndo bool\n\t\tTrace struct {\n\t\t\tID string\n\t\t\tMatchingActions []struct {\n\t\t\t\tJSON map[string]interface{}\n\t\t\t}\n\t\t}\n\t}\n}\n", - "quickstarts_go_eos_section5": "func streamEOSIO(ctx context.Context) {\n\t/* The client can be re-used for all requests, cache it at the appropriate level */\n\tclient := createClient(\"mainnet.eos.dfuse.io:443\")\n\texecutor, err := client.Execute(ctx, &pb.Request{Query: operationEOS})\n\tpanicIfError(err)\n\n\tfor {\n\t\tresp, err := executor.Recv()\n\t\tpanicIfError(err)\n\n\t\tif len(resp.Errors) > 0 {\n\t\t\tfor _, err := range resp.Errors {\n\t\t\t\tfmt.Printf(\"Request failed: %s\\n\", err)\n\t\t\t}\n\n\t\t\t/* We continue here, but you could take another decision here, like exiting the process */\n\t\t\tcontinue\n\t\t}\n\n\t\tdocument := &eosioDocument{}\n\t\terr = json.Unmarshal([]byte(resp.Data), document)\n\t\tpanicIfError(err)\n\n\t\tresult := document.SearchTransactionsForward\n\t\treverted := \"\"\n\t\tif result.Undo {\n\t\t\treverted = \" REVERTED\"\n\t\t}\n\n\t\tfor _, action := range result.Trace.MatchingActions {\n\t\t\tdata := action.JSON\n\t\t\tfmt.Printf(\"Transfer %s -> %s [%s]%s\\n\", data[\"from\"], data[\"to\"], data[\"quantity\"], reverted)\n\t\t}\n\t}\n}\n", + "quickstarts_go_eos_section5": "func streamEOSIO(ctx context.Context) {\n\t/* The client can be re-used for all requests, cache it at the appropriate level */\n\tclient := createClient(\"testnet.eos.dfuse.io:443\")\n\texecutor, err := client.Execute(ctx, &pb.Request{Query: operationEOS})\n\tpanicIfError(err)\n\n\tfor {\n\t\tresp, err := executor.Recv()\n\t\tpanicIfError(err)\n\n\t\tif len(resp.Errors) > 0 {\n\t\t\tfor _, err := range resp.Errors {\n\t\t\t\tfmt.Printf(\"Request failed: %s\\n\", err)\n\t\t\t}\n\n\t\t\t/* We continue here, but you could take another decision here, like exiting the process */\n\t\t\tcontinue\n\t\t}\n\n\t\tdocument := &eosioDocument{}\n\t\terr = json.Unmarshal([]byte(resp.Data), document)\n\t\tpanicIfError(err)\n\n\t\tresult := document.SearchTransactionsForward\n\t\treverted := \"\"\n\t\tif result.Undo {\n\t\t\treverted = \" REVERTED\"\n\t\t}\n\n\t\tfor _, action := range result.Trace.MatchingActions {\n\t\t\tdata := action.JSON\n\t\t\tfmt.Printf(\"Transfer %s -> %s [%s]%s\\n\", data[\"from\"], data[\"to\"], data[\"quantity\"], reverted)\n\t\t}\n\t}\n}\n", "quickstarts_go_eos_section6": "func main() {\n\tproto := \"\"\n\tif len(os.Args) >= 2 {\n\t\tproto = os.Args[1]\n\t}\n\n\tswitch proto {\n\tcase \"ethereum\", \"ETH\":\n\t\tstreamEthereum(context.Background())\n\tdefault:\n\t\tstreamEOSIO(context.Background())\n\t}\n}\n\nfunc panicIfError(err error) {\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n", "quickstarts_go_ethereum_section1": "package main\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"net/http\"\n\t\"os\"\n\t\"time\"\n\n\tpb \"github.com/dfuse-io/docs/quickstarts/go/pb\"\n\n\t\"github.com/tidwall/gjson\"\n\t\"golang.org/x/oauth2\"\n\t\"google.golang.org/grpc\"\n\t\"google.golang.org/grpc/credentials\"\n\t\"google.golang.org/grpc/credentials/oauth\"\n)\n\nfunc main() {\n\n\tdfuseAPIKey := os.Getenv(\"DFUSE_API_KEY\")\n\tif dfuseAPIKey == \"\" || dfuseAPIKey == \"your dfuse api key here\" {\n\t\tpanic(\"you must specify a DFUSE_API_KEY environment variable\")\n\t}\n\n\ttoken, _, err := getToken(dfuseAPIKey)\n\tpanicIfError(err)\n\n\tclient := createClient(\"mainnet.eth.dfuse.io:443\", token)\n\n\tstreamEthereum(context.Background(), client)\n}\n\nfunc panicIfError(err error) {\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n", "quickstarts_go_ethereum_section2": "func getToken(apiKey string) (token string, expiration time.Time, err error) {\n\treqBody := bytes.NewBuffer([]byte(fmt.Sprintf(`{\"api_key\":\"%s\"}`, apiKey)))\n\tresp, err := http.Post(\"https://auth.dfuse.io/v1/auth/issue\", \"application/json\", reqBody)\n\tif err != nil {\n\t\terr = fmt.Errorf(\"unable to obtain token: %s\", err)\n\t\treturn\n\t}\n\n\tif resp.StatusCode != 200 {\n\t\terr = fmt.Errorf(\"unable to obtain token, status not 200, got %d: %s\", resp.StatusCode, reqBody.String())\n\t\treturn\n\t}\n\n\tif body, err := ioutil.ReadAll(resp.Body); err == nil {\n\t\ttoken = gjson.GetBytes(body, \"token\").String()\n\t\texpiration = time.Unix(gjson.GetBytes(body, \"expires_at\").Int(), 0)\n\t}\n\treturn\n}\n", "quickstarts_go_ethereum_section3": "func createClient(endpoint string, token string) pb.GraphQLClient {\n\n\tcredential := oauth.NewOauthAccess(&oauth2.Token{AccessToken: token, TokenType: \"Bearer\"})\n\ttransportCreds := credentials.NewClientTLSFromCert(nil, \"\")\n\tconn, err := grpc.Dial(endpoint,\n\t\tgrpc.WithPerRPCCredentials(credential),\n\t\tgrpc.WithTransportCredentials(transportCreds),\n\t)\n\tpanicIfError(err)\n\n\treturn pb.NewGraphQLClient(conn)\n}\n", "quickstarts_go_ethereum_section4": "const operationETH = `subscription {\n searchTransactions(indexName:CALLS, query:\"-value:0 type:call\", lowBlockNum: -1) {\n undo cursor\n node { hash matchingCalls { from to value(encoding:ETHER) } }\n }\n}`\n\ntype ethereumDocument struct {\n\tSearchTransactions struct {\n\t\tCursor string\n\t\tUndo bool\n\t\tNode struct {\n\t\t\tHash string\n\t\t\tMatchingCalls []struct {\n\t\t\t\tFrom string\n\t\t\t\tTo string\n\t\t\t\tValue string\n\t\t\t}\n\t\t}\n\t}\n}\n", "quickstarts_go_ethereum_section5": "func streamEthereum(ctx context.Context, client pb.GraphQLClient) {\n\n\texecutor, err := client.Execute(ctx, &pb.Request{Query: operationETH})\n\tpanicIfError(err)\n\n\tfor {\n\t\tresp, err := executor.Recv()\n\t\tpanicIfError(err)\n\n\t\tif len(resp.Errors) > 0 {\n\t\t\tfor _, err := range resp.Errors {\n\t\t\t\tfmt.Printf(\"Request failed: %s\\n\", err)\n\t\t\t}\n\n\t\t\t/* We continue here, but you could take another decision here, like exiting the process */\n\t\t\tcontinue\n\t\t}\n\n\t\tdocument := ðereumDocument{}\n\t\terr = json.Unmarshal([]byte(resp.Data), document)\n\t\tpanicIfError(err)\n\n\t\tresult := document.SearchTransactions\n\t\treverted := \"\"\n\t\tif result.Undo {\n\t\t\treverted = \" REVERTED\"\n\t\t}\n\n\t\tfor _, call := range result.Node.MatchingCalls {\n\t\t\tfmt.Printf(\"Transfer %s -> %s [%s Ether]%s\\n\", call.From, call.To, call.Value, reverted)\n\t\t}\n\t}\n}\n", - "quickstarts_javascript_browser_eos_section1": "\n \n \n \n", + "quickstarts_javascript_browser_eos_section1": "\n \n \n \n", "quickstarts_javascript_browser_eos_section2": "", "quickstarts_javascript_browser_eos_section3": "", "quickstarts_javascript_browser_eos_section4": "", @@ -18,7 +18,7 @@ "quickstarts_javascript_browser_ethereum_section2": "", "quickstarts_javascript_browser_ethereum_section3": "", "quickstarts_javascript_browser_ethereum_section4": "", - "quickstarts_javascript_bundler_eos_section1": "import { createDfuseClient } from \"@dfuse/client\"\n\nconst client = createDfuseClient({\n apiKey: process.env.DFUSE_API_KEY,\n network: \"mainnet.eos.dfuse.io\",\n})", + "quickstarts_javascript_bundler_eos_section1": "import { createDfuseClient } from \"@dfuse/client\"\n\nconst client = createDfuseClient({\n apiKey: process.env.DFUSE_API_KEY,\n network: \"testnet.eos.dfuse.io\",\n})", "quickstarts_javascript_bundler_eos_section2": "// You must use a `$cursor` variable so stream starts back at last marked cursor on reconnect!\nconst operation = `subscription($cursor: String!) {\n searchTransactionsForward(query:\"receiver:eosio.token action:transfer -data.quantity:'0.0001 EOS'\", cursor: $cursor) {\n undo cursor\n trace { id matchingActions { json } }\n }\n}`", "quickstarts_javascript_bundler_eos_section3": "// You would normally use your framework entry point and render using components,\n// we are using pure HTML manipulation for sake of example simplicity.\nasync function main() {\n const stream = await client.graphql(operation, (message) => {\n if (message.type === \"data\") {\n const { undo, cursor, trace: { id, matchingActions }} = message.data.searchTransactionsForward\n matchingActions.forEach(({ json: { from, to, quantity } }) => {\n const paragraphNode = document.createElement(\"li\")\n paragraphNode.innerText = `Transfer ${from} -> ${to} [${quantity}]${undo ? \" REVERTED\" : \"\"}`\n\n document.body.prepend(paragraphNode)\n })\n\n // Mark stream at cursor location, on re-connect, we will start back at cursor\n stream.mark({ cursor })\n }\n\n if (message.type === \"error\") {\n const { errors, terminal } = message\n const paragraphNode = document.createElement(\"li\")\n paragraphNode.innerText = `An error occurred ${JSON.stringify({ errors, terminal })}`\n\n document.body.prepend(paragraphNode)\n }\n\n if (message.type === \"complete\") {\n const paragraphNode = document.createElement(\"li\")\n paragraphNode.innerText = \"Completed\"\n\n document.body.prepend(paragraphNode)\n }\n })\n\n // Waits until the stream completes, or forever\n await stream.join()\n await client.release()\n}", "quickstarts_javascript_bundler_eos_section4": "main().catch((error) => document.body.innerHTML = `

${error}

`)", @@ -26,7 +26,7 @@ "quickstarts_javascript_bundler_ethereum_section2": "// You must use a `$cursor` variable so stream starts back at last marked cursor on reconnect!\nconst operation = `subscription($cursor: String!) {\n searchTransactions(indexName:CALLS, query:\"-value:0 type:call\", lowBlockNum: -1, cursor: $cursor) {\n undo cursor\n node { hash matchingCalls { from to value(encoding:ETHER) } }\n }\n}`", "quickstarts_javascript_bundler_ethereum_section3": "// You would normally use your framework entry point and render using components,\n// we are using pure HTML manipulation for sake of example simplicity.\nasync function main() {\n const stream = await client.graphql(operation, (message) => {\n if (message.type === \"data\") {\n const { undo, cursor, node: { hash, value, matchingCalls }} = message.data.searchTransactions\n matchingCalls.forEach(({ from, to, value }) => {\n const paragraphNode = document.createElement(\"li\")\n paragraphNode.innerText = `Transfer ${from} -> ${to} [${value} Ether]${undo ? \" REVERTED\" : \"\"}`\n\n document.body.prepend(paragraphNode)\n })\n\n // Mark stream at cursor location, on re-connect, we will start back at cursor\n stream.mark({ cursor })\n }\n\n if (message.type === \"error\") {\n const { errors, terminal } = message\n const paragraphNode = document.createElement(\"li\")\n paragraphNode.innerText = `An error occurred ${JSON.stringify({ errors, terminal })}`\n\n document.body.prepend(paragraphNode)\n }\n\n if (message.type === \"complete\") {\n const paragraphNode = document.createElement(\"li\")\n paragraphNode.innerText = \"Completed\"\n\n document.body.prepend(paragraphNode)\n }\n })\n\n // Waits until the stream completes, or forever\n await stream.join()\n await client.release()\n}", "quickstarts_javascript_bundler_ethereum_section4": "main().catch((error) => document.body.innerHTML = `

${error}

`)", - "quickstarts_javascript_node_eos_section1": "const { createDfuseClient } = require('@dfuse/client');\n\nconst client = createDfuseClient({\n apiKey: process.env.DFUSE_API_KEY,\n network: 'mainnet.eos.dfuse.io'\n});", + "quickstarts_javascript_node_eos_section1": "const { createDfuseClient } = require('@dfuse/client');\n\nconst client = createDfuseClient({\n apiKey: process.env.DFUSE_API_KEY,\n network: 'testnet.eos.dfuse.io'\n});", "quickstarts_javascript_node_eos_section2": "// You must use a `$cursor` variable so stream starts back at last marked cursor on reconnect!\nconst operation = `subscription($cursor: String!) {\n searchTransactionsForward(query:\"receiver:eosio.token action:transfer -data.quantity:'0.0001 EOS'\", cursor: $cursor) {\n undo cursor\n trace { id matchingActions { json } }\n }\n}`;", "quickstarts_javascript_node_eos_section3": "async function main() {\n const stream = await client.graphql(operation, message => {\n if (message.type === 'data') {\n const {\n undo,\n cursor,\n trace: { id, matchingActions }\n } = message.data.searchTransactionsForward;\n matchingActions.forEach(({ json: { from, to, quantity } }) => {\n console.log(\n `Transfer ${from} -> ${to} [${quantity}]${undo ? ' REVERTED' : ''}`\n );\n });\n\n // Mark stream at cursor location, on re-connect, we will start back at cursor\n stream.mark({ cursor });\n }\n\n if (message.type === 'error') {\n console.log('An error occurred', message.errors, message.terminal);\n }\n\n if (message.type === 'complete') {\n console.log('Completed');\n }\n });\n\n // Waits until the stream completes, or forever\n await stream.join();\n await client.release();\n}", "quickstarts_javascript_node_eos_section4": "main().catch(error => console.log('Unexpected error', error));", @@ -44,14 +44,14 @@ "quickstarts_python_eos_section2": "def get_token(api_key):\n connection = HTTPSConnection(\"auth.dfuse.io\")\n connection.request('POST', '/v1/auth/issue', json.dumps({\"api_key\": api_key}), {'Content-type': 'application/json'})\n response = connection.getresponse()\n\n if response.status != 200:\n raise Exception(\" Status: %s reason: %s\" % (response.status, response.reason))\n\n token = json.loads(response.read().decode())['token']\n connection.close()\n\n return token", "quickstarts_python_eos_section3": "def create_client(endpoint):\n dfuse_api_key = os.environ.get(\"DFUSE_API_KEY\")\n if dfuse_api_key == None:\n raise Exception(\"you must specify a DFUSE_API_KEY environment variable\")\n\n channel = grpc.secure_channel(endpoint,\n credentials = grpc.composite_channel_credentials(\n grpc.ssl_channel_credentials(),\n grpc.access_token_call_credentials(get_token(dfuse_api_key))\n ))\n\n return graphql_pb2_grpc.GraphQLStub(channel)", "quickstarts_python_eos_section4": "OPERATION_EOS = \"\"\"subscription {\n searchTransactionsForward(query:\"receiver:eosio.token action:transfer\") {\n undo cursor\n trace { id matchingActions { json } }\n }\n}\"\"\"", - "quickstarts_python_eos_section5": "def stream_eosio():\n \t# The client can be re-used for all requests, cache it at the appropriate level\n client = create_client('mainnet.eos.dfuse.io:443')\n stream = client.Execute(Request(query = OPERATION_EOS))\n\n for rawResult in stream:\n if rawResult.errors:\n print(\"An error occurred\")\n print(rawResult.errors)\n else:\n result = json.loads(rawResult.data)\n for action in result['searchTransactionsForward']['trace']['matchingActions']:\n undo = result['searchTransactionsForward']['undo']\n data = action['json']\n print(\"Transfer %s -> %s [%s]%s\" % (data['from'], data['to'], data['quantity'], \" REVERTED\" if undo else \"\"))", + "quickstarts_python_eos_section5": "def stream_eosio():\n \t# The client can be re-used for all requests, cache it at the appropriate level\n client = create_client('testnet.eos.dfuse.io:443')\n stream = client.Execute(Request(query = OPERATION_EOS))\n\n for rawResult in stream:\n if rawResult.errors:\n print(\"An error occurred\")\n print(rawResult.errors)\n else:\n result = json.loads(rawResult.data)\n for action in result['searchTransactionsForward']['trace']['matchingActions']:\n undo = result['searchTransactionsForward']['undo']\n data = action['json']\n print(\"Transfer %s -> %s [%s]%s\" % (data['from'], data['to'], data['quantity'], \" REVERTED\" if undo else \"\"))", "quickstarts_python_eos_section6": "# DFUSE_API_KEY=\"server_abcdef12345678900000000000\" python main.py eosio|ethereum\nproto = \"\"\nif len(sys.argv) > 1:\n proto = sys.argv[1].lower()\n\nif proto == \"ethereum\" or proto == \"ETH\":\n stream_ethereum()\nelse:\n stream_eosio()", "tutorials_eos_push-guaranteed_section1": "import { Api, JsonRpc } from \"eosjs\"\nimport { JsSignatureProvider } from \"eosjs/dist/eosjs-jssig\"\nimport { TextDecoder, TextEncoder } from \"text-encoding\"", "tutorials_eos_push-guaranteed_section2": "import fetch, { Request, RequestInit, Response } from \"node-fetch\"", "tutorials_eos_push-guaranteed_section3": "import { createDfuseClient } from \"@dfuse/client\"\n;(global as any).fetch = fetch\n;(global as any).WebSocket = {}\n\nconst config = readConfig()\nconst client = createDfuseClient({ apiKey: config.dfuseApiKey, network: config.network })", "tutorials_eos_push-guaranteed_section4": "const customizedFetch = async (input?: string | Request, init?: RequestInit): Promise => {\n if (init === undefined) {\n init = {}\n }\n\n if (init.headers === undefined) {\n init.headers = {}\n }\n\n // This is highly optimized and cached, so while the token is fresh, this is very fast\n const apiTokenInfo = await client.getTokenInfo()\n\n const headers = init.headers as { [name: string]: string }\n headers[\"Authorization\"] = `Bearer ${apiTokenInfo.token}`\n headers[\"X-Eos-Push-Guarantee\"] = config.guaranteed\n\n return fetch(input!, init)\n}", "tutorials_eos_push-guaranteed_section5": "async function main() {\n const signatureProvider = new JsSignatureProvider([config.privateKey])\n const rpc = new JsonRpc(client.endpoints.restUrl, { fetch: customizedFetch as any })\n const api = new Api({\n rpc,\n signatureProvider,\n textDecoder: new TextDecoder(),\n textEncoder: new TextEncoder()\n })\n\n const transferAction = {\n account: \"eosio.token\",\n name: \"transfer\",\n authorization: [\n {\n actor: config.transferFrom,\n permission: \"active\"\n }\n ],\n data: {\n from: config.transferFrom,\n to: config.transferTo,\n quantity: config.transferQuantity,\n memo: `Transaction with push guaranteed '${\n config.guaranteed\n }' from dfuse (https://docs.dfuse.io/#rest-api-post-push_transaction)`\n }\n }\n\n console.log(\"Transfer action\", prettyJson(transferAction))\n\n const startTime = new Date()\n const result = await api.transact(\n { actions: [transferAction] },\n {\n blocksBehind: 360,\n expireSeconds: 3600\n }\n )\n const endTime = new Date()\n\n printResult(result, startTime, endTime)\n}", - "tutorials_eos_push-guaranteed_section6": "function readConfig() {\n const network = process.env.DFUSE_API_NETWORK || \"kylin.eos.dfuse.io\"\n const guaranteed = process.env.PUSH_GUARANTEED || \"in-block\" // Or \"irreversible\", \"handoff:1\", \"handoffs:2\", \"handoffs:3\"\n const transferTo = process.env.TRANSFER_TO_ACCOUNT || \"eoscanadacom\"\n const transferQuantity = process.env.TRANSFER_QUANTITY || \"0.0001 EOS\"\n\n const dfuseApiKey = process.env.DFUSE_API_KEY\n if (dfuseApiKey === undefined) {\n console.log(\n \"You must have a 'process.env.DFUSE_API_KEY' environment variable containing your dfuse API key.\"\n )\n process.exit(1)\n }\n\n const privateKey = process.env.SIGNING_PRIVATE_KEY\n if (privateKey === undefined) {\n console.log(\n \"You must have a 'SIGNING_PRIVATE_KEY' environment variable containing private used to sign.\"\n )\n process.exit(1)\n }\n\n const transferFrom = process.env.TRANSFER_FROM_ACCOUNT\n if (transferFrom === undefined) {\n console.log(\n \"You must have a 'TRANSFER_FROM_ACCOUNT' environment variable containing account that is going to send token.\"\n )\n process.exit(1)\n }\n\n return {\n network,\n guaranteed,\n dfuseApiKey: dfuseApiKey!,\n privateKey: privateKey!,\n transferFrom: transferFrom!,\n transferTo,\n transferQuantity\n }\n}\n\nfunction printResult(result: any, startTime: Date, endTime: Date) {\n console.log(\"Transaction push result\", prettyJson(result))\n console.log()\n\n const elapsed = (endTime.getTime() - startTime.getTime()) / 1000.0\n console.log(`Pushed with guarenteed '${config.guaranteed}' in '${elapsed}' seconds`)\n\n const networkMatch = client.endpoints.restUrl.match(\n /https:\\/\\/(mainnet|testnet|kylin).eos.dfuse.io/\n )\n if (networkMatch !== null && networkMatch[1] != null) {\n let network = networkMatch[1] + \".\"\n if (network === \"mainnet\") {\n network = \"\"\n }\n\n console.log(` - https://${network}eosq.app/tx/${result.transaction_id}`)\n }\n}\n\nfunction prettyJson(input: any): string {\n return JSON.stringify(input, null, 2)\n}\n\nmain()\n .then(() => {\n process.exit(0)\n })\n .catch((error) => {\n console.log(\"An error occurred.\", prettyJson(error))\n process.exit(1)\n })", + "tutorials_eos_push-guaranteed_section6": "function readConfig() {\n const network = process.env.DFUSE_API_NETWORK || \"kylin.eos.dfuse.io\"\n const guaranteed = process.env.PUSH_GUARANTEED || \"in-block\" // Or \"irreversible\", \"handoff:1\", \"handoffs:2\", \"handoffs:3\"\n const transferTo = process.env.TRANSFER_TO_ACCOUNT || \"eoscanadacom\"\n const transferQuantity = process.env.TRANSFER_QUANTITY || \"0.0001 EOS\"\n\n const dfuseApiKey = process.env.DFUSE_API_KEY\n if (dfuseApiKey === undefined) {\n console.log(\n \"You must have a 'process.env.DFUSE_API_KEY' environment variable containing your dfuse API key.\"\n )\n process.exit(1)\n }\n\n const privateKey = process.env.SIGNING_PRIVATE_KEY\n if (privateKey === undefined) {\n console.log(\n \"You must have a 'SIGNING_PRIVATE_KEY' environment variable containing private used to sign.\"\n )\n process.exit(1)\n }\n\n const transferFrom = process.env.TRANSFER_FROM_ACCOUNT\n if (transferFrom === undefined) {\n console.log(\n \"You must have a 'TRANSFER_FROM_ACCOUNT' environment variable containing account that is going to send token.\"\n )\n process.exit(1)\n }\n\n return {\n network,\n guaranteed,\n dfuseApiKey: dfuseApiKey!,\n privateKey: privateKey!,\n transferFrom: transferFrom!,\n transferTo,\n transferQuantity\n }\n}\n\nfunction printResult(result: any, startTime: Date, endTime: Date) {\n console.log(\"Transaction push result\", prettyJson(result))\n console.log()\n\n const elapsed = (endTime.getTime() - startTime.getTime()) / 1000.0\n console.log(`Pushed with guarenteed '${config.guaranteed}' in '${elapsed}' seconds`)\n\n const networkMatch = client.endpoints.restUrl.match(\n /https:\\/\\/(testnet|kylin).eos.dfuse.io/\n )\n if (networkMatch !== null && networkMatch[1] != null) {\n let network = networkMatch[1] + \".\"\n if (network === \"testnet\") {\n network = \"\"\n }\n\n console.log(` - https://${network}eosq.app/tx/${result.transaction_id}`)\n }\n}\n\nfunction prettyJson(input: any): string {\n return JSON.stringify(input, null, 2)\n}\n\nmain()\n .then(() => {\n process.exit(0)\n })\n .catch((error) => {\n console.log(\"An error occurred.\", prettyJson(error))\n process.exit(1)\n })", "tutorials_eth_lifecycle_css_section1": ".App {\n text-align: left;\n width:1080px;\n margin:auto auto;\n display: flex;\n flex-direction: row;\n}\n\n.App .form {\n padding-top:50px;\n\n text-align: center;\n}\n\n.App .data {\n padding:50px;\n width: 100%;\n}\n\n.App .data pre {\n padding:10px;\n white-space: pre-wrap;\n white-space: -moz-pre-wrap;\n white-space: -o-pre-wrap;\n word-wrap: break-word;\n}\n\n\n.trx-id {\n padding: 18.5px 14px;\n height: 1.1875em;\n background: none;\n box-sizing: content-box;\n border:thin #878787 solid;\n width:300px;\n margin-bottom:10px;\n}\n\n.submit {\n color: #fff;\n height: 40px;\n font-size: 16px;\n box-shadow: none;\n line-height: 16px;\n padding-top: 10px;\n padding-left: 40px;\n border-radius: 20px;\n padding-right: 40px;\n padding-bottom: 10px;\n text-transform: none;\n background-color: #ff4660;\n}\n\n.transition {\n padding:7px;\n border-radius: 2px;\n background: #f8f8fa;\n border: thin solid #f8f9fa;\n margin-top: 10px;\n margin-bottom: 10px;\n\n}\n.error {\n color: #721c24;\n background-color: #f8d7da;\n border-color: #f5c6cb;\n padding:20px;\n width: 100%;\n}\n\n.state {\n color: #fff;\n background-color: #17a2b8;\n display: inline-block;\n padding: .25em .4em;\n font-size: 75%;\n font-weight: 700;\n line-height: 1;\n text-align: center;\n white-space: nowrap;\n vertical-align: baseline;\n border-radius: .25rem;\n}", "tutorials_eth_lifecycle_js_section1": "import React, { useState } from 'react';\nimport { createDfuseClient } from \"@dfuse/client\"\nimport './App.css';\nfunction App() { const dfuseClient = createDfuseClient({\n apiKey: \"\",\n network: \"mainnet.eth.dfuse.io\"\n }); let streamTransactionQuery = `\n subscription($hash: String!){\n transactionLifecycle(hash: $hash){\n previousState\n currentState\n transitionName\n transition{\n __typename\n\n ... on TrxTransitionInit {\n transaction {\n ...TransactionFragment\n }\n blockHeader {\n ...BlockHeaderFragment\n }\n trace {\n ...TransactionTraceFragment\n }\n confirmations\n replacedById\n }\n\n ...on TrxTransitionPooled {\n transaction {\n ...TransactionFragment\n }\n }\n\n ...on TrxTransitionMined {\n blockHeader {\n ...BlockHeaderFragment\n }\n trace {\n ...TransactionTraceFragment\n }\n confirmations\n }\n\n ...on TrxTransitionForked {\n transaction {\n ...TransactionFragment\n }\n }\n\n ...on TrxTransitionConfirmed {\n confirmations\n }\n\n ...on TrxTransitionReplaced {\n replacedById\n }\n\n }\n }\n }\n\n fragment TransactionFragment on Transaction {\n hash\n from\n to\n nonce\n gasPrice\n gasLimit\n value\n inputData\n signature {\n v\n s\n r\n }\n }\n\n fragment TransactionTraceFragment on TransactionTrace {\n hash\n from\n to\n nonce\n gasPrice\n gasLimit\n value\n inputData\n signature {\n v\n s\n r\n }\n cumulativeGasUsed\n publicKey\n index\n create\n outcome\n }\n\n fragment BlockHeaderFragment on BlockHeader {\n parentHash\n unclesHash\n coinbase\n stateRoot\n transactionsRoot\n receiptRoot\n logsBloom\n difficulty\n number\n gasLimit\n gasUsed\n timestamp\n extraData\n mixHash\n nonce\n hash\n }`; const [transactionHash, setTransactionHash] = useState('');\n const [transitions, setTransitions] = useState([]);\n const [state, setState] = useState(\"initialize\");\n const [error, setError] = useState(\"\"); async function fetchTransaction() {\n setState(\"streaming\");\n setError(\"\");\n setTransitions([]);\n var currentTransitions = [];\n var count = 0;\n\n const stream = await dfuseClient.graphql(streamTransactionQuery, (message) => {\n\n if (message.type === \"error\") {\n setError(message.errors[0]['message'])\n }\n\n if (message.type === \"data\") {\n var newTransition = {\n key: `transition-${count}`,\n transition: message['data']['transactionLifecycle']['transitionName'],\n from: message['data']['transactionLifecycle']['previousState'],\n to: message['data']['transactionLifecycle']['currentState'],\n data: message['data']\n };\n count++;\n currentTransitions = [...currentTransitions, newTransition]\n setTransitions(currentTransitions.reverse());\n }\n\n if (message.type === \"complete\") {\n setState(\"completed\");\n }\n },{\n variables: {\n hash: transactionHash\n }\n });\n\n await stream.join() // awaits stream completion, which is never for this operation\n } return (\n
\n
\n

Enter a transaction hash

\n setTransactionHash(e.target.value)} className={'trx-id'} />
\n \n
\n
\n { (error !== \"\") && (
{ error }
) }\n { (error === \"\") &&\n ((state === \"streaming\") || (state === \"completed\")) &&\n (\n
\n \n
\n {\n transitions.map((transition) => (\n
\n Transition: {transition.transition}
\n Previous State: {transition.from}
\n Current State: {transition.to}
\n
  { JSON.stringify(transition.data, null, 1) } 
\n
\n ))\n }\n
\n
\n )\n }\n { (state !== \"streaming\") &&\n (\n
Enter a transaction hash to begin
\n )\n }\n
\n
\n );\n}\nexport default App;", "tutorials_eth_lifecycle_js_section2": "import React, { useState } from 'react';\nimport { createDfuseClient } from \"@dfuse/client\"\nimport './App.css';", @@ -82,4 +82,4 @@ "tutorials_eth_stream_js_section6": " const onStop = async () => {\n setState('completed');\n if (stream === undefined) {\n return;\n }\n try {\n await stream.close();\n setStream(undefined);\n } catch (error) {\n setErrors(\n `Unable to disconnect socket correctly: \n ${JSON.stringify(error)}\n `\n );\n }\n };\n\n const onClose = () => {\n setState('completed');\n };\n\n const onError = error => {\n setErrors(\n `Unable to disconnect socket correctly: \n ${JSON.stringify(error)}\n `\n );\n };", "tutorials_eth_stream_js_section7": " const renderTransfer = (transfer, index) => {\n const { hash, from, to, value } = transfer;\n return hash ? (\n \n Transfer\n
\n {`From: ${from} -> To: ${to}`}\n
\n {`Value: ${value} Hash: ${hash}`}\n
\n
\n ) : (\n \n {transfer}\n \n );\n };\n\n const renderTransfers = () => {\n return (\n
\n {transfers.length <= 0\n ? renderTransfer('Nothing yet, start by hitting Launch!')\n : transfers.reverse().map(renderTransfer)}\n
\n );\n };\n\n const renderError = (error, index) => {\n if (error === '') {\n return
;\n }\n\n return (\n \n {error}\n \n );\n };\n\n const renderErrors = () => {\n if (errors.length <= 0) {\n return null;\n }\n\n return
{errors.map(renderError)}
;\n };\n\n return (\n
\n
\n

Stream Ethereum Transfers

\n {renderErrors()}\n
\n \n \n
\n
\n

\n {`Connected: ${\n state === 'connected'\n ? 'Connected (Showing last 100 transfers)'\n : 'Disconnected'\n }`}\n

\n {renderTransfers()}\n
\n
\n
\n );\n}", "tutorials_eth_stream_js_section8": "import React, { useState } from 'react';\nimport { createDfuseClient } from '@dfuse/client';\nimport './App.css';\nconst apiKey = process.env.REACT_APP_DFUSE_API_KEY;\nconst network = process.env.REACT_APP_DFUSE_NETWORK || 'mainnet.eth.dfuse.io';\n\nfunction App() { const dfuseClient = createDfuseClient({\n apiKey,\n network,\n streamClientOptions: {\n socketOptions: {\n onClose: onClose,\n onError: onError\n }\n }\n }); const streamTransfersQuery = `subscription($cursor: String) {\n searchTransactions(indexName: CALLS, query: \"-value:0\", sort: ASC, limit: 100, cursor: $cursor) {\n undo cursor\n node { hash from to value(encoding: ETHER) }\n }\n }`; const [transfers, setTransfers] = useState([]);\n const [state, setState] = useState('initialize');\n const [errors, setErrors] = useState([]);\n const [stream, setStream] = useState(undefined); const streamTransfers = async () => {\n setTransfers([]);\n setErrors([]);\n setState('connected');\n setErrors('');\n let currentTransfers = [];\n try {\n const stream = await dfuseClient.graphql(\n streamTransfersQuery,\n async message => {\n if (message.type === 'error') {\n setErrors([\n 'An error occurred',\n ...message.errors.map(error => error.message),\n ...errors\n ]);\n }\n\n if (message.type === 'data') {\n const {\n node: newTransfer,\n cursor\n } = message.data.searchTransactions;\n\n currentTransfers = [newTransfer, ...currentTransfers];\n setTransfers(currentTransfers);\n stream.mark({ cursor });\n }\n\n if (message.type === 'complete') {\n setState('completed');\n }\n }\n );\n setStream(stream);\n } catch (errors) {\n setErrors(JSON.stringify(errors));\n setState('completed');\n }\n }; const onStop = async () => {\n setState('completed');\n if (stream === undefined) {\n return;\n }\n try {\n await stream.close();\n setStream(undefined);\n } catch (error) {\n setErrors(\n `Unable to disconnect socket correctly: \n ${JSON.stringify(error)}\n `\n );\n }\n };\n\n const onClose = () => {\n setState('completed');\n };\n\n const onError = error => {\n setErrors(\n `Unable to disconnect socket correctly: \n ${JSON.stringify(error)}\n `\n );\n }; const renderTransfer = (transfer, index) => {\n const { hash, from, to, value } = transfer;\n return hash ? (\n \n Transfer\n
\n {`From: ${from} -> To: ${to}`}\n
\n {`Value: ${value} Hash: ${hash}`}\n
\n
\n ) : (\n \n {transfer}\n \n );\n };\n\n const renderTransfers = () => {\n return (\n
\n {transfers.length <= 0\n ? renderTransfer('Nothing yet, start by hitting Launch!')\n : transfers.reverse().map(renderTransfer)}\n
\n );\n };\n\n const renderError = (error, index) => {\n if (error === '') {\n return
;\n }\n\n return (\n \n {error}\n \n );\n };\n\n const renderErrors = () => {\n if (errors.length <= 0) {\n return null;\n }\n\n return
{errors.map(renderError)}
;\n };\n\n return (\n
\n
\n

Stream Ethereum Transfers

\n {renderErrors()}\n
\n \n \n
\n
\n

\n {`Connected: ${\n state === 'connected'\n ? 'Connected (Showing last 100 transfers)'\n : 'Disconnected'\n }`}\n

\n {renderTransfers()}\n
\n
\n
\n );\n}\nexport default App;" -} \ No newline at end of file +} diff --git a/quickstarts/go/main-eos.go b/quickstarts/go/main-eos.go index 283c111d..80c8fa44 100644 --- a/quickstarts/go/main-eos.go +++ b/quickstarts/go/main-eos.go @@ -155,7 +155,7 @@ type eosioDocument struct { // CODE:BEGIN:quickstarts_go_eos_section5 func streamEOSIO(ctx context.Context) { /* The client can be re-used for all requests, cache it at the appropriate level */ - client := createClient("mainnet.eos.dfuse.io:443") + client := createClient("testnet.eos.dfuse.io:443") executor, err := client.Execute(ctx, &pb.Request{Query: operationEOS}) panicIfError(err) diff --git a/quickstarts/javascript/browser/index.eosio.html b/quickstarts/javascript/browser/index.eosio.html index 3d4ba362..7126f650 100644 --- a/quickstarts/javascript/browser/index.eosio.html +++ b/quickstarts/javascript/browser/index.eosio.html @@ -6,7 +6,7 @@ const client = dfuseClient.createDfuseClient({ // Replace 'web_abcdef12345678900000000000' with your own API key! apiKey: 'web_abcdef12345678900000000000', - network: 'mainnet.eos.dfuse.io' + network: 'testnet.eos.dfuse.io' }) @@ -67,4 +67,4 @@ main().catch((error) => document.body.innerHTML = `

${error}

`) - \ No newline at end of file + diff --git a/quickstarts/javascript/bundler/index.eosio.js b/quickstarts/javascript/bundler/index.eosio.js index 88513f63..23c57bfa 100644 --- a/quickstarts/javascript/bundler/index.eosio.js +++ b/quickstarts/javascript/bundler/index.eosio.js @@ -3,7 +3,7 @@ import { createDfuseClient } from "@dfuse/client" const client = createDfuseClient({ apiKey: process.env.DFUSE_API_KEY, - network: "mainnet.eos.dfuse.io", + network: "testnet.eos.dfuse.io", }) // CODE:END:quickstarts_javascript_bundler_eos_section1 // CODE:BEGIN:quickstarts_javascript_bundler_eos_section2 @@ -56,4 +56,4 @@ async function main() { // CODE:END:quickstarts_javascript_bundler_eos_section3 // CODE:BEGIN:quickstarts_javascript_bundler_eos_section4 main().catch((error) => document.body.innerHTML = `

${error}

`) -// CODE:END:quickstarts_javascript_bundler_eos_section4 \ No newline at end of file +// CODE:END:quickstarts_javascript_bundler_eos_section4 diff --git a/quickstarts/javascript/node/index.eosio.js b/quickstarts/javascript/node/index.eosio.js index ce62c11d..ae32f96c 100644 --- a/quickstarts/javascript/node/index.eosio.js +++ b/quickstarts/javascript/node/index.eosio.js @@ -6,7 +6,7 @@ const { createDfuseClient } = require('@dfuse/client'); const client = createDfuseClient({ apiKey: process.env.DFUSE_API_KEY, - network: 'mainnet.eos.dfuse.io' + network: 'testnet.eos.dfuse.io' }); // CODE:END:quickstarts_javascript_node_eos_section1 // CODE:BEGIN:quickstarts_javascript_node_eos_section2 @@ -53,4 +53,4 @@ async function main() { // CODE:END:quickstarts_javascript_node_eos_section3 // CODE:BEGIN:quickstarts_javascript_node_eos_section4 main().catch(error => console.log('Unexpected error', error)); -// CODE:END:quickstarts_javascript_node_eos_section4 \ No newline at end of file +// CODE:END:quickstarts_javascript_node_eos_section4 diff --git a/quickstarts/python/main.py b/quickstarts/python/main.py index c8494229..b8846695 100644 --- a/quickstarts/python/main.py +++ b/quickstarts/python/main.py @@ -86,7 +86,7 @@ def stream_ethereum(): # CODE:BEGIN:quickstarts_python_eos_section5 def stream_eosio(): # The client can be re-used for all requests, cache it at the appropriate level - client = create_client('mainnet.eos.dfuse.io:443') + client = create_client('testnet.eos.dfuse.io:443') stream = client.Execute(Request(query = OPERATION_EOS)) for rawResult in stream: @@ -110,4 +110,4 @@ def stream_eosio(): stream_ethereum() else: stream_eosio() -# CODE:END:quickstarts_python_eos_section6 \ No newline at end of file +# CODE:END:quickstarts_python_eos_section6 diff --git a/samples/go/eos/push-notification/README.md b/samples/go/eos/push-notification/README.md index fec1da77..5b0c4c84 100644 --- a/samples/go/eos/push-notification/README.md +++ b/samples/go/eos/push-notification/README.md @@ -58,7 +58,7 @@ func (jwt JWT) NeedRefresh() bool { ``` ### Getting the dfuse Graphql gRPC client - Take a look at gRPC [Go Quick Start](https://grpc.io/docs/quickstart/go.html) -- You can retrieve `graphql.proto` running `curl -O http://mainnet.eos.dfuse.io/graphql/graphql.proto` +- You can retrieve `graphql.proto` running `curl -O http://testnet.eos.dfuse.io/graphql/graphql.proto` - execute `protoc -I pb/ pb/graphql.proto --go_out=plugins=grpc:graphql` ### Initiating dfuse Graphql Server connection @@ -85,8 +85,8 @@ graphqlClient := pbgraphql.NewGraphQLClient(connection) ### GraphQL query - dfuse GraphQL documention can be found [here](https://docs.dfuse.io/#graphql) - If you are not familiar with GraphQL. Take a look at [Introduction to GraphQL](https://graphql.org/learn/) -- To help you construct your query and access our api documentation you can use [GraphiQL](https://mainnet.eos.dfuse.io/graphiql/) _"A graphical interactive in-browser GraphQL IDE."_ -https://mainnet.eos.dfuse.io/graphiql/ +- To help you construct your query and access our api documentation you can use [GraphiQL](https://testnet.eos.dfuse.io/graphiql/) _"A graphical interactive in-browser GraphQL IDE."_ +https://testnet.eos.dfuse.io/graphiql/ ### Executing a query ```go ... diff --git a/samples/javascript/eos/push-guaranteed/README.md b/samples/javascript/eos/push-guaranteed/README.md index 0db5a128..0b325c2b 100644 --- a/samples/javascript/eos/push-guaranteed/README.md +++ b/samples/javascript/eos/push-guaranteed/README.md @@ -59,7 +59,7 @@ Better yet, like state directly in `eosjs` library, use a third-party signing pr If you want to try on EOS Mainnet or Kylin instead, you can provide the following extra environment variables: - export DFUSE_API_NETWORK="" + export DFUSE_API_NETWORK="" export TRANSFER_TO_ACCOUNT="" export TRANSFER_QUANTITY="" diff --git a/samples/python/eos/graphql-grpc/example.py b/samples/python/eos/graphql-grpc/example.py index 05e96f15..e8d2d233 100644 --- a/samples/python/eos/graphql-grpc/example.py +++ b/samples/python/eos/graphql-grpc/example.py @@ -27,7 +27,7 @@ def token_for_api_key(apiKey): def stub(): credentials = grpc.access_token_call_credentials(token_for_api_key(sys.argv[1])) - channel = grpc.secure_channel('mainnet.eos.dfuse.io:443', + channel = grpc.secure_channel('testnet.eos.dfuse.io:443', credentials=grpc.composite_channel_credentials(grpc.ssl_channel_credentials(), credentials)) return graphql_pb2_grpc.GraphQLStub(channel) diff --git a/samples/typescript/eos/decode-hex/README.md b/samples/typescript/eos/decode-hex/README.md index 677ddfea..4660a6e8 100644 --- a/samples/typescript/eos/decode-hex/README.md +++ b/samples/typescript/eos/decode-hex/README.md @@ -31,7 +31,7 @@ import { TextEncoder, TextDecoder } from 'util'; async function main(): Promise { const signatureProvider = new JsSignatureProvider([]); - const rpc = new JsonRpc('https://mainnet.eos.dfuse.io', { fetch: fetch as any }); + const rpc = new JsonRpc('https://testnet.eos.dfuse.io', { fetch: fetch as any }); const api = new Api({ rpc, signatureProvider, textDecoder: new TextDecoder() as any, textEncoder: new TextEncoder() }); const abi = await api.getAbi("eosio.token") diff --git a/samples/typescript/eos/decode-hex/index.ts b/samples/typescript/eos/decode-hex/index.ts index d6a8a465..90ea8ebf 100644 --- a/samples/typescript/eos/decode-hex/index.ts +++ b/samples/typescript/eos/decode-hex/index.ts @@ -6,7 +6,7 @@ import { TextEncoder, TextDecoder } from 'util'; async function main(): Promise { const signatureProvider = new JsSignatureProvider([]); - const rpc = new JsonRpc('https://mainnet.eos.dfuse.io', { fetch: fetch as any }); + const rpc = new JsonRpc('https://testnet.eos.dfuse.io', { fetch: fetch as any }); const api = new Api({ rpc, signatureProvider, textDecoder: new TextDecoder() as any, textEncoder: new TextEncoder() }); const abi = await api.getAbi("eosio.token") @@ -42,4 +42,4 @@ main().then(() => { }).catch((error) => { console.log("An error occurred", error) process.exit(1) -}) \ No newline at end of file +}) diff --git a/samples/typescript/eos/price-feed/index.ts b/samples/typescript/eos/price-feed/index.ts index 4d3cdc10..3da0704e 100644 --- a/samples/typescript/eos/price-feed/index.ts +++ b/samples/typescript/eos/price-feed/index.ts @@ -25,12 +25,12 @@ const debug = debugFactory("dfuse:example") async function main() { const signatureProvider = new JsSignatureProvider([]); - const rpc = new JsonRpc('https://mainnet.eos.dfuse.io', { fetch: fetch as any }); + const rpc = new JsonRpc('https://testnet.eos.dfuse.io', { fetch: fetch as any }); const api = new Api({ rpc, signatureProvider, textDecoder: new TextDecoder() as any, textEncoder: new TextEncoder() }); const dfuseClient = createDfuseClient({ apiKey: process.env.DFUSE_API_KEY!, - network: "mainnet", + network: "testnet", }); const subscriptionClient = new SubscriptionClient(dfuseClient.endpoints.graphqlStreamUrl, { diff --git a/samples/typescript/eos/stream-action-rates/README.md b/samples/typescript/eos/stream-action-rates/README.md index dce6d2f8..7064761c 100644 --- a/samples/typescript/eos/stream-action-rates/README.md +++ b/samples/typescript/eos/stream-action-rates/README.md @@ -45,7 +45,7 @@ import { InMemoryCache } from "apollo-cache-inmemory"; import { createDfuseClient } from "@dfuse/client"; const dfuseClient = createDfuseClient({ - network: "mainnet", + network: "testnet", apiKey: "YOUR_API_KEY_HERE" // <--- Change this value for your own API Key! }) @@ -74,8 +74,8 @@ export const apolloClient = new ApolloClient({ - The dfuse GraphQL documentation can be found [here](https://docs.dfuse.io/#graphql) - If you are not familiar with GraphQL already, take a look at [Introduction to GraphQL](https://graphql.org/learn/) -- To help you construct your query and access our API documentation you can use [GraphiQL](https://mainnet.eos.dfuse.io/graphiql/) _"A graphical interactive in-browser GraphQL IDE."_ -https://mainnet.eos.dfuse.io/graphiql/ +- To help you construct your query and access our API documentation you can use [GraphiQL](https://testnet.eos.dfuse.io/graphiql/) _"A graphical interactive in-browser GraphQL IDE."_ +https://testnet.eos.dfuse.io/graphiql/ ### Build the GraphQL subscription diff --git a/tutorials/eos/push-guaranteed/README.md b/tutorials/eos/push-guaranteed/README.md index 5a5ba682..887e52d6 100644 --- a/tutorials/eos/push-guaranteed/README.md +++ b/tutorials/eos/push-guaranteed/README.md @@ -59,7 +59,7 @@ Better yet, like state directly in `eosjs` library, use a third-party signing pr If you want to try on EOS Mainnet or Kylin instead, you can provide the following extra environment variables: - export DFUSE_API_NETWORK="" + export DFUSE_API_NETWORK="" export TRANSFER_TO_ACCOUNT="" export TRANSFER_QUANTITY=""