original endpoint sales kit
oreki is a package for sale API that you developed. You can choose bitcoin or ethereum.
| OS | Amazon Linux2 |
| Storage | about 500GB |
cd /path/to/oreki
cd install-script
./install-yum.sh
./install-golang.sh
# set up GOPATH and golang etc
./install-glide.sh
./install-lnd.sh
# install btcd or bitcoind(optional)
# ./install-btcd.sh
# ./install-bitcoind.sh
# install geth for using ethereum(optional)
# ./install-geth.shIf you want to use ethereum, read here
If you want to build bitcoin fullnode, use btcd, and read here.
If you want to use bitcoind, read here.
If you don't want to build bitcoin node, use neutrino mode of lnd, and read here. This solution is to trust other server. It's easy, but you don't get real benefit of blockchain.
check here
1. install oreki-node to your project
npm install oreki-node2. copy rpc.proto from this repository to your project
3. make "config.json" from example(bitcoin) or example(ethereum)
4. import oreki module
5. initialize oreki object and call init function
6. set event handler that notices payment
7. register payment reservation
8. call start function to check transactions
-
Call addPayment function, and let customer know invoice decoded
-
Customer connects to your lnd node using your public key
-
Customer opens payment channel
-
Customer pays to you by invoice
-
Customer closes payment channel
const Oreki = require("oreki-node").Orekiconst oreki = new Oreki("config file path")
oreki.init().then(function(success) {
if (!success) {
//It failed
}
})oreki.on("paid", function(payment) {
//increment api point from payment.point and payment.user_id and payment.endpoint_id
})
oreki.on("insufficient", function(payment) {
// when the payment is insufficient
// ethereum only
})oreki.start()oreki.addPayment(<user_id: string>, <endpoint_id: string>, <point: int>, <bitcoin amount: int>).then(function(payment) {
//payment.payee: bitcoin invoice or ethereum address
})
//oreki.addPayment("user_id", "endpoint_id", 100, 1000)- Create 2 processes of lnd(as Alice and Bob)
- Set password "HelloWorld" to Alice and Bob
- Get coins with 2 accounts by testnet faucet more than 10000
- Run "npm test"
- Fork oreki-node
- Create your feature branch (git checkout -b my-new-feature)
- Implement it and check it runs(npm test)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create new Pull Request
MIT License