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

#7 name resolution #12

Merged
merged 4 commits into from
May 9, 2024
Merged

#7 name resolution #12

merged 4 commits into from
May 9, 2024

Conversation

mvandeberg
Copy link
Member

Resolves #7

Brief description

Name resolution already works. All we need is a way to change resolution depending on network. Ideally, we would call the nameservice, but Koilib does not have an abstract for that. Instead, we can rely on env vars and change config accordingly.

Checklist

  • I have built this pull request locally
  • I have ran the unit tests locally
  • I have manually tested this pull request
  • I have reviewed my pull request
  • I have added any relevant tests

Demonstration

❯ curl -X 'GET' \
  'http://localhost:3000/v1/token/koin/name' \
  -H 'accept: application/json' | jq
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100    16    0    16    0     0     18      0 --:--:-- --:--:-- --:--:--    18
{
  "value": "Koin"
}
❯ export JSONRPC_URL="http://localhost:8081"
❯ export KOIN_ADDRESS="1FaSvLjQJsCJKq5ybmGsMMQs8RQYyVv8ju"
❯ yarn dev
  ...
❯ curl -X 'GET' \
  'http://localhost:3000/v1/token/koin/name' \
  -H 'accept: application/json' | jq
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100    21    0    21    0     0    739      0 --:--:-- --:--:-- --:--:--   750
{
  "value": "Test Koin"
}

@mvandeberg mvandeberg requested a review from sgerbino May 6, 2024 20:40
@sgerbino
Copy link
Member

sgerbino commented May 7, 2024

If our ABI works, why can't we use the name service?

@mvandeberg
Copy link
Member Author

The name service should be looked up via invoke_system_call, not by calling the contract address directly. It can be done, but is it worth the dev work to do it right now?

@sgerbino sgerbino merged commit fcf3149 into master May 9, 2024
@sgerbino sgerbino deleted the 7-name-resolution branch May 9, 2024 01:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants