This is a fork of the original ChainSafe repository to which the functionality of interacting with the TON node and some additional business logic were added.
- Check out our documentation.
- Try running DOTON Bridge locally.
- Chat with us on telegram [EN] [RU]
-
DOTON Bridge use ton-client-go and require Rust and TON-SDK (see radianceteam/ton-client-go) Only required if connecting to a ton chain.
-
Subkey: Used for substrate key management. Only required if connecting to a substrate chain.
make build
: Builds doton
in ./build
.
or
make install
: Uses go install
to add doton
to your GOBIN.
The official wintex Docker image can be found here.
To build the Docker image locally run:
docker build -t wintex/doton-bridge .
To start DotonBridge:
docker run -v ./config.json:/config.json wintex/doton-bridge
A chain configurations take this form:
{
"name": "freeTON", // Human-readable name
"type": "ton", // Chain type (eg. "ton" or "substrate")
"id": "0", // Chain ID
"endpoint": "ws://<host>:<port>", // Node endpoint
"from": "0:164d61e...", // On-chain address of relayer
"opts": {}, // Chain-specific configuration options (see below)
}
See config.json.example
for an example configuration.
Ton chains support the following additional options:
{
"contractsPath": "/contracts", // The path to contract files (ABI, TVC)
"receiver": "0:e50f...92ee", // The contract Reciver address (Deploy script in /scripts/Makefile target: ton-deploy-contracts)
"startBlock": "1", // The block to start processing events from (default: 0)
"workchainID": "0" // The workchain from which the events will be processing
}
Substrate supports the following additonal options:
{
"startBlock": "1234" // The block to start processing events from (default: 0)
"useExtendedCall": "true" // Extend extrinsic calls to substrate with ResourceID. Used for backward compatibility with example pallet.
}
The blockstore is used to record the last block the relayer processed, so it can pick up where it left off.
If a startBlock
option is provided (see Configuration), then the greater of startBlock
and the latest block in the blockstore is used at startup.
To disable loading from the blockstore specify the --fresh
flag. A custom path for the blockstore can be provided with --blockstore <path>
. For development, the --latest
flag can be used to start from the current block and override any other configuration.
DOTON Bridge requires keys to sign and submit transactions, and to identify each bridge node on chain.
To use secure keys, see doton accounts --help
. The keystore password can be supplied with the KEYSTORE_PASSWORD
environment variable.
To import external ton keys, such as those generated with tonos-cli, use doton accounts import --ton /path/to/key
.
or
doton accounts import --ton --seedphrase "action glow era all liquid critic achieve lawsuit era anger loud slight"
To import private keys as keystores, use doton account import --privateKey key
.
For testing purposes, doton provides 5 test keys for substrate. The can be used with --testkey <name>
, where name
is one of Alice
, Bob
, Charlie
, Dave
, or Eve
.
-
TON: doton-ton
The contracts for interact with DOTON protocol
-
Substrate: doton-substrate
A substrate pallet that can be integrated into a chain, as well as an example pallet to demonstrate chain integration.
MKdocs will generate static HTML files for DOTON markdown files located in ./docs/
make install-mkdocs
: Pull the docker image MkDocs
make mkdocs
: Run MkDoc's docker image, building and hosting the html files on localhost:8000