feat: change api to async / await (#112)

BREAKING CHANGE: All places in the API that used callbacks are now replaced with async/await. The API has also been updated according to the latest `interface-transport` version, https://github.com/libp2p/interface-transport/tree/v0.6.0#api.
This commit is contained in:
Alan Shaw
2019-09-16 16:19:47 +01:00
committed by Jacob Heun
parent 49c7f33375
commit cf7d1b8501
19 changed files with 616 additions and 753 deletions

8
src/constants.js Normal file
View File

@ -0,0 +1,8 @@
'use strict'
// p2p multi-address code
exports.CODE_P2P = 421
exports.CODE_CIRCUIT = 290
// Time to wait for a connection to close gracefully before destroying it manually
exports.CLOSE_TIMEOUT = 2000