solution: docs for ERC-20 tokens

This commit is contained in:
Igor Artamonov
2020-07-06 19:29:43 -04:00
parent b3c619e57a
commit 0dbf25643d
3 changed files with 71 additions and 8 deletions

View File

@@ -43,9 +43,8 @@ image::dshackle-intro.png[alt="",width=80%,align="center"]
== Roadmap == Roadmap
- [ ] External logging - [ ] External logging
- [ ] Access to ERC-20 tokens on asset level
- [ ] Subscription to bitcoind notification over gRPC (instead of ZeroMQ)
- [ ] Prometheus monitoring - [ ] Prometheus monitoring
- [ ] Subscription to bitcoind notification over gRPC (instead of ZeroMQ)
- [ ] BIP-32 Pubkey - [ ] BIP-32 Pubkey
- [ ] Lightweight sidecar node connector - [ ] Lightweight sidecar node connector
- [ ] Configurable upstream roles - [ ] Configurable upstream roles
@@ -226,7 +225,10 @@ grpcurl -import-path ./proto/ -proto blockchain.proto -d '{\"asset\": {\"chain\"
... ...
---- ----
See other enhanced methods in the link:docs/06-methods.adoc[Documentation for Enhanced Methods] The balance subscription works with main coin (_ether_, _bticoin_), or with tokens like ERC-20 if configured additionally.
See link:docs/reference-configuration.adoc[Configuration Reference].
See other enhanced methods in the link:docs/06-methods.adoc[Documentation for Enhanced Methods].
== Documentation == Documentation

View File

@@ -71,7 +71,7 @@ message NativeCallReplyItem {
Where: Where:
- `payload` is JSON response for a particular call, encoded into a string (when `succeed` is true) - `payload` is JSON response for a particular call (`result` field), encoded into a string (`succeed` is true)
- or `error` if request failed (`succeed` is false) - or `error` if request failed (`succeed` is false)
NOTE: Reply Items comes right after their execution on an upstream, therefore streaming response. NOTE: Reply Items comes right after their execution on an upstream, therefore streaming response.
@@ -106,7 +106,8 @@ Where:
=== SubscribeBalance or GetBalance === SubscribeBalance or GetBalance
Subscribes to changes (`SubscribeBalance`) or get current (`GetBalance`) balance for a single address or a set of addresses. Subscribes to changes (`SubscribeBalance`) or get current (`GetBalance`) balance for a single address, or a set of addresses.
By default, it supports only main protocol coin (i.e. `bitcoin`, `ether`), but can be configured to support ERC-20 on Ethereum (see link:reference-configuration.adoc[Reference Configuration])
.Request .Request
[source,proto] [source,proto]

View File

@@ -46,6 +46,18 @@ proxy:
- id: kovan - id: kovan
blockchain: kovan blockchain: kovan
tokens:
- id: dai
blockchain: ethereum
name: DAI
type: ERC-20
address: 0x6B175474E89094C44Da98b954EedeAC495271d0F
- id: tether
blockchain: ethereum
name: Tether
type: ERC-20
address: 0xdac17f958d2ee523a2206206994597c13d831ec7
cluster: cluster:
defaults: defaults:
- chains: - chains:
@@ -130,6 +142,11 @@ cluster:
| |
| Setup HTTP proxy that emulates all standard JSON RPC requests. See <<proxy>> section | Setup HTTP proxy that emulates all standard JSON RPC requests. See <<proxy>> section
| `tokens`
|
| Configure tokens for tracking balance. See <<tokens>> section
| `cache` | `cache`
| |
| Caching configuration. See <<cache>> section. | Caching configuration. See <<cache>> section.
@@ -242,6 +259,49 @@ a| Routing paths for Proxy. The proxy will handle requests as `https://${HOST}:$
|=== |===
[#tokens]
== Tokens config
[source,yaml]
----
tokens:
- id: dai
blockchain: ethereum
name: DAI
type: ERC-20
address: 0x6B175474E89094C44Da98b954EedeAC495271d0F
- id: tether
blockchain: ethereum
name: Tether
type: ERC-20
address: 0xdac17f958d2ee523a2206206994597c13d831ec7
----
Tokens config enables tracking of a balance amount in the configured tokens.
After making the configuration above you can request balance (`GetBalance`), or subscribe to balance changes (`SubscribeBalance`), using link:06-methods.adoc[enhanced protocol]
.Token config
[cols="2a,7"]
|===
| Option | Description
| `id`
| Internal id for reference (used in logging, etc)
| `blockchain`
| An ethereum-based blockchain where the contract is deployed
| `name`
| Name of the token, used for balance response as asset code (as converted to UPPERCASE)
| `type`
| Type of token. Only `ERC-20` is supported at this moment
| `address`
| Address of the deployed contract
|===
[#cache] [#cache]
== Cache config == Cache config