4 [![MIT](https://img.shields.io/badge/license-MIT-brightgreen.svg)](./LICENSE)
6 - [1 Background](#1-background)
7 - [2 Install](#2-install)
8 - [2.1 Requirements](#21-requirements)
9 - [2.2 Install bytom node](#22-install-bytom-node)
10 - [2.3 Build from source code](#23-build-from-source-code)
12 - [3.1 Launch bytom node](#31-launch-bytom-node)
13 - [3.2 Create account and issue your asset](#32-create-account-and-issue-your-asset)
14 - [3.3 Deploy contract](#33-deploy-contract)
15 - [3.5 Call contract](#35-call-contract)
16 - [4 Contributing](#4-contributing)
17 - [5 License](#5-license)
21 Shuttle is designed to help swap different assets in bytom.
27 - [Go](https://golang.org/doc/install) version 1.12 or higher, with `$GOPATH` set to your preferred directory
29 ### 2.2 Install bytom node
31 Firstly, you should install and configure bytom node, see also: [Bytom repository](https://github.com/Bytom/bytom).
33 ### 2.3 Build from source code
35 This BTM swap tool is still in beta, so repository code will be changed frequently. You can build tool from source code directly.
38 $ git clone https://github.com/Bytom/shuttle.git $GOPATH/src/github.com/shuttle
39 $ cd $GOPATH/src/github.com/shuttle
45 ### 3.1 Launch bytom node
47 For testing, you can launch bytom solonet node.
50 $ bytomd init --chain_id=solonet --home $HOME/bytom/solonet # init bytom solonet node
51 $ bytomd node --home $HOME/bytom/solonet --mining # launch bytom solonet node and start mining
54 ### 3.2 Create account and issue your asset
56 You should create several accounts and issue your asset for testing, more details:
58 - [Managing Accounts](https://github.com/Bytom/bytom/wiki/Managing-Accounts)
59 - [Assets registration](https://github.com/Bytom/bytom/wiki/Advanced-Transaction#assets-registration)
61 ### 3.3 Deploy contract
64 $ cd $GOPATH/src/github.com/btm-swap-tool/cmd
65 $ ./cmd deploy 10CJPO1HG0A02 12345 --amountLocked 20000000000 --amountRequested 1000000000 --assetLocked bae7e17bb8f5d0cfbfd87a92f3204da082d388d4c9b10e8dcd36b3d0a18ceb3a --assetRequested ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff --cancelKey 3e5d7d52d334964eef173021ef6a04dc0807ac8c41700fe718f5a80c2109f79e --seller 00145dd7b82556226d563b6e7d573fe61d23bd461c1f --txFee 40000000
66 --> contractUTXOID: ad1e72021352ade9e0fef7b1c52cc070bfcb1429f885a540f00f8b957e941b2d
69 Then, wait about 2.5 minutes, and a new block will be mined, the contract will be confirmed.
74 $ ./cmd call 10CKAD3000A02 12345 00140fdee108543d305308097019ceb5aec3da60ec66 ad1e72021352ade9e0fef7b1c52cc070bfcb1429f885a540f00f8b957e941b2d
75 --> txID: 762d6912e126ac3937cee54db8898af09abc5633c8b78682fa0cc23d89a518a9
78 When the transaction will be confirmed in a new block, the whole BTM swap is successful.
82 Welcome to [open an issue](https://github.com/Bytom/btm-swap-tool/issues/new) or submit PRs. This project exists thanks to all the people who contribute.
86 [MIT](./LICENSE) © 2019 Bytom