func InitServer(setEngines map[*coinparam.Params]match.SettlementEngine, matchEngines map[match.Pair]match.LimitEngine, books map[match.Pair]match.LimitOrderbook, depositStores map[*coinparam.Params]cxdb.DepositStore, settleStores map[*coinparam.Params]cxdb.SettlementStore, rootDir string) (server *OpencxServer, err error) {
	server = &OpencxServer{
		SettlementEngines: setEngines,
		MatchingEngines:   matchEngines,
		Orderbooks:        books,
		DepositStores:     depositStores,
		SettlementStores:  settleStores,
		dbLock:            new(sync.Mutex),
		OpencxRoot:        rootDir,
		registrationString: "opencx-register",
		getOrdersString:    "opencx-getorders",
		ingestMutex:        *new(sync.Mutex),
		BlockChanMap:       make(map[int]chan *wire.MsgBlock),
		HeightEventChanMap: make(map[int]chan lnutil.HeightEvent),
		HookMap:    make(map[*coinparam.Params]*uspv.ChainHook),
		WalletMap:  make(map[*coinparam.Params]*wallit.Wallit),
		PrivKeyMap: make(map[*coinparam.Params]*hdkeychain.ExtendedKey),
		hookMtx:    new(sync.Mutex),
		walletMtx:  new(sync.Mutex),
		privKeyMtx: new(sync.Mutex),
		defaultCapacity: 1000000,
	}
	return
}
InitServer creates a new server
package cxserver
import (
	"fmt"
	"sync"
	"github.com/mit-dci/lit/crypto/koblitz"
	"golang.org/x/crypto/sha3"
	"github.com/mit-dci/lit/uspv"
	"github.com/mit-dci/lit/btcutil/hdkeychain"
	"github.com/mit-dci/lit/coinparam"
	"github.com/mit-dci/lit/lnutil"
	"github.com/mit-dci/lit/qln"
	"github.com/mit-dci/lit/wallit"
	"github.com/mit-dci/lit/wire"
	"github.com/mit-dci/opencx/cxdb"
	"github.com/mit-dci/opencx/logging"
	"github.com/mit-dci/opencx/match"
)
type OpencxServer struct {
	SettlementEngines map[*coinparam.Params]match.SettlementEngine
	MatchingEngines   map[match.Pair]match.LimitEngine
	Orderbooks        map[match.Pair]match.LimitOrderbook
	DepositStores     map[*coinparam.Params]cxdb.DepositStore
	SettlementStores  map[*coinparam.Params]cxdb.SettlementStore
	dbLock            *sync.Mutex
	registrationString string
	getOrdersString    string
	ExchangeNode *qln.LitNode
	BlockChanMap       map[int]chan *wire.MsgBlock
	HeightEventChanMap map[int]chan lnutil.HeightEvent
	ingestMutex        sync.Mutex
	OpencxRoot string
	HookMap    map[*coinparam.Params]*uspv.ChainHook
	hookMtx    *sync.Mutex
	WalletMap  map[*coinparam.Params]*wallit.Wallit
	walletMtx  *sync.Mutex
	PrivKeyMap map[*coinparam.Params]*hdkeychain.ExtendedKey
	privKeyMtx *sync.Mutex
	defaultCapacity int64
}