graphprotocol / agora Goto Github PK
View Code? Open in Web Editor NEWCost model
License: MIT License
Cost model
License: MIT License
It would be nice to see things like:
It would be great if cost models written in Agora supported comments, allowing indexers to take note of why certain queries are priced in a certain way, why matching rules are placed in a certain order, or simply to structure cost models in neat way.
Getting this when I run npm install -g @graphprotocol/indexer-cli
:
npm ERR! warning: ar: /usr/local/lib/node_modules/@graphprotocol/indexer-cli/node_modules/@graphprotocol/cost-model/native/target/debug/build/neon-sys-3b6678701d556f27/out/native/build/Debug/obj.target/neon/src/neon.o: No such file or directory npm ERR! npm ERR! error: failed to run custom build command for `neon-sys v0.5.3` npm ERR!
npm ERR! Caused by:
npm ERR! process didn't exit successfully: `/usr/local/lib/node_modules/@graphprotocol/indexer-cli/node_modules/@graphprotocol/cost-model/native/target/debug/build/neon-sys-ecacff10f410d9d8/build-script-build` (exit status: 1)
npm ERR! --- stdout
npm ERR! cargo:node_arch=x64
npm ERR! TARGET = Some("x86_64-apple-darwin")
npm ERR! HOST = Some("x86_64-apple-darwin")
npm ERR! AR_x86_64-apple-darwin = None
npm ERR! AR_x86_64_apple_darwin = None
npm ERR! HOST_AR = None
npm ERR! AR = None
npm ERR! running: "ar" "cq" "/usr/local/lib/node_modules/@graphprotocol/indexer-cli/node_modules/@graphprotocol/cost-model/native/target/debug/build/neon-sys-3b6678701d556f27/out/libneon.a" "/usr/local/lib/node_modules/@graphprotocol/indexer-cli/node_modules/@graphprotocol/cost-model/native/target/debug/build/neon-sys-3b6678701d556f27/out/native/build/Debug/obj.target/neon/src/neon.o"
npm ERR! cargo:warning=ar: /usr/local/lib/node_modules/@graphprotocol/indexer-cli/node_modules/@graphprotocol/cost-model/native/target/debug/build/neon-sys-3b6678701d556f27/out/native/build/Debug/obj.target/neon/src/neon.o: No such file or directory npm ERR! exit status: 1
Any idea what's wrong?
I am simply trying to run the code, but I am getting this error:
$ cargo +nightly build
Compiling neon-build v0.9.1
Compiling semver-parser v0.7.0
Compiling smallvec v1.7.0
Compiling cslice v0.2.0
Compiling neon-sys v0.9.1
Compiling cost-model v0.1.0 (/Users/jovi/Documents/projects/GRT/agora-rust/node-plugin/lang)
Compiling semver v0.9.0
error: using `procedural-masquerade` crate
--> node-plugin/lang/src/lib.rs:30:1
|
30 | / rental! {
31 | | mod rentals {
32 | | use super::*;
33 | | #[rental]
... |
38 | | }
39 | | }
| |_^
|
= note: `#[deny(proc_macro_back_compat)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #83125 <https://github.com/rust-lang/rust/issues/83125>
= note: The `procedural-masquerade` crate has been unnecessary since Rust 1.30.0. Versions of this crate below 0.1.7 will eventually stop compiling.
= note: this error originates in the macro `rental` (in Nightly builds, run with -Z macro-backtrace for more info)
error: could not compile `cost-model` due to 2 previous errors
warning: build failed, waiting for other jobs to finish...
error: build failed
Here are my toolchains:
$ rustup toolchain list
stable-x86_64-apple-darwin
beta-x86_64-apple-darwin
nightly-2018-08-01-x86_64-apple-darwin
nightly-x86_64-apple-darwin (default) (override)
1.23.0-x86_64-apple-darwin
1.26.0-x86_64-apple-darwin
1.29.0-x86_64-apple-darwin
1.30.0-x86_64-apple-darwin
What should the correct format of globals.json be? It's not optional to agora either and I think it should be.
root@graph:~# ~/agora/target/release/agora --version
agora 0.1.0
root@graph:~# cat ~/queries/globals.json
{"$USD_TO_GRT":".03"}
root@graph:~# cat agora2.sh
~/agora/target/release/agora \
--load-log ~/queries/logs.treebuf \
--globals ~/queries/globals.json \
--grt-per-effort 1000 \
--cost ~/queries/cost-model.agora
root@graph:~# ./agora2.sh
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: ()', agora/src/model_loader.rs:8:41
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
root@graph:~# RUST_BACKTRACE=full ./agora2.sh
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: ()', agora/src/model_loader.rs:8:41
stack backtrace:
0: 0x55afe9ac1545 - backtrace::backtrace::libunwind::trace::h14d338b30b3ea0a7
at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.46/src/backtrace/libunwind.rs:86
1: 0x55afe9ac1545 - backtrace::backtrace::trace_unsynchronized::h73ea91d74a3fd67f
at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.46/src/backtrace/mod.rs:66
2: 0x55afe9ac1545 - std::sys_common::backtrace::_print_fmt::hd42948c952866e12
at src/libstd/sys_common/backtrace.rs:78
3: 0x55afe9ac1545 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::ha8f928866ff7571e
at src/libstd/sys_common/backtrace.rs:59
4: 0x55afe9ae5fec - core::fmt::write::he0c1e5f7426d2718
at src/libcore/fmt/mod.rs:1076
5: 0x55afe9abe882 - std::io::Write::write_fmt::hf3afc6cfd57d0033
at src/libstd/io/mod.rs:1537
6: 0x55afe9ac3be0 - std::sys_common::backtrace::_print::hfc0110703f3696fd
at src/libstd/sys_common/backtrace.rs:62
7: 0x55afe9ac3be0 - std::sys_common::backtrace::print::h3f77c6990ddfaa22
at src/libstd/sys_common/backtrace.rs:49
8: 0x55afe9ac3be0 - std::panicking::default_hook::{{closure}}::heae49580a8d62d75
at src/libstd/panicking.rs:198
9: 0x55afe9ac392c - std::panicking::default_hook::hecc34e3f729e213c
at src/libstd/panicking.rs:217
10: 0x55afe9ac4223 - std::panicking::rust_panic_with_hook::he82f5d0644692441
at src/libstd/panicking.rs:526
11: 0x55afe9ac3e1b - rust_begin_unwind
at src/libstd/panicking.rs:437
12: 0x55afe9ae4981 - core::panicking::panic_fmt::h09c929f06bb87c98
at src/libcore/panicking.rs:85
13: 0x55afe9ae47a3 - core::option::expect_none_failed::h188f17af6c9f404b
at src/libcore/option.rs:1269
14: 0x55afe999d4c6 - agora::model_loader::load::h458e3f9640877754
15: 0x55afe9991360 - agora::main::he856d06b59203b45
16: 0x55afe99a5493 - std::rt::lang_start::{{closure}}::hbe3367f92c81bf34
17: 0x55afe9ac46c3 - std::rt::lang_start_internal::{{closure}}::h5d3ea623498f5f43
at src/libstd/rt.rs:52
18: 0x55afe9ac46c3 - std::panicking::try::do_call::hac65e71be769a440
at src/libstd/panicking.rs:348
19: 0x55afe9ac46c3 - std::panicking::try::hd4706e264bcf6712
at src/libstd/panicking.rs:325
20: 0x55afe9ac46c3 - std::panic::catch_unwind::h948a0fb4a8b3ee82
at src/libstd/panic.rs:394
21: 0x55afe9ac46c3 - std::rt::lang_start_internal::h72cc068ed2d0ac53
at src/libstd/rt.rs:51
22: 0x55afe9992d52 - main
23: 0x7fcd56d9a0b3 - __libc_start_main
24: 0x55afe997919e - _start
25: 0x0 - <unknown>
error: failed to run custom build command for neon-sys v0.4.0 (https://github.com/neon-bindings/neon.git?rev=20df99bedc13ee1bd7f4801a74920bd81ff099d7#20df99be)
Caused by:
process didn't exit successfully: /home/graph/agora/target/release/build/neon-sys-b7f0dcc8a78f3667/build-script-build
(exit code: 101)
--- stderr
thread 'main' panicked at 'Failed to run "npm install" for neon-sys!', /home/graph/.cargo/git/checkouts/neon-c7726a943d80a72d/20df99b/crates/neon-sys/build.rs:150:70
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.