-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a53eff5
commit 1d7f968
Showing
5 changed files
with
111 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
*~ | ||
.DS_Store | ||
/tools/ | ||
-s | ||
-s.idea | ||
.idea/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |