瀏覽代碼

Add 'lottery_SC_guide.md'

master
Captain 3 年之前
父節點
當前提交
577b9e91de
共有 1 個檔案被更改,包括 40 行新增0 行删除
  1. +40
    -0
      lottery_SC_guide.md

+ 40
- 0
lottery_SC_guide.md 查看文件

@@ -0,0 +1,40 @@
**Dero Stargate DVM Smart Contracts guide to install and test various function of lottery Smart Contracts.**

//Start Dero daemon in testnet mode.
```
/tmp/derod-linux --testnet
```

// Start Dero wallet in testnet.
```
./dero-wallet --rpc-server --wallet-file testnet.wallet --testnet
```

// Start Dero wallet second instance to test transfer/ownership functions etc.
```./dero-wallet --wallet-file testnet2.wallet --testnet --rpc-server --rpc-bind=127.0.0.1:30308```

//Dero Explorer
```
./explorer --rpc-server-address 127.0.0.1:30306
```



// Installing Smart Contract.
```
curl --request POST --data-binary @lottery.bas http://127.0.0.1:30309/install_sc
```

**Examples of various DVM lottery functions
**//Eg: To play lottery
curl -X POST http://127.0.0.1:30309/json_rpc -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":"0","method":"transfer_split","params":{"mixin":5,"get_tx_key": true , "sc_tx":{"entrypoint":"Lottery","scid":"ab82caa18753efa0f76e7266af7fdd7f11e0ada5e135bd63f1cd823f5e2c2fdc" , "value":4000000000000 } }}'


//Eg: Withdraw balance
curl -X POST http://127.0.0.1:30309/json_rpc -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":"0","method":"transfer_split","params":{"mixin":5,"get_tx_key": true , "sc_tx":{"entrypoint":"Withdraw","scid":"55aaf55b5203cd10f473a9bcf641f305885235e176270ae5e38ba6fa05dbf2b0", "params":{ "amount":"1" } } }}'

//Eg: To transfer ownership
curl -X POST http://127.0.0.1:30309/json_rpc -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":"0","method":"transfer_split","params":{"mixin":5,"get_tx_key": true , "sc_tx":{"entrypoint":"TransferOwnership","scid":"55aaf55b5203cd10f473a9bcf641f305885235e176270ae5e38ba6fa05dbf2b0", "params":{ "newowner":"dETohFmTunwF58wAs5Jn3d1N1oaJqwRxvarNJudUh95nVbZyigTja1W8Ljzp3j8VhxbB9gv3TBs4W5gnFa24cehz2cM6nUg84s" } } }}'

//Eg: To claim ownership
curl -X POST http://127.0.0.1:30308/json_rpc -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":"0","method":"transfer_split","params":{"mixin":5,"get_tx_key": true , "sc_tx":{"entrypoint":"ClaimOwnership","scid":"55aaf55b5203cd10f473a9bcf641f305885235e176270ae5e38ba6fa05dbf2b0" } }}'

Loading…
取消
儲存