Client-facing API Service, orchestrator of World Wire operations
Required Software Dependencies:
- Go/Golang: https://golang.org/doc/install
- Glide, a package manager for Go: https://glide.sh/
- A package manager. We use:
- NPM: https://docs.npmjs.com/downloading-and-installing-node-js-and-npm
- Homebrew (Mac OSX): https://brew.sh/
Running API Service locally
In order to run and test against the API-Service locally, you will need several steps to get set up.
Step 1 -- install all dependencies
The first step is to run dep at the root of the project:
Step 2 -- Configure local environment
Change to newly cloned utility repo and edit the
nodeconfig.toml file to contain the following:
(make sure to replace filler values with actual values)
[DISTRIBUTION_ACCOUNTS] [DISTRIBUTION_ACCOUNTS.default] NODE_ADDRESS = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" NODE_SEED = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" [IBM_TOKEN_ACCOUNT] NODE_ADDRESS = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" NODE_SEED = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" [ISSUING_ACCOUNT] NODE_ADDRESS = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" NODE_SEED = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
Set environment variables by copying the variables found in
.env.example to your OS's config file path:
Replace with your set GOPATH for your project.
Alternatively, for VSCode user, copy over:
DON'T FORGET: Replace with your set GOPATH for your project.
To open the
~/.profilewith vscode use
code ~/.profileand then after updating the file use
source ~/.profileto enable and set the updates
- The porn number this service should bind to at startup
- The URL the API Service should call in order to verify an account number
- The URL the API Service should call in order to notify of a new crypto address generated for the client
- The base URL for the internal Federation Service Endpoint for this Participant
- The base URL for the internal QUOTES Service Endpoint for this Participant
- token issued by issuing account by this participant
- Horizon client url
- Friendbot url to fund accounts
- Distribution account keys File path
- issuing account keys file path
- participant registry url
OPTIONAL: Generate JWT RS256 key (Must set ENABLE_JWT = true). To do so, run:
ssh-keygen -t rsa -b 4096 -f jwtRS256.key
Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
Step 3 -- Install dependencies
This step assumes you have npm installed from nodejs.org and already have Golang etc. installed on your system
You will need to change directories to the api-service directory:
Mac only: Install homebrew if not installed:
npm install -g homebrew
After finishing the homebrew installation or if already installed previously, use the following command to install Glide:
brew install glide # Mac OSX curl https://glide.sh/get | sh # all other OSes
With Glide installed, you can now run the following from inside the
This installs all the golang dependencies found in the project files in api-service.
After these packages are installed, you can build the project with the Makefile:
Alternative you can run each of the individual commands found in the Makefile, if the Makefile is broken or you need to do an intermediary step in between.
To build the project manually, run the following command to compile the project into an executable:
go build # general command for all OSes go build -o api-service.exe # Windows go build -o api-service.osx # Mac OSX
To run the project:
./api-service # or ./api-service.exe or ./api-service.osx, etc.
Alternatively for VSCode users: go into the Debug panel, click the play button on the launch service for api-service to run the project.
The API Service should now be running locally and accepting requests on
localhost:8080, or whichever SERVICE_PORT you have set it to
There is no documentation for this package.