Skip to content

Commit

Permalink
autobuild updates, wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Metcalf authored and leonVrashitov committed Oct 29, 2021
1 parent a53eff5 commit 1d7f968
Show file tree
Hide file tree
Showing 5 changed files with 111 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
*~
.DS_Store
/tools/
-s
-s.idea
.idea/*
47 changes: 47 additions & 0 deletions autobuild/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#!/usr/bin/env python3
from jinja2 import Template
import json
import os, sys, os.path
import random
import string
import urllib.request
import argparse
import configparser

def Merge(dict1, dict2):
res = {**dict1, **dict2}
return res


from jinja2 import Environment, FileSystemLoader, Template

COIN_LIST='Bitcoin'
J2_ENV = Environment(loader=FileSystemLoader(''),
trim_blocks=True)


with open('../manifest.json') as json_file:
data = json.load(json_file)


for chain in data:
#print (chain['blockchain'])
if chain['blockchain'] in COIN_LIST:
print('start: {}'.format(chain['blockchain']))
#print(chain)
# load base config for specific coin
base_config_fname = 'configs/{}.base.j2'.format(chain['ticker'].lower())
base_config_template = J2_ENV.get_template(base_config_fname)
base_config = json.loads(base_config_template.render())
#print(base_config['BTC'])
merged_dict = (Merge(chain,base_config[chain['ticker']]))
print(json.dumps(merged_dict, indent=2))
# load xb j2
custom_template_fname = 'templates/xbridge.conf.j2'
custom_template = J2_ENV.get_template(custom_template_fname)
rendered_data = custom_template.render(merged_dict)

print(rendered_data)



25 changes: 25 additions & 0 deletions autobuild/configs/btc.base.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"BTC": {
"Title": "Bitcoin",
"Address": "",
"Ip": "127.0.0.1",
"rpcPort": "{{ rpcPort|default(8332) }}",
"p2pPort": "{{ p2pPort|default(8333) }}",
"Username": "{{ rpcusername }}",
"Password": "{{ rpcpassword }}",
"AddressPrefix": 0,
"ScriptPrefix": 5,
"SecretPrefix": 128,
"COIN": 100000000,
"MinimumAmount": 0,
"DustAmount": 0,
"CreateTxMethod": "BTC",
"GetNewKeySupported": false,
"ImportWithNoScanSupported": false,
"MinTxFee": 12000,
"BlockTime": 600,
"TxVersion": 2,
"FeePerByte": 60,
"Confirmations": 0
}
}
16 changes: 16 additions & 0 deletions autobuild/templates/wallet.conf.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
server=1
listen=1
rpcuser=
rpcpassword=
rpcallowip=127.0.0.1
port=8333
rpcport=8332
txindex=1

# Legacy addresses must be used (address must begin with "1", not "3")
addresstype=legacy
changetype=legacy

# Enable deprecated calls
deprecatedrpc=signrawtransaction

21 changes: 21 additions & 0 deletions autobuild/templates/xbridge.conf.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[{{ ticker }}]
Title={{ Title }}
Address=
Ip={{ Ip }}
Port={{ rpcPort }}
Username=
Password=
AddressPrefix={{ AddressPrefix }}
ScriptPrefix={{ ScriptPrefix }}
SecretPrefix={{ SecretPrefix }}
COIN={{ COIN }}
MinimumAmount={{ MinimumAmount }}
TxVersion={{ TxVersion }}
DustAmount={{ DustAmount }}
CreateTxMethod={{ CreateTxMethod }}
GetNewKeySupported={{ GetNewKeySupported }}
ImportWithNoScanSupported={{ImportWithNoScanSupported }}
MinTxFee={{MinTxFee }}
BlockTime={{ BlockTime }}
FeePerByte={{ FeePerByte }}
Confirmations={{ Confirmations }}

0 comments on commit 1d7f968

Please sign in to comment.