This is an implementation of the OAX L2X protocol as a full-stack high-performance, scalable, trustless exchange.
- Getting Started with the OAX Testnet
- Architecture
- L2X Protocol Specification
- Exchange Client Library
- Operator Client Library
- Client CLI
- Server Development
- Server Deployment
- Operator Notes
- Contribution Guidelines
This section will walk you through using the client library and CLI to interact with the OAX testnet. If you'd like to learn how to run the server, modify it and deploy it, see the Server related sections in the documentation.
- node.js v10.x or later
- Create a new folder
- Create a package.json
npm init
- Install the OAX client package
npm install @oax/client --save
- Initialize the CLI. This will create a new config.json file with the OAX Testnet config.
npx oax init
Once this is created, please open the config.json file and update the providerUrl
by adding in your geth node url or infura url for the rinkeby testnet.
- Create a new encrypted wallet.
npx oax createWallet
-
Fund the wallet with Rinkeby test ether. You can use one of the public Rinkeby faucets to request Ether for the wallet address you just created.
- https://etherfaucet.xyz
- http://rinkeby-faucet.com
- https://faucet.rinkeby.io/ (Requires Twitter or Facebook account)
After funding your wallet, you need to purchase OAX tokens. OAX tokens are needed to pay fees. They can be purchased using the buy method. WETH can also be purchased in this way. Once you purchase these tokens you can send them to the exchange using the deposit method. Finally once your tokens show up on the exchange balances, you can start trading.
Launch the CLI in console mode
> npx oax buy OAX 1
Buying 1 OAX...
Bought 1 OAX.
> npx oax fetchWalletBalance OAX
Balance: 1.0
> npx oax deposit OAX 1.0
Depositing 1 OAX...
> fetchBalances
{
"OAX": {
"free": "1",
"locked": "0"
},
"WETH": {
"free": "0",
"locked": "0"
}
}
> npx oax createOrder BUY OAX/WETH 5 0.1
Placing order to BUY 5 OAX/WETH @ 0.1...
Order placed successfully.
"0xfd91b90308ccfcaff77ae9cfc7e455b6383320aa981f1cbd273f1ead2732081b"
You can see the full list of commands available in the CLI by typing:
npx oax --help
Currently the build script will build everything, client , server , smart-contracts, so you can simply run pnpm run clean-build
after modifying some source code.
© 2019 OAX Foundation