API and events server for Influence. A grand strategy game set in an asteroid belt and built on Ethereum.
This project is licensed under the Creative Commons Attribution-NonCommercial 4.0 International License (CC BY-NC 4.0). Commercial use is not permitted without a separate license from Unstoppable Games, Inc.
For the avoidance of doubt: The licensor considers non-commercial use under this license to include deployments or uses that collect funds solely to recover the reasonable costs of operating, maintaining, or administering the software, provided that such use is not primarily intended for or directed toward commercial advantage or monetary compensation, and that no profit is distributed to operators, contributors, or participants.
- Run scripts in
./bin/starknet-setupto migrate asteroids and crewmates to components from snapshots. - Manually retrieve and process events since the snapshot block time on L1.
- Setup retriever for Starknet.
- Re-process all events.
- Install local node modules:
npm install - Ensure a local mongo instance is running.
- (Optionally) ensure a local redis instance is running.
- Initialize your .env file:
echo "API_SERVER=1 CLIENT_URL=http://localhost:3000 BRIDGE_CLIENT_URL=http://localhost:4000 IMAGES_SERVER=1 IMAGES_SERVER_URL=http://localhost:3001 MONGO_URL=mongodb://localhost:27017/influence #REDIS_URL= CLOUDINARY_URL= NODE_ENV=development JWT_SECRET= ETHEREUM_PROVIDER=http://localhost:8545 CONTRACT_PLANETS= CONTRACT_ASTEROID_TOKEN= CONTRACT_ASTEROID_FEATURES= CONTRACT_ASTEROID_SCANS= CONTRACT_ASTEROID_SALE= CONTRACT_ASTEROID_NAMES= CONTRACT_ARVAD_CREW_SALE= CONTRACT_CREW_TOKEN= CONTRACT_CREW_FEATURES= CONTRACT_CREW_NAMES= " > .env - Adjust or fill in any missing .env variables as needed.
REDIS_URLis optional (uncomment if you plan to use it)JWT_SECRETcan be any random stringCONTRACT_*values should have been output at the end of theseedChainscript in the contracts project.
- Install Homebrew (https://brew.sh)
- Install mongodb tools
brew tap mongodb/brewthenbrew install mongodb-community@4.4 - Download this seed data for local development. Unzip the file into
./data - Run
NODE_ENV=development node ./bin/seedData.jsto reset the database - Run
npm run watchto start
- Run
node ./bin/updateCommon.jswith thefindStuckmethod uncommented. - Grab the output and run
truffle test ./test/lib/TestScansMock.jswith the output in the contracts project. - Get the output from #2 and run
node ./bin/updateCommon.jswithupdateDatabasemethod uncommented.