How do I write a Smart Contract?

My understand is that Smart Contracts are working as of a few weeks ago, I’ve got one in mind that I’d like to write… how can I get started doing this?  Where do I write my code?  How do I test it?


Thank you!
  1. See how it’s done for Ethereum. It works the same on Counterparty.
  2. Currently you need to run counterpartyd develop branch edition on testnet in order for compiled Ethereum smart contracts to work (until a new release that supports mainnet comes out).

http://etherscripter.com/0-5-1/

can this be used?  devtest-testnet.counterwallet.io

@dom 


- Read this for examples:
http://counterparty.io/news/counterparty-recreates-ethereums-smart-contract-platform-on-bitcoin/
- devtest-testnet: 
I think that’s the current code running mainnet/testnet and I believe it was upgraded to the latest version (9.49.x) but I don’t think you can publish Smart Contracts (maybe you can, I haven’t tried) that way. The URL above shows it in the CLI, but I don’t know if API is ready (check the docs). If it’s not, then you’d need a local counterpartyd server. Instructions can be found on the main Web site http://counterparty.io/docs/build-system/ (read “set up bitcoind” and “build from source”). You can use Insight (instructions are on the same page) or Bitcoin Core with jmcorgan addrindex patch.
A recent discussion related to common problems setting it up is here: https://forums.counterparty.io/discussion/comment/4303

Has anyone managed to run any Smart Contracts?  I’m running my own counterpartyd 9.49, develop/testnet.  Counterpartyd runs ok and I have also managed to execute unit_test.py but I can’t get contracts_test.py to execute.  I believe I may need pyethereum.  Should this be included in the develop source or should it be obtained from Ethereum’s git hub?

Thanks,

Jason

I haven’t tried that stuff yet, but I think you should get it from Ethereum’s Github because if I recall correctly the idea is not to diverge from Ethereum’s implementation and therefore we should use their repo to get that.