Skip to content

Instantly share code, notes, and snippets.

View chengwenxi's full-sized avatar
🎯
Focusing

vincent chengwenxi

🎯
Focusing
  • Asia
View GitHub Profile
#!/bin/bash
sequence=$(iriscli bank account $(iriscli keys show acct0 -o json | jq -r '.address') -o json | jq -r '.value.sequence')
export total=$2
for ((i=1; i<=$1; i++))
do
echo $sequence
export sequence=$sequence
export service_name="price_service"
echo 1234567890 | iriscli service call --sequence=$sequence --chain-id test --from acct0 --fee 0.3iris --service-name $service_name --data "{\"base\":\"link\",\"quote\":\"usdt\"}" --providers $(iriscli keys show provider1 -o json | jq -r '.address'),$(iriscli keys show provider2 -o json | jq -r '.address') --service-fee-cap 1iris --timeout 2 --frequency 5 --repeated --total=$total --async
@chengwenxi
chengwenxi / ibc-test.md
Last active November 13, 2019 09:02
track ibc process

IBC Test

Environment setup

cd ~ && rm -r ibc-testnets && mkdir ibc-testnets && cd ibc-testnets
gaiad testnet -o chain-1 --v 1 --chain-id chain-1 --node-dir-prefix n
gaiad testnet -o chain-2 --v 1 --chain-id chain-2 --node-dir-prefix n
@chengwenxi
chengwenxi / restart.sh
Last active November 7, 2019 03:46
Monitor the iris process and restart it
#!/bin/bash
PROCESS_NUM=`ps -ef | grep iris | grep -v grep | wc -l`
if [ $PROCESS_NUM -eq 0 ];
then
echo "start iris"
/home/ubuntu/testnet/iris start --home /home/ubuntu/testnet/node/ > /home/ubuntu/testnet/info.log &
else
echo "iris is running"
fi
@chengwenxi
chengwenxi / Tendermint_test.html
Created July 12, 2019 06:35
tendermint subscribe
<!DOCTYPE html>
<meta charset="utf-8" />
<title>WebSocket Test</title>
<script language="javascript"type="text/javascript">
var wsUri ="ws://localhost:26657/websocket";
var output;
function init() {
output = document.getElementById("output");
testWebSocket();
@chengwenxi
chengwenxi / Bech32Test.java
Last active April 30, 2019 11:08
Bech32 address decode test fot IRISnet.
package org.irisnet.irishub;
// com.google.guava:guava:27.1-jre
import com.google.common.primitives.Bytes;
import com.sun.tools.javac.util.Pair;
import org.junit.Test;
import java.util.ArrayList;
import java.util.List;
@chengwenxi
chengwenxi / IRISnet_params.md
Last active September 4, 2019 08:52
All governance params in IRISnet
Key type genesis value range description/usage note
auth/gasPriceThreshold sdk.Int 6000000000000 [0, 1*10^18] the minimum of gas price (gas price最小值)
auth/txSizeLimit int 1000 [500, 1500] transaction size limit (交易的最大字节数)
mint/Inflation sdk.Dec 4% [0, 0.2] inflation rate (增发率)
stake/UnbondingTime time.Duration 3weeks [2weeks,) unbonding time (解绑时间) the locking time of unbonding and redelegation (解除绑定或转委托时的锁定时间)
stake/MaxValidators int 100 [100, 200] the maximum number of validators (validator最大数量)
distr/CommunityTax sdk.Dec 0.02 (0, 0.2] community tax (社区税率)
distr/BaseProposerReward sdk.Dec 0.01 (0, 0.02] base ratio of the block reward(出块奖励的基准比例)
distr/BonusProposerReward sdk.Dec 0.04 (0, 0.08] maximum additional ratio bonus ratio(额外奖励的最大比例)
@chengwenxi
chengwenxi / TxTest.java
Created March 31, 2019 09:37
Get tx hash from tx
package org.irisnet.irishub;
import org.junit.Test;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.Base64;
public class TxTest {

Keybase proof

I hereby claim:

  • I am chengwenxi on github.
  • I am vincentch (https://keybase.io/vincentch) on keybase.
  • I have a public key ASDuOLZ_qUbLOVj4I9MCfbEJEZEvUl_zZEsP81UOpjPWbwo

To claim this, I am signing this object: