The backend for the EtherAlley platform
This repository leverages the new go workspace feature to operate as a monorepo. There is currently two executable modules and a single library module.
profiles-api
is an http api encapsulating the profiles domaindaos-api
is an http api encapsulating the daos domaincommon
is a library for common and shareable code across executables
-
Download Go v18.x
-
Download Docker
-
Acquire API keys for communicating with various blockchains. e.g. Alchemy
-
Acquire an API key for communicating with subgraphs on TheGraph
-
Start the Mongo database in a docker container
make docker-run-mongo
-
Start the Redis cache in a docker container
make docker-run-redis
-
Add a folder named
.env
in the root of the project with a file named.env.profiles-api.dev
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
andALCHEMY_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= REDIS_USE_TLS=false 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 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
-
Start the profiles-api web service
make run-profiles-api
Distributed under the GNU General Public License v3.0. See LICENSE for more information.