Closed zwht closed 3 years ago
/root/app/my_ripple_experiment/node_modules/ripple-lib/dist/npm/common/schema-validator.js:182 throw new errors_1.ValidationError(result.errors.join()); ^
ValidationError: instance.server 与 Object.schemaValidate (/root/app/my_ripple_experiment/node_modules/ripple-lib/dist/npm/common/schema ) 中的模式“^(wss?|wss?+unix)://”不匹配-validator.js:182:15) at apply (/root/app/my_ripple_experiment/node_modules/lodash/lodash.js:489:27) at Object.wrapper [as apiOptions] (/root/app/my_ripple_experiment/node_modules/lodash /lodash.js:5379:16) 在对象的 新 RippleAPI (/root/app/my_ripple_experiment/node_modules/ripple-lib/dist/npm/api.js:147:27) 。(/root/app/my_ripple_experiment/get-account-info.js:3:13) at Module._compile (internal/modules/cjs/loader.js:1147:30) at Object.Module._extensions..js (internal /modules/cjs/loader.js:1167:10) 在 Module.load (internal/modules/cjs/loader.js:996:32) 在 Function.Module._load (internal/modules/cjs/loader.js:896:14) at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12) { name: 'ValidationError', data : 未定义 }
const api = new RippleAPI({ server: ' http://127.0.0.1:5005 ' //server: 'wss://s1.ripple.com' // 公共波纹服务器 });
启动服务器: rippled -a --start --conf=/etc/opt/ripple/rippled.cfg &
波纹服务器信息
{ "result" : { "info" : { "build_version" : "1.7.2", "complete_ledgers" : "2", "hostid" : "instance-hj7a3tnz", "io_latency_ms" : 1, "jq_trans_overflow" : "0", "last_close" : { "converge_time_s" : 0, "proposers" : 0 }, "load" : { "job_types" : [ { "in_progress" : 1, "job_type" : "clientCommand" } ], "threads" : 1 }, "load_factor" : 1, "peer_disconnects" : "0", "peer_disconnects_resources" : "0", "peers" : 0, "pubkey_node" : "n9LXXW27UQftbSZuKZ3BXgVSEWuy91p67nABSgcvxq4wCxsgwmnJ", "pubkey_validator" : "none", "server_state" : "full", "server_state_duration_us" : "641662381", "state_accounting" : { "connected" : { "duration_us" : "0", "transitions" : 0 }, "disconnected" : { "duration_us" : "246723", "transitions" : 1 }, "full" : { "duration_us" : "641662381", "transitions" : 1 }, "syncing" : { "duration_us" : "0", "transitions" : 0 }, "tracking" : { "duration_us" : "0", "transitions" : 0 } }, "time" : "2021-Jun-21 01:23:53.647988 UTC", "uptime" : 641, “validated_ledger”:{ “年龄”:643, “base_fee_xrp”:1E-05, “散列”: “D588CB0AB4947CCAA61ED693276E21C30AEA4B19E7FDC2403E818B833E093C63”, “reserve_base_xrp”:200, “reserve_inc_xrp”:50, “SEQ”:2 }, “validation_quorum”: 0, "validator_list" : { "count" : 0, "expiration" : "unknown", "status" : "unknown" } }, "status" : "success" } }
/root/app/my_ripple_experiment/node_modules/ripple-lib/dist/npm/common/schema-validator.js:182 throw new errors_1.ValidationError(result.errors.join()); ^
ValidationError: instance.server does not match pattern "^(wss?|wss?\+unix)://" at Object.schemaValidate (/root/app/my_ripple_experiment/node_modules/ripple-lib/dist/npm/common/schema-validator.js:182:15) at apply (/root/app/my_ripple_experiment/node_modules/lodash/lodash.js:489:27) at Object.wrapper [as apiOptions] (/root/app/my_ripple_experiment/node_modules/lodash/lodash.js:5379:16) at new RippleAPI (/root/app/my_ripple_experiment/node_modules/ripple-lib/dist/npm/api.js:147:27) at Object. (/root/app/my_ripple_experiment/get-account-info.js:3:13)
at Module._compile (internal/modules/cjs/loader.js:1147:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1167:10)
at Module.load (internal/modules/cjs/loader.js:996:32)
at Function.Module._load (internal/modules/cjs/loader.js:896:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12) {
name: 'ValidationError',
data: undefined
}
const api = new RippleAPI({ server: 'http://127.0.0.1:5005' //server: 'wss://s1.ripple.com' // Public rippled server });
start server: rippled -a --start --conf=/etc/opt/ripple/rippled.cfg &
rippled server_info
{ "result" : { "info" : { "build_version" : "1.7.2", "complete_ledgers" : "2", "hostid" : "instance-hj7a3tnz", "io_latency_ms" : 1, "jq_trans_overflow" : "0", "last_close" : { "converge_time_s" : 0, "proposers" : 0 }, "load" : { "job_types" : [ { "in_progress" : 1, "job_type" : "clientCommand" } ], "threads" : 1 }, "load_factor" : 1, "peer_disconnects" : "0", "peer_disconnects_resources" : "0", "peers" : 0, "pubkey_node" : "n9LXXW27UQftbSZuKZ3BXgVSEWuy91p67nABSgcvxq4wCxsgwmnJ", "pubkey_validator" : "none", "server_state" : "full", "server_state_duration_us" : "641662381", "state_accounting" : { "connected" : { "duration_us" : "0", "transitions" : 0 }, "disconnected" : { "duration_us" : "246723", "transitions" : 1 }, "full" : { "duration_us" : "641662381", "transitions" : 1 }, "syncing" : { "duration_us" : "0", "transitions" : 0 }, "tracking" : { "duration_us" : "0", "transitions" : 0 } }, "time" : "2021-Jun-21 01:23:53.647988 UTC", "uptime" : 641, "validated_ledger" : { "age" : 643, "base_fee_xrp" : 1e-05, "hash" : "D588CB0AB4947CCAA61ED693276E21C30AEA4B19E7FDC2403E818B833E093C63", "reserve_base_xrp" : 200, "reserve_inc_xrp" : 50, "seq" : 2 }, "validation_quorum" : 0, "validator_list" : { "count" : 0, "expiration" : "unknown", "status" : "unknown" } }, "status" : "success" } }