Coder Social home page Coder Social logo

btc-vendor-tools's Introduction

BTC Vendor Tool

Introduction

Vendor Tool can sign a bitcoin cross-chain backing transaction created by Poly smartcontract. This transaction will unlock BTC from vendor's multisig address to user's address. Vendor Tool scans Poly chain and sign every unlock transaction created by Poly automaticly.

Build From Source

Prerequisites

  • Golang version 1.14 or later

Build

git clone https://github.com/polynetwork/btc-vendor-tools.git
cd btc-vendor-tools
go build -o vendortool cmd/run.go

After building the source code successfully, you should see the executable program vendortool.

Usage

Configuration

Before running vendortool, you have to config it right.

{
	"PolyJsonRpcAddress": "http://poly_rpc:20336", // Poly RPC address
	"WalletFile": "/path/to/wallet.dat", // poly wallet file
	"WalletPwd": "", // poly wallet password. if not set, you're supposed to input it starting vendortool
	"BtcWalletPwd": "", // password for bitcoin wallet file encrypted from btc private key
	"PolyObLoopWaitTime": 2, // interval for scanning poly
	"BtcPrivkFile": "/path/to/btcprivk", // bitcoin wallet file encrypted from btc private key
	"WatchingKeyToSign": "makeBtcTx",// key word no need to change
	"ConfigBitcoinNet": "test", // bitcoin net type
	"ConfigDBPath": "./db", // DB path
	"RestPort": 50071, // restful service port
	"SleepTime": 10, // sleep when some situation happen
	"CircleToSaveHeight": 300, // save a snapshot height every n heights.
	"Redeem": "552102dec...432fc57ae", // vendor multisig redeem script
	"SignerAddr": "",
	"ObServerAddr": "",
	"PolyStartHeight": 1, // start scanning from this height
	"WebServerPort": "8080" // web service for create a vendor (still in dev)
}

Start Relayer

Run as follow:

./vendortool --web=0 --config=./conf.json

You can create a vendor by run:

./vendortool --config=./conf.json

And visit http://localhost:8080 to create a vendor. This function is still in develop.

btc-vendor-tools's People

Contributors

zouxyan avatar tanziwen avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.