GithubHelp home page GithubHelp logo

bedlam520 / gsn-with-web3 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from opengsn/gsn-with-web3

0.0 0.0 0.0 3.25 MB

Minimal GSN test using truffle and web3

JavaScript 91.74% Solidity 8.26%

gsn-with-web3's Introduction

Sample GSN project with web3

This is a simple project to demonstrate using OpenGSN with Truffle and web3

Usage:

yarn install

yarn test

The test can be done in 3 modes:

  1. self-contained test - yarn test.

  2. start ganache in another window, and then npx gsn start in another to install GSN and bring up a relayer. Then tell the test NOT to start GSN internally, by setting yarnWithGanache=true. The test will still need to load the Forwarder and RelayHub addresses. Then run the test with truffle test

  3. run yarn testkovan to start the test against a deployed network (kovan)

The test thus shows how to start GSN within the test (using startGsn()) and how to refernce GSN started in another terminal.

The test then shows how to configure your web3 contracts to use GSN.

The tests themselves merely verify that the call was relayed (caller didn't pay..) and that indeed it can see the caller's address (using _msgSender())

It shows using both truffle's TruffleContract and web3.Contract

gsn-with-web3's People

Contributors

drortirosh avatar

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.