juzi-code / filecoinj Goto Github PK
View Code? Open in Web Editor NEW支持连接Infura和私有Filecoin客户端的JSON-RPC封装
License: Apache License 2.0
支持连接Infura和私有Filecoin客户端的JSON-RPC封装
License: Apache License 2.0
大佬,测试的交易的时候发现gas费设置过低导致没有上链,请问有哪个api可以修改矿工费并重新发送交易
大神,请教一下,离线生成的地址是否会和主网上的地址冲突,因为没有搭建节点,怕出现这种情况
Exception in thread "main" com.filecoinj.exception.SendException: send error {"id":1,"jsonrpc":"2.0","error":{"message":"Cannot read property 'value' of undefined","stack":"TypeError: Cannot read property 'value' of undefined\n at sigCacheKey (C:\\Program Files\\WindowsApps\\GanacheUI_2.6.0.0_x64__5dg5pnz03psnj\\app\\resources\\static\\node\\node_modules\\@ganache\\filecoin\\dist\\node\\ganache-filecoin.min.js:2:804447)\n at verifyMessageSignature (C:\\Program Files\\WindowsApps\\GanacheUI_2.6.0.0_x64__5dg5pnz03psnj\\app\\resources\\static\\node\\node_modules\\@ganache\\filecoin\\dist\\node\\ganache-filecoin.min.js:2:804531)\n at Object.checkMessage (C:\\Program Files\\WindowsApps\\GanacheUI_2.6.0.0_x64__5dg5pnz03psnj\\app\\resources\\static\\node\\node_modules\\@ganache\\filecoin\\dist\\node\\ganache-filecoin.min.js:2:805672)\n at Blockchain.pushSigned (C:\\Program Files\\WindowsApps\\GanacheUI_2.6.0.0_x64__5dg5pnz03psnj\\app\\resources\\static\\node\\node_modules\\@ganache\\filecoin\\dist\\node\\ganache-filecoin.min.js:2:778470)\n at FilecoinApi.Filecoin.MpoolPush (C:\\Program Files\\WindowsApps\\GanacheUI_2.6.0.0_x64__5dg5pnz03psnj\\app\\resources\\static\\node\\node_modules\\@ganache\\filecoin\\dist\\node\\ganache-filecoin.min.js:2:764697)\n at C:\\Program Files\\WindowsApps\\GanacheUI_2.6.0.0_x64__5dg5pnz03psnj\\app\\resources\\static\\node\\node_modules\\ganache\\dist\\node\\ganache.min.js:2:3790243\n at RequestCoordinator.<anonymous> (C:\\Program Files\\WindowsApps\\GanacheUI_2.6.0.0_x64__5dg5pnz03psnj\\app\\resources\\static\\node\\node_modules\\ganache\\dist\\node\\ganache.min.js:2:3790075)\n at C:\\Program Files\\WindowsApps\\GanacheUI_2.6.0.0_x64__5dg5pnz03psnj\\app\\resources\\static\\node\\node_modules\\ganache\\dist\\node\\ganache.min.js:2:3790310\n at new Promise (<anonymous>)\n at RequestCoordinator.queue (C:\\Program Files\\WindowsApps\\GanacheUI_2.6.0.0_x64__5dg5pnz03psnj\\app\\resources\\static\\node\\node_modules\\ganache\\dist\\node\\ganache.min.js:2:3790173)","code":-32700}}
package com.filecoinj.utils;
import cn.hutool.core.codec.Base32;
import cn.hutool.core.util.StrUtil;
import com.filecoinj.exception.AddressException;
import com.filecoinj.model.Address;
public class AddressUtil {
/**
* secp256k1地址字节长度
*/
private final static int addressLength_1 = 21;
// private final static int addressLength_1 = 21;
private final static int addressLength_3 = 43;
public static Address initAddress(String addressStr) throws AddressException {
if (StrUtil.isBlank(addressStr)){
throw new NullPointerException("addressStr 参数不能为空");
}
//去掉拼接的前两位
String substring = addressStr.substring(2);
//获取type
String typeStr = addressStr.substring(1, 2);
//获取网络类型
String network = addressStr.substring(0,1);
int type = Integer.parseInt(typeStr);
if (type != 1 && type !=2 && type != 3){
throw new AddressException("错误的地址类型");
}
int addrLen = addressLength_1;
if(type==3){
addrLen = addressLength_3;
}
byte[] addressBytes = new byte[addrLen];
// f099
// f1abjxfbp274xpdqcpuaykwkfb43omjotacm2p3za
// f2plku564ddywnmb5b2ky7dhk4mb6uacsxuuev3pi
// f3tfhgkbq6h55fqhumadd7wvogx3bbhgm3ifg6mk6hq35ob3fex2uei7hfbo2nwqkzudjzjidmshxpvo3ja4iq
switch (type){
case 1:
//secp256k1 地址类型
addressBytes[0] = (byte) type;
break;
case 2:
case 3:
// throw new AddressException("暂不支持的地址类型");
addressBytes[0] = (byte) type;
break;
default:
throw new AddressException("错误地址类型");
}
System.arraycopy(Base32.decode(substring), 0, addressBytes, 1, addrLen-1);
return Address.builder().address(addressStr)
.bytes(addressBytes)
.network(network).build();
}
}
filecoin.createWallet()这个接口没有调用api,生成的地址要通过import调用导入进去吗?如果你生成的钱包地址在链上存在了这样会有问题吧
在做归集的时候如何通过转账的Cid来判断是否交易成功
地址创建,秘钥类型是:secp256k1,发送交易时,生成的秘钥格式例如(fTeCO1/I76rrLg5WfPOMcpi1WPTrqnj8=)无法签名:
错误信息:
`java.lang.RuntimeException: Illegal hexadecimal character u at index 0
at cn.hutool.core.util.HexUtil.toDigit(HexUtil.java:398)
at cn.hutool.core.util.HexUtil.decodeHex(HexUtil.java:182)
at cn.hutool.core.util.HexUtil.decodeHex(HexUtil.java:203)
at com.filecoinj.handler.FilecoinHandler.send(FilecoinHandler.java:194)`
或者去哪里可以找到calibration测试rpc啊
关于easy transfer的参数问题,gasfeecap 和gaslimit调优,这个现在我是通过getgas方法后 获取里面的值各乘以2倍,但是发现实际用不到这么多
13.获取指定高度的所有消息(非充值入账业务标准API!!!)
14.获取消息收据(非充值入账业务标准API!!!)
大佬,请教一下,这2个为什么不能作为充值入账?
扫描到指定高度的所有消息,然后按顺序获取所有交易的收据,这个有什么问题呢?
imtoken导出来的私钥,再用sdk方法导进,结果钱包地址不一样
如果value传from地址的全部余额请求报错:estimating gas used: message execution failed: exit SysErrInsufficientFunds(6), reason: failed to transfer funds (RetCode=6): transfer failed when deducting funds (xxxx FIL): not enough funds (RetCode=6)
生成的私钥是64位的,如何转成imtoken可以导入的格式
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.