diff --git a/README.md b/README.md index 162adca..8f3cfe9 100644 --- a/README.md +++ b/README.md @@ -40,37 +40,8 @@ The `Dialer` requires the other peers to be already "registered" to connect with Example (register peer before propose a channel with them): ````go -// OpenChannel opens a new channel with the specified peer and funding. -func (c *PaymentClient) OpenChannel(peer wire.Address, peerID string, amount float64) *PaymentChannel { - .... - ``` - c.net.Dialer.Register(peer, peerID) - ``` - ... - - // Prepare the channel proposal by defining the channel parameters. - challengeDuration := uint64(10) // On-chain challenge duration in seconds. - proposal, err := client.NewLedgerChannelProposal( - challengeDuration, - c.account, - initAlloc, - participants, - ) - if err != nil { - panic(err) - } - - // Send the proposal. - ch, err := c.perunClient.ProposeChannel(context.TODO(), proposal) - if err != nil { - panic(err) - } - - // Start the on-chain event watcher. It automatically handles disputes. - c.startWatching(ch) - - return newPaymentChannel(ch, c.currency) -} +// Must be called at least once before attempting to connect with peer. +net.Dialer.Register(peer, peerID) ```` ## Address Ressolver diff --git a/p2p/account_test.go b/p2p/account_test.go index 277bb4a..32a9e1a 100644 --- a/p2p/account_test.go +++ b/p2p/account_test.go @@ -223,4 +223,5 @@ func TestNewAccountFromPrivateKey(t *testing.T) { assert.NoError(t, err) assert.NotNil(t, acc2) assert.Equal(t, acc.ID(), acc2.ID()) + assert.Equal(t, acc.Address(), acc2.Address()) }