How to use Exchange?



Hi this is an interesting project and I’d like to try it out. I have counterpartyd built from the git repository and it is nearly finished scanning the blockchain.

Rather than stumble through it and possibly make mistakes, is there a tutorial i can read? or a cheat sheet?
I see references to use btcpay when purchasing xcp, but nowhere to i see any instructions on how to do it.


this is interesting. no one knows how to use this

[quote author=bindy link=topic=65.msg295#msg295 date=1391831866]
this is interesting. no one knows how to use this
[/quote]


We have several articles on the FAQ which may help: https://counterparty.co/knowledgebase_category/counterpartyd/
Also see  https://forums.counterparty.co/index.php/board,5.0.html


We’re working to get more information here, and anyone from the community is more than welcome to contribute.

Presuming you’ve got counterpartyd installed, and running ([tt]counterpartyd server[/tt]  will start it) and it has finished scanning up until the latest block (block 284743 at the time I’m posting) then:

* Open bitcoin-qt, go to the receive tab and add a new address. Label it “counterparty funds” or something so you won’t forget which one it is. Copy the address to clipboard.

* Send some bitcoins to this address, ideally from somewhere else (eg. your mobile phone.) AFAIK bitcoin-qt doesn’t easily let you move coins between addresses it controls. It treats them all as a single lump sum, and hides the details about what address the coins actually belong to from the user. For our purposes we just want to ensure that the (single) address we use with counterparty has some bitcoin in it. If you happen to know that one of your existing addresses in bitcoin-qt definitely contains bitcoin you could use that instead, but the interface doesn’t make it easy to discover this.

* If your bitcoin-qt wallet is encrypted, you’ll need to unlock it. To unlock it for half an hour (18000 seconds) open bitcoin-qt’s “debug window”, go to the console, and enter:
[tt]walletpassphrase “my password here” 18000[/tt]

Now, in a new command window, you can do:

* [tt]counterpartyd market[/tt]  to see the current state of the market.

* [tt]counterpartyd market --give-asset XCP[/tt]  will filter to only show offers to sell XCP

* You can also see the order book here: http://blockscan.com/order_book.aspx

* [tt]counterpartyd order --source --get-quantity 2 --get-asset XCP --give-quantity 0.008 --give-asset BTC --expiration 100 --fee_provided .0001 [/tt]  will place an offer for 2 XCP @0.004 BTC per each (the quantities in the command are total quantities, not a per-each rate; so eg. if you want to buy 2 XCP @ 0.004 each, your give-quantity should be 0.008. Double tripple check that you put the decimal places in the right place. The expiration is the number of blocks your offer is valid for - don’t make this too low!

* It’ll cost you the fee (eg. 0.0001 - don’t make this zero!) plus the cost of inserting some arbitrary data in the bitcoin blockchain (0.0001086 x 2, or possibly x 3 with the current implementation) to publish the offer. ie. roughly 20 or 30 cents worth of bitcoin.

* You’ll have to wait for a block or two before your offer makes it into the blockchain. You can check the front page of http://blockchain.info to see how long it has been since bitcoin last found a block. Wait for a new one. When your offer is published you’ll see it show up here: http://blockscan.com/order.aspx (search that page for your address)

* Wait for a match. When your offer is matched (either partially or completely, or fully) you’ll see a “view matched orders” link next to your order on this page: http://blockscan.com/order.aspx - that means it’s awaiting payment!

* [tt]counterpartyd market[/tt]    has a section called “Order Matches Awaiting BTC Payment from You”. You should see a long ID (hash) in there, and an expiration time. This is the number of blocks that you have left to publish payment. If the expiration is lower than, say, 5, be very careful. If you try to pay, but your payment makes it into a block after the offer has expired then you will lose the BTC and not receive any XCP. You’re safer to ignore any offers that are close to expiry and just let them expire.

* If you want to pay, copy the hash from the step above to the clipboard, and then paste it into the right spot at the end of this command:
[tt]counterpartyd btcpay --order-match-id [/tt]

* Wait for your payment to make it into a block.

* Check your address on http://blockscan.com (you can put it in the search box.) You should see a completed btcpay, and your XCP balance should reflect your purchase.

* [tt]counterpartyd wallet[/tt]  will also show you your balances, as they appear to counterpartyd. This should (hopefully!) match.

Notes:

* [tt]counterpartyd --help[/tt]    will get you a generally useful list of all commands

* [tt]counterpartyd --help[/tt]    will get you specific help for a particular command





[quote author=gacrux link=topic=65.msg301#msg301 date=1391839052]
Presuming you’ve got counterpartyd installed, and running ([tt]counterpartyd server[/tt]  will start it) and it has finished scanning up until the latest block (block 284743 at the time I’m posting) then:

* Open bitcoin-qt, go to the receive tab and add a new address. Label it “counterparty funds” or something so you won’t forget which one it is. Copy the address to clipboard.

* Send some bitcoins to this address, ideally from somewhere else (eg. your mobile phone.) AFAIK bitcoin-qt doesn’t easily let you move coins between addresses it controls. It treats them all as a single lump sum, and hides the details about what address the coins actually belong to from the user. For our purposes we just want to ensure that the (single) address we use with counterparty has some bitcoin in it. If you happen to know that one of your existing addresses in bitcoin-qt definitely contains bitcoin you could use that instead, but the interface doesn’t make it easy to discover this.

* If your bitcoin-qt wallet is encrypted, you’ll need to unlock it. To unlock it for half an hour (18000 seconds) open bitcoin-qt’s “debug window”, go to the console, and enter:
[tt]walletpassphrase “my password here” 18000[/tt]

Now, in a new command window, you can do:

* [tt]counterpartyd market[/tt]  to see the current state of the market.

* [tt]counterpartyd market --give-asset XCP[/tt]  will filter to only show offers to sell XCP

* You can also see the order book here: http://blockscan.com/order_book.aspx

* [tt]counterpartyd order --source --get-quantity 2 --get-asset XCP --give-quantity 0.008 --give-asset BTC --expiration 100 --fee_provided .0001 [/tt]  will place an offer for 2 XCP @0.004 BTC per each (the quantities in the command are total quantities, not a per-each rate; so eg. if you want to buy 2 XCP @ 0.004 each, your give-quantity should be 0.008. Double tripple check that you put the decimal places in the right place. The expiration is the number of blocks your offer is valid for - don’t make this too low!

* It’ll cost you the fee (eg. 0.0001 - don’t make this zero!) plus the cost of inserting some arbitrary data in the bitcoin blockchain (0.0001086 x 2, or possibly x 3 with the current implementation) to publish the offer. ie. roughly 20 or 30 cents worth of bitcoin.

* You’ll have to wait for a block or two before your offer makes it into the blockchain. You can check the front page of http://blockchain.info to see how long it has been since bitcoin last found a block. Wait for a new one. When your offer is published you’ll see it show up here: http://blockscan.com/order.aspx (search that page for your address)

* Wait for a match. When your offer is matched (either partially or completely, or fully) you’ll see a “view matched orders” link next to your order on this page: http://blockscan.com/order.aspx - that means it’s awaiting payment!

* [tt]counterpartyd market[/tt]    has a section called “Order Matches Awaiting BTC Payment from You”. You should see a long ID (hash) in there, and an expiration time. This is the number of blocks that you have left to publish payment. If the expiration is lower than, say, 5, be very careful. If you try to pay, but your payment makes it into a block after the offer has expired then you will lose the BTC and not receive any XCP. You’re safer to ignore any offers that are close to expiry and just let them expire.

* If you want to pay, copy the hash from the step above to the clipboard, and then paste it into the right spot at the end of this command:
[tt]counterpartyd btcpay --order-match-id [/tt]

* Wait for your payment to make it into a block.

* Check your address on http://blockscan.com (you can put it in the search box.) You should see a completed btcpay, and your XCP balance should reflect your purchase.

* [tt]counterpartyd wallet[/tt]  will also show you your balances, as they appear to counterpartyd. This should (hopefully!) match.

Notes:

* [tt]counterpartyd --help[/tt]    will get you a generally useful list of all commands

* [tt]counterpartyd --help[/tt]    will get you specific help for a particular command
[/quote]


Thank you sir,
I appreciate the time you took to write this. Hopefully it will help someone else too.

I placed one order and it worked fine.




gacrux and 520bit grate work on the guides!
they helped me a lot.

Great work, guys! 520Bit, I am going to "sticky" your bitcointalk guide in "Basics", because I think the step-by-step guide + screenshots will be really helpful for people.

[quote author=bindy link=topic=65.msg310#msg310 date=1391871542]
Thank you sir,
I appreciate the time you took to write this. Hopefully it will help someone else too.

I placed one order and it worked fine.
[/quote]

Haha, no problem. Glad you got it to work. It’s a pretty cool feeling when you see it in action!

I only just figured this stuff out the day before I wrote that post. Always happy to help another newbie :slight_smile:

I just pounded out a guide in the newbie thread, before I saw this. 

tldr:  To buy XCP with BTC use two shells and these commands, read their output, and use their help (-h), and it’ll be pretty hard to screw up:

1. counterpartyd server
2. counterpartyd market --give-asset XCP --get-asset BTC
2. counterpartyd market --give-asset BTC --get-asset XCP
3. counterpartyd order -h
4. counterpartyd market --give-asset BTC --get-asset XCP #Watch for your order matched
5. counterpartyd btcpay --order-match-id XXXXXXXXXXXXXXXXXXXXXXXXXXXXX
6. counterpartyd wallet