Bytom 技术FAQ
fishshow21
发表于 2022-12-3 14:05:24
90
0
0
Github地址:https://github.com/Bytom/bytom. j2 c' c( }: v
Gitee地址:https://gitee.com/BytomBlockchain/bytom( b4 T9 [5 Y7 M) y5 C0 m
1、如何连接远程全节点服务器5 H* c$ C) U! O/ {
远程服务需要本地生成的Access-token,可以通过以下两种方式: n) h8 `9 X g6 Q, w4 Y+ J9 R
./bytomcli create-access-token test 或者 curl -X POST create-access-token -d '{"id":"test"}'7 n! g4 W& |' n! t2 n
然后获得access-token:/ W9 Y, u2 b. l6 [. Z: E' q
“created_at”: “2018-05-18T16:00:25.284677605+08:00”,5 q) k) ~4 o( q$ E' C
“id”: “test”,
“token”:"test:fe50927ddaa5bcca77021e9f50fa5ef236a6140c012d1fe2eb9241f61a9228e4
test是账户,fe50927ddaa5bcca77021e9f50fa5ef236a6140c012d1fe2eb9241f61a9228e4是密码" @+ M& X# E/ {* d) f- ?$ v% J6 V; p
postman的方式,设置Authorization为Basic Auth,然后填写账户名和密码
Java代码调用:% l! U4 D6 a/ n" I4 I
String auth = Username + ":" + Password;" v/ l' [. ]4 g# h8 A
byte[] encodedAuth = Base64.encodeBase64(auth.getBytes(Charset.forName("US-ASCII")));
String authHeader = "Basic " + new String(encodedAuth);
Map header = new LinkedHashMap();) d4 p, J; u7 ^# k
header.put("Authorization", authHeader);7 p V+ O, K/ B" d+ Q
2、错误:{“status”:“fail”,“msg”:“tx rejected: checking result 0: checking output source: checking value source: checking mux source 0: checking value source: checking issuance program: pushing initial argument 0: run limit exceeded”} ,1 K' f6 L6 D2 i" q' O
交易费gas给少了9 {# C, P- \0 v; E3 e
**3、reservation found outputs already reserved **
表示该账户的utxo被暂时缓存,建议隔几分钟后再发该交易,一般是交易密码错误
4、build里面那个ttl是干嘛用的?8 y6 z G: p2 o$ J
ttl表示utxo的缓存时间, reservation found outputs already reserved, 这个错误对应的时间,time_range 是为了延迟交易上链的一个时间戳,ttl 为 0 的话会采用默认的时间,大概2两个块的时间(五分钟),超过ttl不能重新 build-transaction- ~6 Q& b' A. X; a2 x
5、一笔交易最大可以支持多少上链数据?
上链数据和gas上限有关,现在比原链数据上限为175000字节 = 170 KB
6、如何配置区块数据到指定位置5 T$ N% O0 t0 w7 H. R2 l* k
$ ./bytomd node --mining --home
成为第一个吐槽的人