Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testing rosetta locally with alt coin #434

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ run-config: check-built
$(BUILDDIR)/provenanced -t --home $(BUILDDIR)/run/provenanced add-genesis-account validator 100000000000000000000nhash --keyring-backend test ; \
$(BUILDDIR)/provenanced -t --home $(BUILDDIR)/run/provenanced gentx validator 1000000000000000nhash --keyring-backend test --chain-id=testing; \
$(BUILDDIR)/provenanced -t --home $(BUILDDIR)/run/provenanced add-genesis-marker 100000000000000000000nhash --manager validator --access mint,burn,admin,withdraw,deposit --activate --keyring-backend test; \
$(BUILDDIR)/provenanced -t --home $(BUILDDIR)/run/provenanced collect-gentxs; \
$(BUILDDIR)/provenanced -t --home $(BUILDDIR)/run/provenanced collect-gentxs ; \
fi ;

run: check-built run-config;
Expand Down
4 changes: 2 additions & 2 deletions client/rosetta/configuration/rosetta.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"blockchain": "provenance",
"network": "testing"
},
"online_url": "http://rosetta:8080",
"online_url": "http://localhost:8080",
"data_directory": "",
"http_timeout": 300,
"max_retries": 5,
Expand All @@ -13,7 +13,7 @@
"tip_delay": 60,
"log_configuration": true,
"construction": {
"offline_url": "http://rosetta:8080",
"offline_url": "http://localhost:8080",
"max_offline_connections": 0,
"stale_depth": 0,
"broadcast_limit": 0,
Expand Down
5 changes: 3 additions & 2 deletions client/rosetta/configuration/send_funds.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/sh

set -e
addr=$(provenanced -t keys show node0 -a --keyring-backend=test --home=/testrosetta/node0)
echo "12345678" | provenanced -t tx bank send "$addr" "$1" 100000000000nhash --chain-id="chain-local" --node tcp://provenance:26657 --yes --keyring-backend=test --home=/testrosetta/node0 --gas-prices="1nhash" --gas=auto --gas-adjustment=1.5
addr=$(provenanced -t keys show fredkneeland -a --keyring-backend=test --home=/Users/fredkneeland/code/provenance/build/run/provenanced)
echo "12345678" | provenanced -t tx bank send "$addr" "$1" 100000000000nhash --chain-id="testing" --node tcp://localhost:26657 --yes --keyring-backend=test --home=/Users/fredkneeland/code/provenance/build/run/provenanced --gas-prices="1905nhash" --gas=auto --gas-adjustment=1.5
echo "12345678" | provenanced -t tx bank send "$addr" "$1" 10bitcoin --chain-id="testing" --node tcp://localhost:26657 --yes --keyring-backend=test --home=/Users/fredkneeland/code/provenance/build/run/provenanced --gas-prices="1905nhash" --gas=auto --gas-adjustment=1.5
16 changes: 8 additions & 8 deletions client/rosetta/configuration/transfer.ros
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
request_funds(1){
find_account{
currency = {"symbol":"nhash", "decimals":0};
currency = {"symbol":"bitcoin", "decimals":0};
random_account = find_balance({
"minimum_balance":{
"value": "0",
Expand All @@ -14,7 +14,7 @@ request_funds(1){
address = {{account_identifier.address}};
idk = http_request({
"method": "POST",
"url": "http:\/\/faucet:8000",
"url": "http:\/\/localhost:8000",
"timeout": 10,
"body": {{random_account.account_identifier.address}}
});
Expand All @@ -26,7 +26,7 @@ request_funds(1){
loaded_account = find_balance({
"account_identifier": {{random_account.account_identifier}},
"minimum_balance":{
"value": "50",
"value": "5",
"currency": {{currency}}
}
});
Expand All @@ -50,18 +50,18 @@ create_account(1){
transfer(3){
transfer{
transfer.network = {"network":"testing", "blockchain":"provenance"};
currency = {"symbol":"nhash", "decimals":0};
currency = {"symbol":"bitcoin", "decimals":0};
sender = find_balance({
"minimum_balance":{
"value": "100000000000",
"value": "10",
"currency": {{currency}}
}
});
acc_identifier = {{sender.account_identifier}};
sender_address = {{acc_identifier.address}};
// Set the recipient_amount as some value <= sender.balance-max_fee
max_fee = "1000";
fee_amount = "1";
max_fee = "10";
fee_amount = "0";
fee_value = 0 - {{fee_amount}};
available_amount = {{sender.balance.value}} - {{max_fee}};
recipient_amount = random_number({"minimum": "1", "maximum": {{available_amount}}});
Expand Down Expand Up @@ -98,7 +98,7 @@ transfer(3){
}
];
transfer.preprocess_metadata = {
"gas_price": "1000nhash",
"gas_price": "4762500000nhash",
"gas_limit": 250000
};
}
Expand Down