我在试着通过uport-人物角色来读取个人资料。在文档中,这听起来很简单,但我无法访问我的角色。
export function loginUser() {
return function(dispatch) {
web3.eth.getCoinbase(function (err, address) {
if (err) { throw err }
web3.eth.defaultAccount = address;
uport.getUserPersona().then((userPersona) => {
registry.getPublicProfile(userPersona.profileAddress).then((profile) => {
console.log(profile);
});
return dispatch(userLoggedIn(userPersona.profile))
})
})
}
} 首先,我获得了我的userPersona,然后我试图从注册表中获取我的公共配置文件(带有我的地址)。但在控制台里我有:
未知(承诺)错误:无法从注册表获取值
发布于 2017-02-13 06:21:43
我是uport的工程主管。我们即将放弃一些库,因为它们并不像我们想要的那样简单易用。
我们的新浏览器库是:https://github.com/uport-project/uport-connect
import { Connect } from 'uport-connect'
const uport = new Connect('MyDApp')
uport.requestCredentials().then((credentials) => {
console.log(credentials)
})我们正在更新文档和示例代码,所以请耐心,但是上面的代码应该没有问题。
https://ethereum.stackexchange.com/questions/12096
复制相似问题