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

[BENS] feat/support Pulse Domains Name Services #808

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

johnny-vu
Copy link

@johnny-vu johnny-vu commented Mar 22, 2024

CHANGELOG:

  • Support Pulse Domains Name Service on PulseChain

@johnny-vu johnny-vu changed the title Feat/support pns Draft Feat/support pns Mar 22, 2024
@johnny-vu johnny-vu changed the title Draft Feat/support pns Draft feat/support pulsechain name services Mar 22, 2024
@johnny-vu johnny-vu changed the title Draft feat/support pulsechain name services [Draft] [BENS] feat/support pulsechain name services Mar 22, 2024
@johnny-vu
Copy link
Author

johnny-vu commented Mar 27, 2024

Used the subgraph-writer tool to create the pns-subgraph for indexing the Pulse Domains Name Service (Mainnet).

graph-node=# select name, resolved_address, expiry_date
from sgd14.domain
where label_name is not null and block_range @> 2147483647
order by created_at
limit 100;
           name            |              resolved_address              | expiry_date
---------------------------+--------------------------------------------+-------------
 data.pls                  | 0x0bd898b04ba8f8dcbd9beed635c39ab32ea90d3d |  2339082295
 feed.pls                  | 0x0bd898b04ba8f8dcbd9beed635c39ab32ea90d3d |  2339082295
 registrar.pls             | 0x0bd898b04ba8f8dcbd9beed635c39ab32ea90d3d |  2339082295
 api.pls                   | 0x0bd898b04ba8f8dcbd9beed635c39ab32ea90d3d |  2339082295
 controller.pls            | 0x0bd898b04ba8f8dcbd9beed635c39ab32ea90d3d |  2339082295
 resolver.pls              | 0x2fdbb906b4fe68e31d928c1ed0b6a3bd1f204374 |
 pls.pls                   | 0xc12f5e348048174a6a68d27d725c786b22ac1dd1 |  2339082295
 helloworld.pls            | 0x77bf9e7ac2e0735e5dad4ad85725156e8ff126ee |  2339082295
 pns.pls                   | 0xc12f5e348048174a6a68d27d725c786b22ac1dd1 |  2339082295
 test123.pls               | 0x49a2296ca7c67c5ae6a9f820d6d17c518a47a077 |  1739931795
 testing1.pls              | 0x0bd898b04ba8f8dcbd9beed635c39ab32ea90d3d |  1739931805
 123.testing1.pls          |                                            |
 pay.test123.pls           | 0x2e4b09f5e5c7902fd0bb3f3bb68818fd92ad06bc |  1739931795
 send.test123.pls          |                                            |
 alex.helloworld.pls       | 0x9360b8d341923ae9771cf15cc8816c56d752f8b8 |
 hex.test123.pls           |                                            |  1739931795

@johnny-vu johnny-vu changed the title [Draft] [BENS] feat/support pulsechain name services [BENS] feat/support Pulse Domains Name Services Mar 27, 2024
@johnny-vu
Copy link
Author

@sevenzing I added configs for PNS on PulseChain, could you please have a look?

@johnny-vu
Copy link
Author

@johnny-vu
Copy link
Author

I got this error sgd12.domain\" does not exist when I trying to query data from BENS: https://bns.pulse.domains/api/v1/369/domains/kaito.pls

Here is the logs:

Mar 27 18:24:00 ip-172-31-16-254 bens-server[25976]: 2024-03-27T18:24:00.820032Z  INFO HTTP request{method=GET endpoint=/api/v1/{chain_id}/domains/{name} client_ip=149.154.161.214 request_id=709e5c7c-6587-4958-98db-9b27b20984fe}:get_domain{domain_name=DomainName { id: "0xdb5c3ace0a3eafd6eca3ba37f76cd3cfe03c51faf2d51c80fa32d07ae3852413", label_name: "kaito", name: "kaito.pls" } schema="sgd12" input=GetDomainInput { network_id: 369, name: "kaito.pls", only_active: false }}: bens_logic::subgraphs_reader::sql::domain: new
Mar 27 18:24:00 ip-172-31-16-254 bens-server[25976]: 2024-03-27T18:24:00.820637Z ERROR HTTP request{method=GET endpoint=/api/v1/{chain_id}/domains/{name} client_ip=149.154.161.214 request_id=709e5c7c-6587-4958-98db-9b27b20984fe}:get_domain{domain_name=DomainName { id: "0xdb5c3ace0a3eafd6eca3ba37f76cd3cfe03c51faf2d51c80fa32d07ae3852413", label_name: "kaito", name: "kaito.pls" } schema="sgd12" input=GetDomainInput { network_id: 369, name: "kaito.pls", only_active: false }}: bens_logic::subgraphs_reader::sql::domain: error=Db err
Mar 27 18:24:00 ip-172-31-16-254 bens-server[25976]: 2024-03-27T18:24:00.820669Z  INFO HTTP request{method=GET endpoint=/api/v1/{chain_id}/domains/{name} client_ip=149.154.161.214 request_id=709e5c7c-6587-4958-98db-9b27b20984fe}:get_domain{domain_name=DomainName { id: "0xdb5c3ace0a3eafd6eca3ba37f76cd3cfe03c51faf2d51c80fa32d07ae3852413", label_name: "kaito", name: "kaito.pls" } schema="sgd12" input=GetDomainInput { network_id: 369, name: "kaito.pls", only_active: false }}: bens_logic::subgraphs_reader::sql::domain: close time.busy=180µs time.idle=456µs
Mar 27 18:24:00 ip-172-31-16-254 bens-server[25976]: 2024-03-27T18:24:00.820685Z ERROR HTTP request{method=GET endpoint=/api/v1/{chain_id}/domains/{name} client_ip=149.154.161.214 request_id=709e5c7c-6587-4958-98db-9b27b20984fe}: bens_server::services::domain_extractor: error during request handle err=DbErr(Database(PgDatabaseError { severity: Error, code: "42P01", message: "relation \"sgd12.domain\" does not exist", detail: None, hint: None, position: Some(Original(521)), where: None, schema: None, table: None, column: None, data_type: None, constraint: None, file: Some("parse_relation.c"), line: Some(1371), routine: Some("parserOpenTable") }))
Mar 27 18:24:00 ip-172-31-16-254 bens-server[25976]: 2024-03-27T18:24:00.820730Z  INFO HTTP request{method=GET endpoint=/api/v1/{chain_id}/domains/{name} client_ip=149.154.161.214 request_id=709e5c7c-6587-4958-98db-9b27b20984fe duration=762 unit="microsecond" exception.message=Internal error: internal error exception.details=Error { code: Internal, message: "internal error" }}: blockscout_tracing_actix_web::middleware: Finished HTTP request processing

Does it matter if my graph-node has more than one subgraph? In fact, it has 2 subgraphs: one for forked ENS (graphprotocol/pns) and one for blocks indexing (pcl/blocks)

@johnny-vu
Copy link
Author

Here is the log when it starts launching:

2024-03-27T18:08:11.268602Z  INFO bens_server::server: found networks from config: {369: NetworkInfo { blockscout_client: BlockscoutClient { url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("scan.mypinata.cloud")), port: None, path: "/ipfs/bafybeidn64pd2u525lmoipjl4nh3ooa2imd7huionjsdepdsphl5slfowy/", query: None, fragment: Some("") }, inner: ClientWithMiddleware { inner: Client { accepts: Accepts, proxies: [Proxy(System({}), None)], referer: true, default_headers: {"accept": "*/*"}, timeout: 30s }, .. }, max_concurrent_requests: 5 }, subgraph_configs: {"graphprotocol/pns": SubgraphSettings { use_cache: true, address_resolve_technique: ReverseRegistry, empty_label_hash: None, native_token_contract: Some(0x65cf7f7aa5a4a2c20120b445ca4f05f63e2628c4) }} }}
2024-03-27T18:08:11.272905Z  INFO bens_logic::subgraphs_reader::reader: found subgraph deployments deployments={369: [Deployment { subgraph_name: "pcl/blocks", schema_name: "sgd12", net_version: 369 }, Deployment { subgraph_name: "graphprotocol/pns", schema_name: "sgd14", net_version: 369 }]}
2024-03-27T18:08:11.272949Z  WARN bens_logic::subgraphs_reader::reader: no settings found for subgraph 'pcl/blocks', use default
2024-03-27T18:08:12.234036Z  INFO bens_logic::subgraphs_reader::reader: initialized subgraph reader networks=[369]
2024-03-27T18:08:12.234330Z  INFO tokio_cron_scheduler::job_scheduler: Uninited
2024-03-27T18:08:12.234395Z  INFO tokio_cron_scheduler::job_scheduler: Job creator created
2024-03-27T18:08:12.234466Z  INFO blockscout_service_launcher::launcher::launch: starting http server on addr 0.0.0.0:8050
2024-03-27T18:08:12.234653Z  INFO actix_server::builder: starting 4 workers
2024-03-27T18:08:12.234700Z  INFO actix_server::server: Tokio runtime found; starting in existing Tokio runtime

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

Successfully merging this pull request may close these issues.

1 participant