The source code of Hermes and Atlas nodes. Part of the ambrosus project.
- Introduction
- Running tests
- Building project
- Running locally
- Running your own node
- Running in production
- Contributing
Contains source code of Hermes and Atlas nodes that are part of ambrosus blockchain network. Read more about ambrosus.
Start the MongoDB container
yarn dev:docker:dbRun data migrations
yarn dev:migrateInstall the dependencies
yarn installRun the tests
yarn testRun linter:
yarn dev:lintAdditionally we provide the postman collection to make it easier to test REST queries. To use them you need to run the server, create the admin account and:
- Import the environment from
postman/AMB-template.postman_environment.json, rename it if you want, and select it. - If needed, change
urlvariable (by default url=localhost:9876) to your gateway instance - In the environment set
adminSecretandadminAddressvariables with a existing admins private and public keys respectively. If you don't have access to an admin account, but rather a normal user account, you can set theuserSecretanduserAddress. Note: functionality will be limited. - Import collection from
Ambrosus.postman_collection.json - [admin only] Add or modify accounts with the
Add accountandModify accountrequests - Create tokens by calling the
Generate Tokenrequest
Building consists of transpiling the source code. It is performed by running:
yarn buildIf for some reason you want to perform a clean-up:
yarn dev:cleanStart the MongoDB container
yarn dev:docker:dbRun data migration
yarn dev:migrateStart an ethereum client of your choice. For example, the provided parity container (in dev mode).
yarn dev:docker:paritySet WEB3_NODEPRIVATEKEY and WEB3_DEPLOYER_PRIVATEKEYa in dev.env to a private key with
a positive balance.
If you're using provided parity from container, the private key in dev.env should already match a dev account.
Run the contract deployment task:
yarn dev:deployUpdate HEAD_CONTRACT_ADDRESS in dev.env to match the address returned from yarn dev:deploy.
Run the system pre-run task:
yarn dev:prerun:hermesor
yarn dev:prerun:atlasto match your desired type of node: hermes or atlas.
Finally, run one of the workers you are interested in:
yarn dev:start:serveror
yarn dev:start:hermesor
yarn dev:start:atlasTo run your own node in ambrosus network see ambrosus-nop.
This project shouldn't be running on it own. See ambrosus-nop to find start scripts. For additional information about running in test mode contact ambrosus development team.
Below are instructions to run this particular project.
Your should have an ethereum client instance and a mongoDB instance.
Build the whole suit:
yarn buildConfigure environment variables for WEB3_RPC, WEB3_NODEPRIVATEKEY, MONGODB_URI, HEAD_CONTRACT_ADDRESS (provided by the Ambrosus developer team).
Run database migration
yarn migrateFinally, start desired server:
Api
yarn start:serverOr Hermes
yarn start:hermesOr Atlas
yarn start:atlasgetToken - utility for manual AMB_TOKEN generation, usage:
node getToken.js <privKey>We will accept contributions of good code that we can use from anyone.
Please see CONTRIBUTION.md
Before you issue pull request:
- Make sure all tests pass.
- Make sure you have test coverage for any new features.