etheralley-core-api

command module
v0.0.0-...-fb278eb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 31, 2022 License: GPL-3.0 Imports: 17 Imported by: 0

README

etheralley-core-api

The core rest api for the EtherAlley platform

build Go Report Card GPL-3.0 License

Local Setup

  1. Download Go v18.x

  2. Download Docker

  3. Acquire API keys for communicating with various blockchains. e.g. Alchemy

  4. Acquire an API key for communicating with subgraphs on TheGraph

  5. Start the Mongo database in a docker container

     make docker-mongo
    
  6. Start the Redis cache in a docker container

     make docker-redis
    
  7. Add a file named .env in the root of the project with the following environment variables. Anything with <REPLACE> must be replaced with the keys acquired in the previouse steps. ETHEREUM_MAIN_URI, ETHEREUM_SECONDARY_URI and ALCHEMY_ETHEREUM_URI can all point to the same uri on local and things should still behave normally.

    ENV=dev
    PORT=8080
    REDIS_ADDR=localhost:6379
    REDIS_DB=0
    REDIS_PASSWORD=
    MONGO_URI=mongodb://mongoadmin:secret@localhost:27017/
    MONGO_DB=etheralley
    ETHEREUM_MAIN_URI=https://eth-goerli.alchemyapi.io/v2/<REPLACE>
    POLYGON_MAIN_URI=https://polygon-mumbai.g.alchemy.com/v2/<REPLACE>
    ARBITRUM_MAIN_URI=https://arb-rinkeby.g.alchemy.com/v2/<REPLACE>
    OPTIMISM_MAIN_URI=https://opt-kovan.g.alchemy.com/v2/<REPLACE>
    ETHEREUM_SECONDARY_URI=https://eth-goerli.alchemyapi.io/v2/<REPLACE>
    ALCHEMY_ETHEREUM_URI=https://eth-goerli.alchemyapi.io/v2/<REPLACE>
    THE_GRAPH_URI=https://gateway.thegraph.com/api/<REPLACE>/subgraphs/id
    THE_GRAPH_HOSTED_URI=https://api.thegraph.com/subgraphs/name
    STORE_BLOCKCHAIN=polygon
    STORE_ADDRESS=0x15EC5d87f2A810466aCbd761f38c35ae36523FE7
    STORE_IMAGE_URI=http://localhost:3000
    DEFAULT_TOKEN_ADDRESSES=0x1f9840a85d5af5bf1d1762f925bdaddc4201f984
    IPFS_URI=https://gateway.ipfs.io/ipfs/
    ENS_METADATA_URI=https://metadata.ens.domains/goerli
    CRYPTO_KITTIES_METADATA_URI=https://api.cryptokitties.co/kitties
    
  8. Start the web service

     make run
    

License

Distributed under the GNU General Public License v3.0. See LICENSE for more information.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL