Giter VIP home page Giter VIP logo

golang-ipfs-test's Introduction

Dependencies:

Setup your database with Docker:

  1. Populate your .env file with your environment variables or leave it as it is.
  2. Run `docker-compose up`. This will create a database for you with MySQL and will automatically create a table called messages to serialize into JSON as well as seed it with some dummy data.
Install IPFS:
  1. Install IPFS (In my case I have used IPFS Desktop): https://docs.ipfs.tech/install/ipfs-desktop/
  2. Go to settings and get IPNS Publishing Key, add it to the environment variable `IPNS_PUBLISH_KEY` in your .env file.

You can use your own database with its user and migrate a table into it called messages. To do that, connect with mysql client in your machine and run `source init.sql`. This will create a table and seed data into your table. E.g;

  • Connect to the database with MySQL client:
    $ pwd
    
    /ummatest/
    
    $ mysql -h <YOUR_DB_HOST> -P 3306 -u <YOUR_USERNAME> -p <YOUR_DB_NAME> --password=<YOUR_USER_PASSWORD>
    
    mysql> source init.sql
    

    Run Go App

    Currently, the code is running with go1.18.1 Install your dependencies with:

    go install .
    

    Run your Go app with the following command:

    go run . --user=$DATABASE_USER --password=$DATABASE_PASSWORD --database=$DATABSE_NAME
    

    Once finished, check json_result.json which will show all data from the table messages as json, but it will also show their IPFS and resolved IPNS.

  • golang-ipfs-test's People

    Contributors

    arka-cell avatar

    Watchers

     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.