Feature #8
Evaluate MultiChain
Description
MultiChain is a fork of Bitcoin, with changes making it easy to deploy arbitrary / private blockchains with custom configuration. Also see "this nice overview by Roderik": https://labs.kunstmaan.be/blog/hands-on-with-multichain
At the moment only binaries are available, but they promise to open source it soon.
"Instructions":http://www.multichain.com/getting-started/
History
#1 Updated by didi about 8 years ago
- Description updated (diff)
Since the getting started example assumes 2 hosts (server running the blockchain and a connecting client), I quickly fired up a CT (id 106) multichain.d10r.net.
root@multichain:~/multichain# multichain-util create c2
MultiChain utilities build 1.0 alpha 23 protocol 10005
Blockchain parameter set was successfully generated.
You can edit it in /root/.multichain/c2/params.dat before running multichaind for the first time.
To generate blockchain please run "multichaind c2 -daemon".
root@multichain:~/multichain# multichaind c2 -daemon
MultiChain Core Daemon build 1.0 alpha 23 protocol 10005
MultiChain server starting
Looking for genesis block...
Genesis block found
New users can connect to this node using
multichaind c2@192.168.2.106:7763
Node started
Note: Since this is a CT without global IP, the port was forwarded on the host:
iptables -A PREROUTING -t nat -i eth0 -p tcp -m tcp --dport 7763 -j DNAT --to-destination 192.168.2.106:7763
Now on a client:
multichaind c2@multichain.d10r.net:7763
MultiChain Core Daemon build 1.0 alpha 23 protocol 10005
Retrieving blockchain parameters from the seed node multichain.d10r.net:7763 ...
Blockchain successfully initialized.
Please ask blockchain admin or user having activate permission to let you connect and/or transact:
multichain-cli c2 grant 1a439FKtj9jTgrJJ4y2E5wKx2iU92TxooHXUo6 connect
multichain-cli c2 grant 1a439FKtj9jTgrJJ4y2E5wKx2iU92TxooHXUo6 connect,send,receive
Btw. it looks like the port may be chosen somewhat randomly (?). Which makes sense if more then 1 chains should run alongside.
#2 Updated by didi about 8 years ago
- Tracker changed from Bug to Feature
- Description updated (diff)
wallet address: @1a439FKtj9jTgrJJ4y2E5wKx2iU92TxooHXUo6@
root@multichain:~/multichain# ./multichain-cli c2 grant 1a439FKtj9jTgrJJ4y2E5wKx2iU92TxooHXUo6 connect,send,receive
{"method":"grant","params":["1a439FKtj9jTgrJJ4y2E5wKx2iU92TxooHXUo6","connect,send,receive"],"id":1,"chain_name":"c2"}
425edde1a362a14d3a91e5d707ace3d4c242b951761b0c1340a06e33020270b5
didi@birne:~/src/multichain$ multichaind c2@multichain.d10r.net:7763
MultiChain Core Daemon build 1.0 alpha 23 protocol 10005
Retrieving blockchain parameters from the seed node multichain.d10r.net:7763 ...
New users can connect to this node using
multichaind c2@192.168.0.155:7763
Node started
Now I went on with chapter 3 of the guide, Some commands in interactive mode. Everything works fine as expected.
Where to go from here?
I could build a simple web app which interacts with the blockchain.
This may also be a good moment to take a look at the "Bitcoin API":https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list which MultiChain extends.
Then find out if it would be suited for the BP demo.
#3 Updated by didi about 8 years ago
Roderik also created a docker based demo :-)
Trying... https://labs.kunstmaan.be/blog/open-sourcing-a-php-library-and-docker-development-images-for-multichain
didi@birne:~/src/multichain$ docker-compose up
...
explorer_1 | failed to load /root/.multichain/multichain.conf: [Errno 2] No such file or directory: u'/root/.multichain/multichain.conf'
explorer_1 | catch_up_rpc: abort
explorer_1 | Skipping datadir /root/.multichain/: [Errno 2] No such file or directory: u'/root/.multichain/blocks/blk00000.dat'
explorer_1 | Traceback (most recent call last):
explorer_1 | File "/usr/lib/python2.7/wsgiref/handlers.py", line 85, in run
explorer_1 | self.result = application(self.environ, self.start_response)
explorer_1 | File "/root/.local/lib/python2.7/site-packages/Mce/abe.py", line 317, in call
explorer_1 | handler(page)
explorer_1 | File "/root/.local/lib/python2.7/site-packages/Mce/abe.py", line 494, in handle_chains
explorer_1 | '$("#recenttx").load(\'' + page['dotdot'] + urllib.quote(name, safe='') + '/recent?random=\' + Math.random().toString() )'
explorer_1 | UnboundLocalError: local variable 'name' referenced before assignment
explorer_1 | 127.0.0.1 - - [07/Sep/2016 21:09:06] "GET / HTTP/1.1" 500 59
:-(
Trying another version: https://raw.githubusercontent.com/Kunstmaan/hands-on-with-multichain/master/docker-compose.yml