Skip to content

Commit 973e0bb

Browse files
authored
Merge pull request #194 from jtimon/e14-tutorial
Separate config files from assets tutorial
2 parents 73c9050 + fb13181 commit 973e0bb

File tree

4 files changed

+84
-83
lines changed

4 files changed

+84
-83
lines changed

contrib/assets_tutorial/assets_tutorial.sh

Lines changed: 18 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -1,89 +1,20 @@
11

2-
shopt -s expand_aliases
3-
4-
rm -r ~/elementsdir1
5-
rm -r ~/elementsdir2
6-
rm -r ~/bitcoindir
7-
mkdir ~/elementsdir1
8-
mkdir ~/elementsdir2
9-
mkdir ~/bitcoindir
2+
## Preparations
103

114
# First we need to set up our config files to walk through this demo
12-
13-
cat <<EOF > ~/elementsdir1/elements.conf
14-
# Standard bitcoind stuff
15-
rpcuser=user1
16-
rpcpassword=password1
17-
rpcport=18884
18-
port=18886
19-
20-
# Over p2p we will only connect to local other elementsd
21-
connect=localhost:18887
22-
23-
regtest=1
24-
daemon=1
25-
# Make sure you set listen after -connect, otherwise neither
26-
# will accept incoming connections!
27-
listen=1
28-
# Just for looking at random txs
29-
txindex=1
30-
31-
# This is the script that controls pegged in funds in Bitcoin network
32-
# Users will be pegging into a P2SH of this, and the "watchmen"
33-
# can then recover these funds and send them to users who desire to peg out.
34-
# This template is 1-of-1 checkmultisig
35-
#fedpegscript=5121<pubkey>51ae
36-
37-
# This is the script that controls how blocks are made
38-
# We have to supply a signature that satisfies this to create
39-
# a valid block.
40-
#signblockscript=5121<pubkey2>51ae
41-
42-
# We want to validate pegins by checking with bitcoind if header exists
43-
# in best known chain, and how deep. We combine this with pegin
44-
# proof included in the pegin to get full security.
45-
validatepegin=1
46-
47-
# If in the same datadir and using standard ports, these are unneeded
48-
# thanks to cookie auth. If not, like in our situation, elementsd needs
49-
# more info to connect to bitcoind:
50-
mainchainrpcport=18888
51-
mainchainrpcuser=user3
52-
mainchainrpcpassword=password3
53-
EOF
54-
55-
cat <<EOF > ~/elementsdir2/elements.conf
56-
rpcuser=user2
57-
rpcpassword=password2
58-
rpcport=18885
59-
port=18887
60-
connect=localhost:18886
61-
62-
regtest=1
63-
daemon=1
64-
listen=1
65-
txindex=1
66-
67-
#fedpegscript=51<pubkey>51ae
68-
#signblockscript=51<pubkey2>51ae
69-
70-
mainchainrpcport=18888
71-
mainchainrpcuser=user3
72-
mainchainrpcpassword=password3
73-
validatepegin=1
74-
EOF
75-
76-
cat <<EOF > ~/bitcoindir/bitcoin.conf
77-
rpcuser=user3
78-
rpcpassword=password3
79-
rpcport=18888
80-
port=18889
81-
82-
regtest=1
83-
testnet=0
84-
daemon=1
85-
txindex=1
86-
EOF
5+
# Let's have some testing user directories for 1 bitcoin node and 2 elements nodes.
6+
rm -r ~/bitcoindir ; rm -r ~/elementsdir1 ; rm -r ~/elementsdir2
7+
mkdir ~/bitcoindir ; mkdir ~/elementsdir1 ; mkdir ~/elementsdir2
8+
9+
# Also configure the nodes by copying the configuration files from
10+
# this directory (and read them):
11+
cp ./contrib/assets_tutorial/bitcoin.conf ~/bitcoindir/bitcoin.conf
12+
cp ./contrib/assets_tutorial/elements1.conf ~/elementsdir1/elements.conf
13+
cp ./contrib/assets_tutorial/elements2.conf ~/elementsdir2/elements.conf
14+
15+
# Set some aliases:
16+
cd src
17+
shopt -s expand_aliases
8718

8819
ELEMENTSPATH="."
8920
BITCOINPATH="."
@@ -104,6 +35,10 @@ b-dae
10435
e1-dae
10536
e2-dae
10637

38+
# Alternatively, you can set validatepegin=0 in their configs and don't
39+
# run the bitcoin node, but it is necessary for the two way peg parts of
40+
# this tutorial.
41+
10742
# Prime the chain, see "immature balance" holds all funds until genesis is mature
10843
e1-cli getwalletinfo
10944

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
rpcuser=user3
2+
rpcpassword=password3
3+
rpcport=18888
4+
port=18889
5+
6+
regtest=1
7+
testnet=0
8+
daemon=1
9+
txindex=1
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Standard bitcoind stuff
2+
rpcuser=user1
3+
rpcpassword=password1
4+
rpcport=18884
5+
port=18886
6+
7+
# Over p2p we will only connect to local other elementsd
8+
connect=localhost:18887
9+
10+
regtest=1
11+
daemon=1
12+
# Make sure you set listen after -connect, otherwise neither
13+
# will accept incoming connections!
14+
listen=1
15+
# Just for looking at random txs
16+
txindex=1
17+
18+
# This is the script that controls pegged in funds in Bitcoin network
19+
# Users will be pegging into a P2SH of this, and the "watchmen"
20+
# can then recover these funds and send them to users who desire to peg out.
21+
# This template is 1-of-1 checkmultisig
22+
#fedpegscript=5121<pubkey>51ae
23+
24+
# This is the script that controls how blocks are made
25+
# We have to supply a signature that satisfies this to create
26+
# a valid block.
27+
#signblockscript=5121<pubkey2>51ae
28+
29+
# We want to validate pegins by checking with bitcoind if header exists
30+
# in best known chain, and how deep. We combine this with pegin
31+
# proof included in the pegin to get full security.
32+
validatepegin=1
33+
34+
# If in the same datadir and using standard ports, these are unneeded
35+
# thanks to cookie auth. If not, like in our situation, elementsd needs
36+
# more info to connect to bitcoind:
37+
mainchainrpcport=18888
38+
mainchainrpcuser=user3
39+
mainchainrpcpassword=password3
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
rpcuser=user2
2+
rpcpassword=password2
3+
rpcport=18885
4+
port=18887
5+
connect=localhost:18886
6+
7+
regtest=1
8+
daemon=1
9+
listen=1
10+
txindex=1
11+
12+
#fedpegscript=51<pubkey>51ae
13+
#signblockscript=51<pubkey2>51ae
14+
15+
mainchainrpcport=18888
16+
mainchainrpcuser=user3
17+
mainchainrpcpassword=password3
18+
validatepegin=1

0 commit comments

Comments
 (0)