コード例 #1
0
ファイル: test_integration.py プロジェクト: jashug/Lightning
 def setUp(self):
     # As in TestChannel, set up 3 nodes
     self.net = regnet.create(datadir=None, cache=self.cache)
     self.alice, self.bob, self.carol = self.net[0], self.net[1], self.net[2]
     # Set up channels between so the network is Alice - Carol - Bob
     self.alice.lit.create(self.carol.lurl, 50000000, 50000000)
     self.propagate()
     self.bob.lit.create(self.carol.lurl, 50000000, 50000000)
     self.propagate()
コード例 #2
0
 def setUp(self):
     # As in TestChannel, set up 3 nodes
     self.net = regnet.create(datadir=None, cache=self.cache)
     self.alice, self.bob, self.carol = self.net[0], self.net[1], self.net[2]
     # Set up channels between so the network is Alice - Carol - Bob
     self.alice.lit.create(self.carol.lurl, 50000000, 50000000)
     self.propagate()
     self.bob.lit.create(self.carol.lurl, 50000000, 50000000)
     self.propagate()
コード例 #3
0
ファイル: test_integration.py プロジェクト: jashug/Lightning
 def setUp(self):
     # Set up 3 nodes: Alice, Bob, and Carol
     self.net = regnet.create(datadir=None, cache=self.cache)
     self.alice, self.bob, self.carol = self.net[0], self.net[1], self.net[2]
コード例 #4
0
ファイル: test_integration.py プロジェクト: jashug/Lightning
 def setUp(self):
     # Set up 3 nodes: Alice, Bob, and Carol
     self.net = regnet.create(datadir=None, cache=self.cache)
     self.alice, self.bob, self.carol = self.net[0], self.net[1], self.net[
         2]
コード例 #5
0
ファイル: demo.py プロジェクト: jashug/Lightning
balances() returns a tuple of Alice, Bob, and Carol's total balances
Carol has so much money because she is the miner.

Send 0.1 BTC from Alice to Bob on the lightning network
>>> alice.lit.send(bob.lurl, 10000000)
True

Check balances:
>>> balances()
(89970000, 109980000, 199970000)

Read test.py for more example usage.
"""

import test.regnet as regnet
NET = regnet.create(datadir=None)
NET.generate(101)
NET.miner.bit.sendmany(
    "", {
        NET[0].bit.getnewaddress(): 100000000,
        NET[1].bit.getnewaddress(): 100000000,
        NET[2].bit.getnewaddress(): 200000000,
    })
NET.sync()
alice, bob, carol = NET[0], NET[1], NET[2]
alice.lit.create(carol.lurl, 50000000, 50000000)
NET.generate()
bob.lit.create(carol.lurl, 50000000, 50000000)
NET.generate()

コード例 #6
0
ファイル: demo.py プロジェクト: jpentland/Lightning
balances() returns a tuple of Alice, Bob, and Carol's total balances
Carol has so much money because she is the miner.

Send 0.1 BTC from Alice to Bob on the lightning network
>>> alice.lit.send(bob.lurl, 10000000)
True

Check balances:
>>> balances()
(89970000, 109980000, 199970000)

Read test.py for more example usage.
"""

import test.regnet as regnet
NET = regnet.create(datadir=None)
NET.generate(101)
NET.miner.bit.sendmany(
    "",
    {NET[0].bit.getnewaddress(): 100000000,
     NET[1].bit.getnewaddress(): 100000000,
     NET[2].bit.getnewaddress(): 200000000,
    })
NET.sync()
alice, bob, carol = NET[0], NET[1], NET[2]
alice.lit.create(carol.lurl, 50000000, 50000000)
NET.generate()
bob.lit.create(carol.lurl, 50000000, 50000000)
NET.generate()

def balances():