Code Monkey home page Code Monkey logo

atlas-server's Introduction

Marketplace

Decentraland's Marketplace

Frontend

Coverage Status

The Marketplace is a React static site. Its code can be found under the /webapp directory.

Backend

It can be found under /indexer.

How to contribute

Contributing to the Marketplace is easy, you just need to go through the following process:

  1. Look for issues in the Issues tab or create a new one with the proposed changes. We classify issues with the “Enhancement”, “Bug” or “Good first issue” tags. Feel free to check one of those first.
  2. Contact team members via the GitHub issue or use the Code Contribution Discord channel. It’s important to at least check on the issue status before starting.
  3. Set up your GPG key and sign all commits in your branch.
  4. Read the testing standards and the coding standards to produce code that fits the project standards.
  5. Create a PR with the changes, linking the PR to the created issue. If there are visual changes in the PR, attach images.

Copyright & License

This repository is protected with a standard Apache 2 license. See the terms and conditions in the LICENSE file.

atlas-server's People

Contributors

2fd avatar cazala avatar flobarreto avatar fzavalia avatar juanmahidalgo avatar lautaropetaccio avatar lauti7 avatar meelrossi avatar menduz avatar nachomazzara avatar nicosantangelo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

atlas-server's Issues

use publicTLD in `.ci/index.ts`

To register the server against .org certificates directly. That way, we can remove the extra cloudflare worker proxy on top of this service

Tiles owners are not updated when the estate ownership changes

The /v2/tiles endpoints returns, for the tile in the coordinates -69,-33 the following:

{
  "id": "-69,-33",
  "x": -69,
  "y": -33,
  "updatedAt": 1583360810,
  "type": "owned",
  "top": true,
  "left": false,
  "topLeft": false,
  "name": "Stuff",
  "estateId": "2704",
  "owner": "0x4eac6325e1dbf1ac90434d39766e164dca71139e",
  "tokenId": "115792089237316195423570985008687907830130783715016748523948110702552891260895"
}

Which means the this tile belongs to the estate 2704 and its owner is the one with the address 0x4eac6325e1dbf1ac90434d39766e164dca71139e, but this is not right.

By using the Marketplace playground, with the query:

{
  nfts(
    where: {tokenId: "115792089237316195423570985008687907830130783715016748523948110702552891260895"}
  ) {
    owner {
      address
    }
  }
}

We get that the owner of the parcel is the estate contract:

{
  "data": {
    "nfts": [
      {
        "owner": {
          "address": "0x959e104e1a4db6317fa58f8295f586e1a978c297"
        }
      }
    ]
  }
}

And by using again the playground with the query:

{
  estates(where: {tokenId: "2704"}) {
    owner {
      address
    }
  }
}

We get that the estate owner is the wallet with the address 0x5188e308fee25ac49c10f9fd9270d953c4822ce5, which differs from the 0x4eac6325e1dbf1ac90434d39766e164dca71139e address that is returned in the /v2/tiles endpoint.

{
  "data": {
    "estates": [
      {
        "owner": {
          "address": "0x5188e308fee25ac49c10f9fd9270d953c4822ce5"
        }
      }
    ]
  }
}

Check the atlas update function to see if a change in the ownership of an estate implies changing the ownership in the tiles entity.

Add better logs and metrics

Currently, the atlas-server lacks proper logs to debug what's going on in case of anything breaking in a deployed environment. We should add better logs and metrics to help with that.

To do it we could use '@well-known-components/metrics' like we do in the transactions-server and ILoggerComponent from the interfaces too

Setup Instructions Don't Work

I have tried getting this to work on both my Windows PC and my MacBook, and neither seems to work when I run npm start.

This is what I'm seeing:
image

And here are the logs:

0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli   'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'start'
1 verbose cli ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle [email protected]~prestart: [email protected]
6 info lifecycle [email protected]~start: [email protected]
7 verbose lifecycle [email protected]~start: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]~start: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\Ricky\Desktop\atlas-server\node_modules\.bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Users\Ricky\bin;C:\rtools40\usr\bin;C:\Program Files\R\R-3.6.2\bin\x64;C:\Rtools\bin;C:\Program Files\Oculus\Support\oculus-runtime;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\libnvvp;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\libnvvp;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files\MiKTeX 2.9\miktex\bin\x64;C:\ProgramData\Anaconda3\python.exe;C:\Program Files\Alteryx\bin\AlteryxEngineCmd.exe;C:\Program Files\Amazon\AWSCLI;C:\Program Files\PuTTY;C:\Program Files\nodejs;C:\ProgramData\chocolatey\bin;C:\Program Files\dotnet;C:\Program Files\CMake\bin;C:\Program Files\NVIDIA Corporation\Nsight Compute 2019.4.0;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\WINDOWS\System32\OpenSSH;C:\Users\Ricky\AppData\Local\Microsoft\WindowsApps;C:\Program Files\Alteryx\bin\AlteryxEngineCmd.exe;C:\Users\Ricky\AppData\Local\GitHubDesktop\bin;C:\Users\Ricky\AppData\Roaming\TinyTeX\bin\win32;C:\Program Files\Docker Toolbox;C:\Users\Ricky\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\Ricky\AppData\Roaming\npm;%USERPROFILE%\AppData\Local\Microsoft\WindowsApps;C:\Program Files\Git\usr\bin;C:\Program Files\RStudio\bin\msys-ssh-1000-18
9 verbose lifecycle [email protected]~start: CWD: C:\Users\Ricky\Desktop\atlas-server
10 silly lifecycle [email protected]~start: Args: [ '/d /s /c', 'node dist' ]
11 silly lifecycle [email protected]~start: Returned: code: 1  signal: null
12 info lifecycle [email protected]~start: Failed to exec start script
13 verbose stack Error: [email protected] start: `node dist`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
13 verbose stack     at EventEmitter.emit (events.js:310:20)
13 verbose stack     at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:310:20)
13 verbose stack     at maybeClose (internal/child_process.js:1021:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
14 verbose pkgid [email protected]
15 verbose cwd C:\Users\Ricky\Desktop\atlas-server
16 verbose Windows_NT 10.0.19041
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
18 verbose node v12.16.3
19 verbose npm  v6.14.4
20 error code ELIFECYCLE
21 error errno 1
22 error [email protected] start: `node dist`
22 error Exit status 1
23 error Failed at the [email protected] start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

Are there any concrete examples on using either the 1.0 or the 2.0 API in Python or R? It is totally unclear how you are supposed to authenticate to make a GET request, I can't find a reference to this anywhere in the documentation. I also don't understand why these wouldn't be public endpoints. I pull data regularly from multiple API's, some of which require authentication, but I can't get this to work because there is absolutely 0 reference of how you are supposed to authenticate and no examples are given.

Would appreciate help understanding how to use the Decentraland API, I have been on the Discord #support-api channel asking about this for 10 days and have only gotten one useful short response saying I need to authenticate and that it's not easy, nobody seems to have an example or info outside of that. Please document this better or it's unusable!

Implement tracing in the atlas-server

By using the tracer and the http-tracer components, implement tracing in the atlas-server.

To complete this issue:

  • The tracer and http-tracer component must be used to implement tracing and trace propagation.

Sanitize the estateId received as parameter

Nowadays, when using the endpoint '/v2/estates/:id', if the id provided is not found in the data stored in memory, it thinks it has been dissolved and calls getDissolvedEstate. It checks it's already in memory, then checks if it goes beyond the last id in memory and lastly, if those checks fail, it goes to the subgraph with the query:

{ nfts( where: { tokenId: ${estateId} category: estate searchEstateSize: 0 } ) { name estate { data { description } } } }

Let's add a check that the estateId passed is a proper string to avoid requests with invalid parameters going through the graph and triggering alerts due to the 500's thrown by the server

Here's an example of a log of an invalid id used as parameter:

[0-fb789a0ff91ed34300cecf61d0e20236-0000000000000000-0] 2023-05-16T09:40:42.557Z [ERROR] (thegraph-port): Error:	{"queryId":"bcf55ac8-f199-4e5a-8f28-55c25e09bcb8","currentAttempt":3,"attempts":4,"timeoutWait":50000,"url":"https://subgraph.decentraland.org/marketplace","errorMessage":"GraphQL Error: Invalid response. Errors:\n- Unexpected `unsupported integer \"4802\\\"929495\"`\nExpected `IntValue`, `FloatValue`, `StringValue`, `BlockString`, `true`, `false`, `null` or `Name`. Provider: Satsuma","query":"{\n        nfts(\n          where: {\n            tokenId: 4802\"929495@\n            category: estate\n            searchEstateSize: 0\n          }\n        ) {\n          name\n          estate {\n            data {\n              description\n            }\n          }\n        }\n      }","variables":"{}"}

Subgraph endpoint update required

Hey team,

We've noticed that you're referencing a subgraph deployed on The Graph's hosted service in this repository. Just a heads-up: after June 12th, hosted service subgraph endpoints will no longer be available as the offering is being deprecated.

If you are the subgraph owner or maintainer, it's time to upgrade your subgraph to the network. This ensures everything keeps running smoothly and you get access to all the latest features and improvements. Here is a quick guide with all the upgrade steps.

If you're not the subgraph owner or maintainer, check Graph Explorer to see if the subgraph development team has already upgraded to the network. If you don’t find an upgraded subgraph, a friendly nudge to the subgraph development team would be greatly appreciated—it's a quick process that benefits everyone. Here's the upgrade guide with all the necessary steps for the subgraph development team.

Once the subgraph is upgraded to the network, you can create an API key and updated query URL in Subgraph Studio then update this repository to query from the new endpoint, https://api.studio.thegraph.com/query/<ID>/<SUBGRAPH_NAME>/<VERSION>

Need more support or have more questions? Feel free to reach out to [email protected]. We're here to help!

Cheers,

Paka

Update the atlas server to take into consideration the off chain swaps

To complete this task:

  • Add to the update script a mechanism to query the signature server for the open swaps when the server starts and stores the time when the update occurred.
  • Add to the update script that runs continuously the mechanism to update the swaps that were updated after the last updated timestamp. Update the last updated timestamp.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.