I research the Terra (LUNA) blockchain and use js library (#terra-money/terra.js). But I can't find the method for getting list of transactions.
How can I get transaction by wallet address using NodeJs?
you need to go via the FCD, there is a example from testnet:
https://bombay-fcd.terra.dev/v1/txs?offset=0&limit=100&account=<ACCOUNT>
Related
I am trying to follow the Jokes tutorial #https://remix.run/docs/en/v1/tutorials/jokes
and I was wondering how do I fetch from a specific (back-end) API link / Database URL?
Can you provide an example (where you use Prisma)?
On the webpage it says "You can use any persistence solution you like with Remix; Firebase, Supabase, Airtable, Hasura, Google Spreadsheets, Cloudflare Workers KV, Fauna, a custom PostgreSQL, or even your backend team's REST/GraphQL APIs"
I have set the DATABASE_URL in the .env file to the API link, however I don't know how to continue from here
Please provide some code, so we can help you based on a specific question.
In general, you would fetch data inside your loader function in Remix. That function runs on your server and can be used to fetch from a database or API.
If you have trouble with Prisma, I would suggest you have a look at the tutorial you are following or look at the Prisma documentation.
You can find more information about data loading in Remix in the Remix documentation: https://remix.run/docs/en/v1/guides/data-loading
I have developed my ethereum smart contract and I want to integrate it with my web application. But I don't know that is integration with ReactJS a better option or integration with nodejs a better one. Please give suggestions . Also I don't know how to do integration with backend through web3 library so please guide me about that.
When you are creating web3 app , most of the time you are not going to need a backend for that (Although you need a server to host your website) .
Working with and managing smart contracts are very easy at the front-end and there is no need for backend, but if your working on a large scale project , you are definitely going to need a backend for handling complex logics .
Next js is best option for both of that , containing node and react , also no need for manually configuring web server.
Better is next.js. I explained it here: https://ethereum.stackexchange.com/questions/129547/next-js-versus-react-which-to-use-when-for-your-dapp/130040#130040
Not every browser has metamask extension. By using next.js, when our
code is taken and rendered on the server, on the next server we can
reach out to the Ethereum network and do some initial calls like data
fetching, or alist of items in your smart contract. we execute all of
those requests on the server. That means when next.js produces Html
documents to send down to the user browser, it does not matter whether
or not users are using metamask. It does not matter whether or not
they have access to an Ethereum network. Because we already take care
of the data fetching for them. So all the users out there who are not
using metamask are going to see some information on the screen.
You've mentioned that you don't want to switch technologies, and while I agree with NextJS being a good platform to develop dApps on, I suggest you just use your current NodeJS server for anything that isn't web3 related and you use the web3js library from the frontend (your React) which would be very similar to a NextJS app anyway.
This way you don't have to switch technologies.
I am building blockchain explorer. I have my own blockchain. In that, i want to search details of a given address from blockchain. There is no direct API to get detail of an address, could anybody help how to this ?
Thanks in Advance.
Two options:
option 1:
blockchain.info has an open API (REST + JSON)
https://blockchain.info/it/api/blockchain_api
here how:
https://blockchain.info/it/rawaddr/$bitcoin_address
bear in mind that you can only acquire info from an address that actually moved at least once some bitcoin on the network. If you just create a new wallet and do not transact then the public address is non existent on the blockchain (i.e. there's no difference between a newly generated address and a non existent address). That's the "shameful" approach as you are building a blockchain explorer using another blockchain explorer, see option 2 for the correct approach:
option 2:
Run a bitcoin node on your own and query your stuff on it. You may not be able to run a node on a normal hosting, probably you need something more like an Amazon AWS instance or host on your own server
I see from comments you are using peercoin (https://github.com/peercoin/peercoin). If it's a fork of Bitcoin, then the following holds:
In basic Bitcoin full-node setup, it's impossible to query random address. You can add some addresses to track, but think of it as of "yours".
There are modifications to the bitcoin-core, that have a addressindex option. The one I am aware of is bitcore: https://github.com/bitpay/bitcore-node.
Here's how to run your own blockchain explorer for Bitcoin using bitcore's insight: https://github.com/bitpay/insight-api
npm install -g bitcore#latest
bitcore create mynode
cd mynode
bitcore install insight-api
bitcore install insight-ui
bitcore start
This will launch full node in the needed mode (addressindex=1 enabled, etc) and a webservice with API and UI, similar to: https://insight.bitpay.com/.
Config file will be located at mynode/bitcore-node.json
Bitcore's docs and not well maintained, some are outdated. Try the code, but don't give up if it fails. For more information, refer to the source code.
P.S. I am not sure how to convert this to run with your blockchain, but if it's similar to bitcoin, it should be possible. I think it's closest you can get without writing your own explorer.
I am curious if it is possible to use the Stripe API within a CouchApp. Normally I would have server side code that has my Stripe API keys where I would do the transactions from. Since a CouchApp doesn't really have that server side layer I am at a loss as to how to accomplish this.
Try stripe.js:
Stripe.js makes it easy to collect credit card (and other similarly
sensitive) details without having the information touch your server
https://stripe.com/docs/stripe.js
On the back end you'll want to use stripe's node implementation. Refer to link
https://stripe.com/docs/tutorials/charges
You could also want to reference firebase implementation of stripe https://zapier.com/zapbook/firebase/stripe/
NOTE: Don't confuse firebase with couchdb. Same concept slight different engines. Firebase is built on top of mongodb, whereas CouchDB has it's own engine and for all intents and purpose intended to be along side pouchDB.
Hope it helps.
EDIT
When i am talking about node and node id i am specifically talking about the Neo4j representation of a node not node as in Node.js
I am building out an application on top of Neo with node using the thingdom wrapper on top of the REST API and i am attempting to add my own custom id property that will be a hash of the id to be used in the URL for example.
What i am currently doing is creating the node and then once the id is returned hashing this and saving it back to the node, so in effect i am calling the REST API twice to create a single node.
This is a long shot but is there a way to get a reliable next id from Neo using the REST API so that i can do this all in one request.
If not does anyone know of a better approach to what i am doing?
The internal id of neo4j nodes is not supposed to be used for external interfaces, as noted in the documentation. That means especially it's not a good idea to try to guess the next id.
It's recommended to use application specific ids to reference nodes, if you use UUIDs (especially uuid type 4) there is only a minimal chance of collisions and you can compute them on node creation, before storing them in the database.
By curiosity, can I ask you why you need to have the Id stored in the Node?
But anyway, it's quite common in Node.js to call a succession of APIs. And you will see that with Neo4j it will be required more than once.
If you don't already use it, I can only suggest you to take a look at Async: https://github.com/caolan/async
And particularly to the "waterfall" method that allows you to call more than one API that use the result of the previous call.