Implement a dApp using ErgoPay

ErgoPay vs web dApp connector

What we’ll do in this tutorial

Starting your Spring Boot project

./gradlew bootRun // MacOS/Linux
gradlew bootRun // Windows

Adding an ErgoPay request endpoint

@GetMapping("/ergopay/")
public ErgoPayResponse ergoPayError() {
ErgoPayResponse response = new ErgoPayResponse();
response.messageSeverity = ErgoPayResponse.Severity.ERROR;
response.message = "Nothing implemented yet.";
return response;
}

Use the endpoint from the wallet application

ergopay://192.168.0.1:8080/ergopay

Building and reducing a transaction

dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
*
implementation 'org.ergoplatform:ergo-appkit_2.11:4.0.6'

testImplementation 'org.springframework.boot:spring-boot-starter-test'
}
http://localhost:8080/roundTrip/<address>
ergopay://<yourIP>:8080/roundTrip/#P2PK_ADDRESS#

Going further

Connect a wallet to your UI

ergopay://<yourIP>:8080/setAddress/<sessionId>/#P2PK_ADDRESS#

Your dApp UI on the same device as the wallet app

Conclusion

--

--

--

Ecosystem developer for @ergoplatformorg, casual coder using libGDX. https://github.com/MrStahlfelge

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

The Higher Order…in JavaScript

Build an interactive Map with React and React Leaflet

How to add JavaScript to form on load in Dynamics 365

How We Built a Playful WebGL Experience for 100 FWA Wins

Part 1: simplr-forms — declarative forms for React. Why are we doing this?

JavaScript: MutationObserver

Regular Expressions with JavaScript, an Introduction

How to fix the CORS issue in Vuejs

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
MrStahlfelge (Benjamin Schulte)

MrStahlfelge (Benjamin Schulte)

Ecosystem developer for @ergoplatformorg, casual coder using libGDX. https://github.com/MrStahlfelge

More from Medium

GHOST SIGNATURES, & THE ART OF DIGITAL GRAND LARCENY.

OpenOcean’s integration with Mask Network.

Amazing wonderful project based on new technology,.

I’m BoB project Smart Contract ERC721 Introduction