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

docs: feegrant with curl #1779

Open
jcstein opened this issue Nov 4, 2024 · 0 comments
Open

docs: feegrant with curl #1779

jcstein opened this issue Nov 4, 2024 · 0 comments

Comments

@jcstein
Copy link
Member

jcstein commented Nov 4, 2024

add to feegrant guide, or make new guide on doing with curl

  1. start local light node for mocha:
    celestia light start --p2p.network mocha --core.ip rpc-mocha.pops.one
  2. in 2nd terminal, export auth token, so you can send curls without disabling auth.
    CELESTIA_NODE_AUTH_TOKEN=$(celestia light auth admin --p2p.network mocha)
    (in theory, you could disable auth when starting node with --rpc.skip-auth)
  3. get my key's address of running node in same terminal. set as variable
    GRANTER_ADDRESS=$(celestia state account-address | jq -r .result) && echo $GRANTER_ADDRESS
    also set grantee address (the address you want to have the grant)
    GRANTEE_ADDRESS=celestia1377k5an3f94v6wyaceu0cf4nq6gk2jtpc46g7h
  4. send curl with those vars
curl -H "Content-Type: application/json" -H "Authorization: Bearer $CELESTIA_NODE_AUTH_TOKEN" -X POST --data "{
  \"id\": 1,
  \"jsonrpc\": \"2.0\",
  \"method\": \"state.GrantFee\",
  \"params\": [
    \"$GRANTEE_ADDRESS\",
    \"42\",
    {
      \"gas_price\": 0.002,
      \"is_gas_price_set\": true,
      \"gas\": 142225,
      \"key_name\": \"my_celes_key\",
      \"signer_address\": \"$GRANTER_ADDRESS\",
      \"fee_granter_address\": \"$GRANTER_ADDRESS\"
    }
  ]
}" http://localhost:26658/
  1. see result on celenium
{"id":1,"jsonrpc":"2.0","result":{"height":3068554,"txhash":"4AAFDA4CE622C56CE9681B7E3BE7773E3B36ABE6C02BD66111BD2F2491011FD2","logs":null,"events":null}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant