Add network and rpc code