Skip to content

Commit

Permalink
Update CPP example.
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenatcrypto committed Nov 20, 2022
1 parent 0049f15 commit 1595083
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
7 changes: 5 additions & 2 deletions example/cpp-example/chainmain.cc
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ void chainmain_process() {
cout << "export MYCOSMOSRPC=\"http://yourcosmosnode:1317\"" << endl;
cout << "export MYTENDERMINTRPC=\"http://yourcosmosnode:26657\"" << endl;
cout << "export MYGRPC=\"http://yourcosmosnode:9091\"" << endl;
cout << "export MYGRPCWEB=\"http://yourcosmosnode:26808\"" << endl;
cout << "export MYCHAINID=your-chainid-1" << endl;
cout << "export MYFROM=cro1yourwalletaddress" << endl;
cout << "export MYTO=cro1yourreceiveraddress" << endl;
Expand All @@ -235,16 +236,18 @@ void chainmain_process() {
String myfrom = getEnv("MYFROM");
String myto = getEnv("MYTO");
String myamount = getEnv("MYAMOUNT");
// TODO: Will delete after updating `query_account_details` with `MYGRPCWEB`.
String myservercosmos = getEnv("MYCOSMOSRPC"); /* 1317 port */
String myservertendermint = getEnv("MYTENDERMINTRPC"); /* 26657 port */
String mygrpc = getEnv("MYGRPC"); /* 9091 port */
String mygrpcweb = getEnv("MYGRPCWEB"); /* 26808 port */

Box<Wallet> mywallet = createWallet(mymnemonics);
cout << "transfer from " << myfrom << " to " << myto << " amount " << myamount
<< endl;
String success, fail;
String result = mywallet->get_default_address(CoinType::CryptoOrgMainnet);
String balance =
query_account_balance(myservercosmos, myfrom, tx_info.fee_denom);
String balance = query_account_balance(mygrpcweb, myfrom, tx_info.fee_denom);
cout << "balance=" << balance.c_str() << endl;
String detailjson = query_account_details(myservercosmos, myfrom);
cout << "detailjson=" << detailjson.c_str() << endl;
Expand Down
1 change: 1 addition & 0 deletions scripts/.env
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export MYCOSMOSRPC="http://127.0.0.1:26804"
export MYCRONOSRPC="http://127.0.0.1:26651"
export MYTENDERMINTRPC="http://127.0.0.1:26807"
export MYGRPC="http://127.0.0.1:26803"
export MYGRPCWEB="http://127.0.0.1:26808"
export MYCHAINID=chainmain-1
export MYFROM=cro1u08u5dvtnpmlpdq333uj9tcj75yceggszxpnsy
export MYTO=cro1apdh4yc2lnpephevc6lmpvkyv6s5cjh652n6e4
Expand Down

0 comments on commit 1595083

Please sign in to comment.