main: hook up with discovery

@philips We need to modify current discovery to create _config/size key when new the token.
tested on my local machine, works. 
Can we have another document to record all these... 
I think we need to spend one or two days to focus on adding useful logging information.
I am not worrying all these right now.