Coder Social home page Coder Social logo

Comments (15)

deeayeen avatar deeayeen commented on August 15, 2024 1

@tjayrush That's just an empty create react app

from trueblocks-explorer.

deeayeen avatar deeayeen commented on August 15, 2024

(Requires some back-end work first, need to set up a server call that accepts certain fields like description, tags, etc. to update a name)

from trueblocks-explorer.

tjayrush avatar tjayrush commented on August 15, 2024

Just for future reference, this script show you how it works (really poorly) from the command line currently: https://github.com/TrueBlocks/trueblocks-core/blob/master/src/other/build_assets/addName.

The backend work would have to be done in this code (go code that handles the server): https://github.com/TrueBlocks/trueblocks-core/blob/master/src/go-apps/flame/server/routes.go#L114.

Currently, that code only handles the GET request. I would have to be expanded to handle a PUT, build the environment variables shown in the shell script above and send a command to chifra with those environment vars.

If this makes sense, and you're (@deeayeen) are at all interested in diving into the back end, please have a go at it. Otherwise, I will try to work on it this weekend. Make a PR of the frontend code and mark it work in progress (WIP) so I can have something to work on.

from trueblocks-explorer.

tjayrush avatar tjayrush commented on August 15, 2024

In order to save the name edit, you can send a POST request to http://localhost:8080/names with an object of this type. If the address exists, it will be edited. If the object does not exist, it will be added.

To delete use http://localhost:8080/monitors?addrs=<address>&delete
To undelete use http://localhost:8080/monitors?addrs=<address>&undelete
To remove previously deleted: http://localhost:8080/monitors?addrs=<address>&remove

{
      /* A tag from the existing set or a new tag */
      "tags": "36-Compound",

      /* A valid Ethereum address */
      "address": "0x6C8c6b02E7b2BE14d4fA6022Dfd6d75921D90E4E",

       /* Non empty name */
      "name": "Compound Basic Attention Token",

      /* should default to Etherscan.io if empty */
      "source": "EtherScan.io",

      /* A user supplied description most likely empty and possibly not even needed */
      "description": ""
}

from trueblocks-explorer.

tjayrush avatar tjayrush commented on August 15, 2024

This change requires a re-build of the backend.

from trueblocks-explorer.

deeayeen avatar deeayeen commented on August 15, 2024

I see in the data you put above, "tags" is receiving a single string, "36-Compound", should this be an array of strings instead?

from trueblocks-explorer.

tjayrush avatar tjayrush commented on August 15, 2024

It's a great question. For now, can you send it as a single string possibly separated by something like a '|'? The backend won't accept an array for this even though it should. It's an old issue that's been ignored for a while, but I won't have time to fix it until some future date. We eventually want to replace the database we use to store names with something more robust, just don't have the time.

So -- no -- just send a single string.

from trueblocks-explorer.

tjayrush avatar tjayrush commented on August 15, 2024

We spoke about adding this feature (naming addresses) to the 'names' view, but now that we have named addresses in the transaction history view, it would be really nice to be able to name addresses directly on that screen as well.

from trueblocks-explorer.

deeayeen avatar deeayeen commented on August 15, 2024

@tjayrush I've started a branch on this, I need an example CURL request of editing the name

from trueblocks-explorer.

deeayeen avatar deeayeen commented on August 15, 2024
Screen.Recording.2021-07-06.at.13.37.02.mov

from trueblocks-explorer.

tjayrush avatar tjayrush commented on August 15, 2024

I use this to play around with adding names: https://github.com/TrueBlocks/addName

from trueblocks-explorer.

deeayeen avatar deeayeen commented on August 15, 2024

#134

from trueblocks-explorer.

tjayrush avatar tjayrush commented on August 15, 2024

@deeayeen

Works excellently.

There's a couple of smaller related issues:

  1. We need an addName button somewhere above the table.
  2. Users should be able to edit and add names from the Monitors tab of the Dashboard view as well, and
  3. On the Dashboard / Account Details tab we allow users to enter new addresses. When they do that, I want to check to see if that new address already has a name and if not, I want to ask the user if they would like to name the address (they should almost always want to - we can explain to them how much better the user experience is if they do that).

Should I close this issue and open new ones, or can you work from here?

from trueblocks-explorer.

deeayeen avatar deeayeen commented on August 15, 2024

Alright I'll take it step by step, I've added a button to the monitors table that allows you to add a new monitor, and it posts to /names with the data, can you hook it up to add it as a monitor somehow?

#137

from trueblocks-explorer.

tjayrush avatar tjayrush commented on August 15, 2024

I'm pretty sure all you have to do after updating the backend with the new name (in the same way you would with an edit) is re-direct to the Account Details page with the new address. It should create a new monitor automatically.

from trueblocks-explorer.

Related Issues (20)

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.