owned this note
owned this note
Published
Linked with GitHub
# OurChain
* OurChain is a [Benevolence blockchain](/KpMx2d-wQd2t_gwQ97D9Cg#Neutral-Blockchain) in PreICO stage. [name=薛智文][time=Sat, Oct 31, 2020 9:05 PM]
## Paper
* [Toward Trusted IoT by General Proof-of-Work (2023)](https://doi.org/10.3390/s23010015)
* [Toward Blockchain Realization (2022)](https://doi.org/10.3390/fintech1010007)
## Notes
1. Source code: [OurChain Release](https://bitbucket.org/lab408/ourchain-release/src/test_version/)
2. [OurChain Installation](https://bitbucket.org/lab408/ourchain-release/src/defe4ecec8421bdc527f8b8c04ddf89814fa6844/doc/build-unix.md?at=ourcontract&fileviewer=file-view-default) | [手把手教學, Getting Started](https://hackmd.io/Bo8C0LogQfmq_eSuOExr0w?both) [name=陳彥碩][time=Tue, Feb 13, 2024]
3. [ID example (with AID)](https://bitbucket.org/lab408/aidtoolbeta/src/master/data/chainid.c), [video link](https://www.youtube.com/playlist?list=PLphz3qKbBDoqTt1mqGx169VQlLIpg8wQR&fbclid=IwAR19qudY66A-jcmZnJYZywO7S1qETJITLsDggVWcYXr3cQr_Kwk-06gCLEc) | :new: [readme](https://hackmd.io/@_kggzXFaSc-cdJpZyjL8mg/r1Ob98sxo) [time=Wed, Sep 14, 2022 ]
4. [ Voting example (with OurContract)](https://bitbucket.org/lab408/voting_web/src/master/) [readme](https://hackmd.io/@ruNtQ2DrSyCIWh1DTdkRkg/Hk4jn2qFH) | :new: [readme](https://hackmd.io/@_kggzXFaSc-cdJpZyjL8mg/r1xTgEXZj) [time=Tue, Sep 20, 2022 ]
5. [ORC20 (In OurChain as ERC20)](https://bitbucket.org/lab408/ourchain-release/src/ourcontract/example/orc20.c)
6. [Our wallet (An example for our wallet)](https://bitbucket.org/lab408/androidappofourchaingamma/src/master/)
7. [signatures](https://bitbucket.org/lab408/idchain/src) this is about to verify signatures in OurContract. Watch the src/Makefile.am for linking secp256k1 to OurContract , the function signature_verify in [libourcontract.c](https://bitbucket.org/lab408/idchain/src/master/src/contract/libourcontract.c) line 227 for verifying signature in OurContract.
8. Please run OurChain with private IP to avoid 計中 banging your IP.
9. Avoid call contract in contract.
10. Ubuntu L2TP vpn setup (virtual box 5.2.26, 6.0.4, NAT networked) [16.04](https://medium.com/@hkdb/ubuntu-16-04-connecting-to-l2tp-over-ipsec-via-network-manager-204b5d475721) [18.04, 18.10](https://help.vpntunnel.com/support/solutions/articles/5000782608-vpntunnel-l2tp-installation-guide-for-ubuntu-18-04-)
[(if ubuntu 18 does not work, try "sudo add-apt-repository universe" first)](https://askubuntu.com/questions/1065255/cannot-install-network-manager-l2tp-on-ubuntu18-04?fbclid=IwAR02Kb4zez_p-yJvbE1MiDUG_BMubB0f3DWEjZtzkGJNrzXhpywhn4m3KYU)
Besides user name, password and vpn server ip, remember to enter share secret (in ipsec settings)
11. using bitcoin_rpc in nodejs
**ref** : [for node js](https://www.npmjs.com/package/node-bitcoin-rpc)
**deploy contract**: [example](https://bitbucket.org/lab408/voting_web/src/master/routes/commands.js)
line19-line32 is how to deploy contract
in line 20 : var argvs = ["./vote.c", "sign_up", req.params.name, key];
vote.c is the contract you want to deploy.
And sign_up is a function you want to call in vote.c.
Arguments after that is the arguments of sign_up
you can get contract id: rpc_res.result(in line 27)
**call contract**: After successfully deploy contract you will get the contract id in return
[example](https://bitbucket.org/lab408/voting_web/src/master/routes/command.js) line42-65
your argvs (in line42): argvs = [req.body.txid, req.params.command, req.params.name, key, req.body.vote_for];
which req.body.txid is your contract id
req.params.command is your function in the contract
arguments after that is your function arguments
see line 47-65 to know how actually to call contract
**Every bitcoin_rpc should be called after bitcoin_rpc.init**
12. [測試鏈連接教學](https://hackmd.io/@jKIkT8QLQ4SzITq06RQTvQ/S1_uUGswP?fbclid=IwAR02inzFtoU64d628ujxi_HYD_r6dloPxJjbwii9rAj_hS79qMWKSOFyS3E)
## How-to's and tutorials
NOTE: These docs have been moved to Google Drive, please edit there: https://drive.google.com/drive/folders/1EBwQPmW7LtUSkdaHDI-tJyWL61awl5tX
1. [OurChain Installation](https://bitbucket.org/lab408/ourchain-release/src/defe4ecec8421bdc527f8b8c04ddf89814fa6844/doc/build-unix.md?at=ourcontract&fileviewer=file-view-default)
1. [Regtest nodes in docker and rpc examples](https://hackmd.io/s/H1108hT9V)
1. [Debugging using Visual Studio Code](https://hackmd.io/s/Hy64MVDoE)
1. [Performance tracing using google-perftool or valgrind](https://hackmd.io/9vfOfeK9SaSmFQZzIhGmig)
## ToDos
1. [Forum](https://hackmd.io/Nv9zOaytT0ukfa6dA3YWWw)
1. [TPS Testing](https://hackmd.io/5wbzu-6rQPql8tWbO8trUA?view)
1. OurScan
Questions
---
mail: cwhsueh@gmail.com
or edit here to add your problem
1. ......
2.